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

Diff for /src/usr.bin/rpcgen/rpc_sample.c between version 1.4 and 1.5

version 1.4, 2001/07/17 02:23:59 version 1.5, 2001/07/18 22:26:00
Line 42 
Line 42 
 #include <sys/cdefs.h>  #include <sys/cdefs.h>
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
 #include "rpc_scan.h"  
 #include "rpc_parse.h"  #include "rpc_parse.h"
 #include "rpc_util.h"  #include "rpc_util.h"
   
 static char RQSTP[] = "rqstp";  static char RQSTP[] = "rqstp";
   
 void printarglist();  void printarglist();
 static void write_sample_client __P((char *, version_list *));  static write_sample_client __P((char *, version_list *));
 static void write_sample_server __P((definition *));  static write_sample_server __P((definition *));
 static void return_type __P((proc_list *));  static return_type __P((proc_list *));
   
 void  void
 write_sample_svc(def)  write_sample_svc(def)
Line 82 
Line 81 
 }  }
   
   
 static void  static
 write_sample_client(program_name, vp )  write_sample_client(program_name, vp )
      char* program_name;       char* program_name;
      version_list *vp;       version_list *vp;
Line 165 
Line 164 
   f_print(fout, "}\n");    f_print(fout, "}\n");
 }  }
   
 static void  static
 write_sample_server(def)  write_sample_server(def)
         definition *def;          definition *def;
 {  {
Line 185 
Line 184 
   
                         f_print(fout, "{\n");                          f_print(fout, "{\n");
                         f_print(fout, "\n\tstatic ");                          f_print(fout, "\n\tstatic ");
                         if(streq( proc->res_type, "void"))                          if( !streq( proc->res_type, "void") )
                           f_print(fout, "char*");  /* cannot have void type */  
                         else  
                           return_type(proc);                            return_type(proc);
                         f_print(fout, " result;\n");                          else
                             f_print(fout, "char*" );  /* cannot have void type */
                           f_print(fout, " result;\n", proc->res_type);
                         f_print(fout,                          f_print(fout,
                                 "\n\t/*\n\t * insert server code here\n\t */\n\n");                                  "\n\t/*\n\t * insert server code here\n\t */\n\n");
                         if( !streq( proc->res_type, "void") )                          if( !streq( proc->res_type, "void") )
Line 204 
Line 203 
         }          }
 }  }
   
 static void  static
 return_type(plist)  return_type(plist)
         proc_list *plist;          proc_list *plist;
 {  {
         ptype( plist->res_prefix, plist->res_type, 1 );          ptype( plist->res_prefix, plist->res_type, 1 );
 }  }
   
 void  
 add_sample_msg()  add_sample_msg()
 {  {
         f_print(fout, "/*\n");          f_print(fout, "/*\n");

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5