Print this page
rpcgen should only produce ANSI code


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*


  23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  27 /* All Rights Reserved */
  28 /*
  29  * University Copyright- Copyright (c) 1982, 1986, 1988
  30  * The Regents of the University of California
  31  * All Rights Reserved
  32  *
  33  * University Acknowledgment- Portions of this document are derived from
  34  * software developed by the University of California, Berkeley, and its
  35  * contributors.
  36  */
  37 
  38 /*
  39  * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler
  40  */
  41 #include <stdio.h>
  42 #include <string.h>


 115                         if (current != expected++) {
 116                                 f_print(fout,
 117                         "\n/*\n * WARNING: table out of order\n */\n");
 118                                 if (warning == 0) {
 119                                         f_print(stderr,
 120                                     "WARNING %s table is out of order\n",
 121                                             progvers);
 122                                         warning = 1;
 123                                         nonfatalerrors = 1;
 124                                 }
 125                                 expected = current + 1;
 126                         }
 127                         if (tirpcflag)
 128                                 f_print(fout,
 129                                     "\n\t(void *(*)())RPCGEN_ACTION(");
 130                         else
 131                                 f_print(fout,
 132                                     "\n\t(char *(*)())RPCGEN_ACTION(");
 133 
 134                         /* routine to invoke */
 135                         if (Cflag && !newstyle)
 136                                 pvname_svc(proc->proc_name, vp->vers_num);
 137                         else {
 138                                 if (newstyle) /* calls internal func */
 139                                         f_print(fout, "_");
 140                                 pvname(proc->proc_name, vp->vers_num);
 141                         }
 142                         f_print(fout, "),\n");
 143 
 144                         /* argument info */
 145                         if (proc->arg_num > 1)
 146                                 printit(NULL, proc->args.argname);
 147                         else
 148                         /* do we have to do something special for newstyle */
 149                                 printit(proc->args.decls->decl.prefix,
 150                                     proc->args.decls->decl.type);
 151                         /* result info */
 152                         printit(proc->res_prefix, proc->res_type);
 153                 }
 154 
 155                 /* print the table trailer */




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  29 /* All Rights Reserved */
  30 /*
  31  * University Copyright- Copyright (c) 1982, 1986, 1988
  32  * The Regents of the University of California
  33  * All Rights Reserved
  34  *
  35  * University Acknowledgment- Portions of this document are derived from
  36  * software developed by the University of California, Berkeley, and its
  37  * contributors.
  38  */
  39 
  40 /*
  41  * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler
  42  */
  43 #include <stdio.h>
  44 #include <string.h>


 117                         if (current != expected++) {
 118                                 f_print(fout,
 119                         "\n/*\n * WARNING: table out of order\n */\n");
 120                                 if (warning == 0) {
 121                                         f_print(stderr,
 122                                     "WARNING %s table is out of order\n",
 123                                             progvers);
 124                                         warning = 1;
 125                                         nonfatalerrors = 1;
 126                                 }
 127                                 expected = current + 1;
 128                         }
 129                         if (tirpcflag)
 130                                 f_print(fout,
 131                                     "\n\t(void *(*)())RPCGEN_ACTION(");
 132                         else
 133                                 f_print(fout,
 134                                     "\n\t(char *(*)())RPCGEN_ACTION(");
 135 
 136                         /* routine to invoke */
 137                         if (!newstyle)
 138                                 pvname_svc(proc->proc_name, vp->vers_num);
 139                         else {
 140                                 if (newstyle) /* calls internal func */
 141                                         f_print(fout, "_");
 142                                 pvname(proc->proc_name, vp->vers_num);
 143                         }
 144                         f_print(fout, "),\n");
 145 
 146                         /* argument info */
 147                         if (proc->arg_num > 1)
 148                                 printit(NULL, proc->args.argname);
 149                         else
 150                         /* do we have to do something special for newstyle */
 151                                 printit(proc->args.decls->decl.prefix,
 152                                     proc->args.decls->decl.type);
 153                         /* result info */
 154                         printit(proc->res_prefix, proc->res_type);
 155                 }
 156 
 157                 /* print the table trailer */