]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blobdiff - src/forb/forb-idl/forb-idl-c-skels.c
forb: Add debugging messages that show which method is going to be executed
[frescor/frsh-forb.git] / src / forb / forb-idl / forb-idl-c-skels.c
index d0d6971f75345871da6ebff0201cee69bda8c4df..a20f93b61cca4dc3c391084b6bb454514efae5db 100644 (file)
@@ -442,10 +442,30 @@ cbe_skel_do_interface(IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci)
   }
   fprintf(ci->fh, "};\n\n");
 
+  fprintf(ci->fh, "static const char * const %s_method_names[%d] = {\n",
+         id, num_methods);
+  for(sub = IDL_INTERFACE(tree).body; sub; sub = IDL_LIST(sub).next) {
+    IDL_tree cur = IDL_LIST(sub).data;
+
+    switch(IDL_NODE_TYPE(cur)) {
+    case IDLN_OP_DCL: {
+      char *op_id;
+      op_id = IDL_ns_ident_to_qstring(IDL_IDENT_TO_NS(IDL_OP_DCL(cur).ident), "_", 0);
+      fprintf(ci->fh, "  \"%s\",\n", op_id);
+      g_free(op_id);
+      break;
+    }
+    default:
+      break;
+    }
+  }
+  fprintf(ci->fh, "};\n\n");
+
   fprintf(ci->fh, "static const struct forb_interface %s_interface = {\n", id);
   fprintf(ci->fh, "  .name = \"%s\",\n", id);
   fprintf(ci->fh, "  .num_methods = %d,\n", num_methods);
   fprintf(ci->fh, "  .skeletons = %s_skeletons,\n", id);
+  fprintf(ci->fh, "  .method_names = %s_method_names,\n", id);
   fprintf(ci->fh, "  .type_hash = 0 /* not implemented */\n");
   fprintf(ci->fh, "};\n\n");