[BACK]Return to rpc_tblout.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rpcgen

Diff for /src/usr.bin/rpcgen/rpc_tblout.c between version 1.6 and 1.7

version 1.6, 2001/11/24 19:19:59 version 1.7, 2001/12/05 09:50:31
Line 53 
Line 53 
 static char tbl_end[] = "};\n";  static char tbl_end[] = "};\n";
   
 static char null_entry[] = "\n\t(char *(*)())0,\n\  static char null_entry[] = "\n\t(char *(*)())0,\n\
  \t(xdrproc_t) xdr_void,\t\t\t0,\n\  \t(xdrproc_t) xdr_void,\t\t\t0,\n\
  \t(xdrproc_t) xdr_void,\t\t\t0,\n";  \t(xdrproc_t) xdr_void,\t\t\t0,\n";
   
 static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n";  static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n";
   
 static write_table __P((definition *));  static void write_table __P((definition *));
 static printit __P((char *, char *));  static void printit __P((char *, char *));
   
 void  void
 write_tables()  write_tables()
 {  {
         list *l;  
         definition *def;          definition *def;
           list *l;
   
         f_print(fout, "\n");          f_print(fout, "\n");
         for (l = defined; l != NULL; l = l->next) {          for (l = defined; l != NULL; l = l->next) {
                 def = (definition *) l->val;                  def = (definition *) l->val;
                 if (def->def_kind == DEF_PROGRAM) {                  if (def->def_kind == DEF_PROGRAM)
                         write_table(def);                          write_table(def);
                 }  
         }          }
 }  }
   
 static  static void
 write_table(def)  write_table(def)
         definition *def;          definition *def;
 {  {
Line 104 
Line 103 
                         current = atoi(proc->proc_num);                          current = atoi(proc->proc_num);
                         if (current != expected++) {                          if (current != expected++) {
                                 f_print(fout,                                  f_print(fout,
                         "\n/*\n * WARNING: table out of order\n */\n");                                      "\n/*\n * WARNING: table out of order\n */\n");
                                 if (warning == 0) {                                  if (warning == 0) {
                                         f_print(stderr,                                          f_print(stderr,
                                     "WARNING %s table is out of order\n",                                              "WARNING %s table is out of order\n",
                                             progvers);                                              progvers);
                                         warning = 1;                                          warning = 1;
                                         nonfatalerrors = 1;                                          nonfatalerrors = 1;
Line 117 
Line 116 
                         f_print(fout, "\n\t(char *(*)())RPCGEN_ACTION(");                          f_print(fout, "\n\t(char *(*)())RPCGEN_ACTION(");
   
                         /* routine to invoke */                          /* routine to invoke */
                         if ( !newstyle)                          if (!newstyle)
                           pvname_svc(proc->proc_name, vp->vers_num);                                  pvname_svc(proc->proc_name, vp->vers_num);
                         else {                          else {
                           if( newstyle )                                  if (newstyle)
                             f_print( fout, "_");   /* calls internal func */                                          f_print(fout, "_");   /* calls internal func */
                           pvname(proc->proc_name, vp->vers_num);                                  pvname(proc->proc_name, vp->vers_num);
                         }                          }
                         f_print(fout, "),\n");                          f_print(fout, "),\n");
   
                         /* argument info */                          /* argument info */
                         if( proc->arg_num > 1 )                          if (proc->arg_num > 1)
                           printit((char*) NULL, proc->args.argname );                                  printit((char*) NULL, proc->args.argname);
                         else                          else
                           /* do we have to do something special for newstyle */                                  /* do we have to do something special for newstyle */
                           printit( proc->args.decls->decl.prefix,                                  printit(proc->args.decls->decl.prefix,
                                   proc->args.decls->decl.type );                                      proc->args.decls->decl.type);
                         /* result info */                          /* result info */
                         printit(proc->res_prefix, proc->res_type);                          printit(proc->res_prefix, proc->res_type);
                 }                  }
Line 143 
Line 142 
         }          }
 }  }
   
 static  static void
 printit(prefix, type)  printit(prefix, type)
         char *prefix;          char *prefix;
         char *type;          char *type;
 {  {
         int len;          int len, tabs;
         int tabs;  
   
   
         len = fprintf(fout, "\txdr_%s,", stringfix(type));          len = fprintf(fout, "\txdr_%s,", stringfix(type));
         /* account for leading tab expansion */          /* account for leading tab expansion */
         len += TABSIZE - 1;          len += TABSIZE - 1;
Line 162 
Line 159 
         if (streq(type, "void")) {          if (streq(type, "void")) {
                 f_print(fout, "0");                  f_print(fout, "0");
         } else {          } else {
                 f_print(fout, "sizeof ( ");                  f_print(fout, "sizeof (");
                 /* XXX: should "follow" be 1 ??? */                  /* XXX: should "follow" be 1 ??? */
                 ptype(prefix, type, 0);                  ptype(prefix, type, 0);
                 f_print(fout, ")");                  f_print(fout, ")");

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7