]> rtime.felk.cvut.cz Git - frescor/forb.git/commitdiff
Reorganized header files
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 29 Sep 2008 15:47:35 +0000 (17:47 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 29 Sep 2008 15:47:35 +0000 (17:47 +0200)
Now applications do not include useless and internal stuff such as
cdr.h and forb-internal.h (indirectly through IDL generated .h files).

Makefile.omk
cdr.h
forb-idl/forb-idl-c-common.c
forb-idl/forb-idl-c-headers.c
forb-idl/forb-idl-c-skels.c
forb-idl/forb-idl-c-stubs.c
forb-internal.h
forb.h
tests/object_to_string/obj2str.c

index ce6f153ca254bce44d1ddb92792c2ed4afb7cfa9..34ae78e20d6cee84f8e475d5d5805172798a768e 100644 (file)
@@ -22,6 +22,7 @@ renamed_include_HEADERS += \
        $(call to_forb_subdir, forb-internal.h) \
        $(call to_forb_subdir, basic_types.h) \
        $(call to_forb_subdir, cdr.h) \
+       $(call to_forb_subdir, cdr_codec.h) \
        $(call to_forb_subdir, iop.h) \
        $(call to_forb_subdir, uuid.h) \
        $(call to_forb_subdir, syncobj.h) \
diff --git a/cdr.h b/cdr.h
index cbfe1b89e7027dc3c60f4528e2325d6a39a08911..2feede685b1f312f8e5d1bf88580c004031e8f21 100644 (file)
--- a/cdr.h
+++ b/cdr.h
@@ -31,6 +31,7 @@
 #define _ORTE_CDR_H_
 
 #include "basic_types.h"
+#include "cdr_codec.h"
 
 /*
  * Alignment of CORBA types mapped to C.
@@ -69,7 +70,7 @@ typedef enum {
  *
  * Struct @CDR_Codec is used by serialization and deserialization functions.
  */
-typedef struct CDR_Codec {
+struct CDR_Codec {
        CDR_Endianness host_endian;
        CDR_Endianness data_endian;
        CORBA_octet *buffer;
@@ -80,7 +81,7 @@ typedef struct CDR_Codec {
        unsigned int rptr;
        CORBA_boolean readonly;
        CORBA_boolean release_buffer;
-} CDR_Codec;
+};
 
 #define HEXDIGIT(c) (isdigit((guchar)(c))?(c)-'0':tolower((guchar)(c))-'a'+10)
 #define HEXOCTET(a,b) ((HEXDIGIT((a)) << 4) | HEXDIGIT((b)))
index 7dc7aeabf09a3ecd73f5730c17f79200cae78c67..11f4da5111392b5d5e80a57f0585b1c48c9ecc97 100644 (file)
@@ -164,7 +164,7 @@ static void
 cc_output_ser_seqence(OIDL_C_Info *ci,
                      IDL_tree     s)
 {
-       IDL_tree cur, curmem;
+        //IDL_tree cur, curmem;
        char *id, *type;
        IDL_tree tts;
        gboolean fake_if;
@@ -867,7 +867,8 @@ forb_idl_output_c_common (IDL_tree       tree,
 /*     fprintf (ci->fh, "#define FORB2_STUBS_API\n"); */
 /*     fprintf (ci->fh, "#define FORB_IDL_C_COMMON\n"); */
 /*     fprintf (ci->fh, "#define %s_COMMON\n", ci->c_base_name); */
-       fprintf (ci->fh, "#include \"%s.h\"\n\n", ci->base_name);
+       fprintf (ci->fh, "#include \"%s.h\"\n", ci->base_name);
+       fprintf (ci->fh, "#include \"forb/cdr.h\"\n\n");
 /*     fprintf (ci->fh, "static const CORBA_unsigned_long Forb_zero_int = 0;\n"); */
 
        /* FIXME: this is slightly nasty, but we need these in common,
index e81987c5b5df2ee9681e4f5ed43c699982b50879..e47d8712daa092b393eac6e2829e6ee7055ce1f8 100644 (file)
@@ -148,15 +148,12 @@ forb_idl_output_c_headers (IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci)
 
   fprintf(ci->fh, "#define FORB_IDL_SERIAL %d\n", FORB_CONFIG_SERIAL);
 
-  if (rinfo->is_pidl) {
-    /* Include only serialization stuff */
-    fprintf(ci->fh, "#include <forb/cdr.h>\n"
-                   "#include <forb/basic_types.h>\n"
-                   "\n");
-  } else {
-    fprintf(ci->fh, "#include <forb/forb-internal.h>\n");
-    fprintf(ci->fh, "#include <forb/object.h>\n\n");
+  fprintf(ci->fh, "#include <forb/cdr_codec.h>\n");
+  if (!rinfo->is_pidl) {
+    fprintf(ci->fh, "#include <forb/forb.h>\n");
   }
+  fprintf(ci->fh, "#include <forb/basic_types.h>\n");
+  fprintf(ci->fh, "\n");
 
   fprintf(ci->fh, "#ifdef __cplusplus\n");
   fprintf(ci->fh, "extern \"C\" {\n");
@@ -451,7 +448,7 @@ ch_output_interface(IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci)
 
        ch_output_impl_struct(tree, rinfo, ci);
 
-       fprintf(ci->fh, "void forb_register_%s_interface(void);\n", fullname);
+/*     fprintf(ci->fh, "void forb_register_%s_interface(void);\n", fullname); */
        fprintf(ci->fh, "%s forb_%s_new(void *instance_data,\n"
                        "               const struct forb_%s_impl *impl, forb_orb orb);\n\n",
                fullname, fullname, fullname);
index df293f04433e51929604e67c751237de943e92bf..8dde2009b720030f0d2d1970e41fc64ad9cec6ba 100644 (file)
@@ -486,6 +486,9 @@ forb_idl_output_c_skeletons (IDL_tree       tree,
 /*     fprintf (ci->fh, "#include <string.h>\n"); */
 /*     fprintf (ci->fh, "#define FORB2_STUBS_API\n"); */
        fprintf (ci->fh, "#include \"%s.h\"\n\n", ci->base_name);
+       fprintf(ci->fh, "#include <forb/cdr.h>\n");
+       fprintf(ci->fh, "#include <forb/forb-internal.h>\n");
+       fprintf(ci->fh, "#include <forb/object.h>\n\n");
 
        ck_output_poastuff (tree, rinfo, ci);
 }
index b18f8aa6396c4985fc22fcc26d82b3e5b578c0e7..8c45a3325a950b106d98feaa9607e3c275d1e79b 100644 (file)
@@ -185,6 +185,8 @@ forb_idl_output_c_stubs (IDL_tree       tree,
        fprintf (ci->fh, "#include <forb/forb-internal.h>\n");
        fprintf (ci->fh, "#include <forb/request.h>\n");
        fprintf (ci->fh, "#include <forb/iop.h>\n");
+       fprintf (ci->fh, "#include <forb/cdr.h>\n");
+       fprintf (ci->fh, "#include <forb/object.h>\n\n");
        fprintf (ci->fh, "#include \"%s.h\"\n\n", ci->base_name);
 
        fprintf (ci->fh, "#define ex_on_fail(command, ex) if (!(command)) do { ev->major = (ex); goto exception; } while(0)\n");
index 8ea4ecc825b09ff2ae94e47d8e0ddf6583ee5fcc..108ac62d8b9dff49beffa6e95334921d4e335e4e 100644 (file)
@@ -48,6 +48,12 @@ struct forb {
        gavl_cust_root_field_t peers;
 };
 
+typedef void (*forb_skel_func)(CDR_Codec *cin,
+                              CDR_Codec *cout,
+                              struct forb_object *obj,
+                              struct forb_env *env);
+
+
 void
 forb_server_id_init(forb_server_id *serer);
 
diff --git a/forb.h b/forb.h
index bd72035fa78d71f9baccd236350f8c0814acb6ac..336c5eda85e5a0aa90b089955546d3c58339aa87 100644 (file)
--- a/forb.h
+++ b/forb.h
@@ -12,9 +12,9 @@
 #define FORB_H
 
 #include <forb/basic_types.h>
-#include <forb/cdr.h>
-#include <forb/types.h>
 #include <fosa.h>
+#include <forb/types.h>
+
 
 /**
  * FORB exception types. Inspired by CORBA's standard system
@@ -67,11 +67,6 @@ typedef forb_object CORBA_Object;
 typedef forb_object forb_orb;
 
 
-typedef void (*forb_skel_func)(CDR_Codec *cin,
-                              CDR_Codec *cout,
-                              struct forb_object *obj,
-                              struct forb_env *env);
-
 /* Incomplete types - declared in forb-internal.h */
 struct forb_interface;
 typedef struct forb_interface forb_interface_t;
index aae694c6ef73e46c56258b115e96d27701675e54..80868c5bd11576cc92666f28b7755243bc6fa203 100644 (file)
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include "interface.h"
 #include <error.h>
+#include <string.h>
 
 struct forb_i_impl i_impl =  { NULL };