RCSID("$Header$");
#include <stdio.h>
+#include <string.h>
#include <ctype.h>
#include "rpc_util.h"
#include "rpc_parse.h"
static pstructdef();
static puniondef();
static pprogramdef();
+static psprocdef();
static penumdef();
static ptypedef();
static pdeclaration();
case DEF_PROGRAM:
pprogramdef(def);
break;
+ case DEF_PROC:
+ psprocdef(def);
+ break;
case DEF_CONST:
pconstdef(def);
break;
}
}
+static
+psproc1(defp,callTconnF,type,prefix,iomask)
+definition *defp;
+int callTconnF;
+char *type, *prefix;
+int iomask;
+{
+ proc1_list *plist, *plist1;
+
+ f_print(fout,"\nextern %s %s%s%s(\n",type,prefix,defp->pc.proc_prefix,defp->pc.proc_name);
+
+ if (callTconnF) {
+ f_print(fout,"\t/*IN */ struct rx_call *z_call");
+ } else {
+ f_print(fout,"\t/*IN */ struct rx_connection *z_conn");
+ }
+
+ for (plist = defp->pc.plists; plist; plist = plist->next) {
+ if (plist->component_kind == DEF_PARAM && (iomask & (1<<plist->pl.param_kind))) {
+ switch (plist->pl.param_kind) {
+ case DEF_INPARAM: f_print(fout,",\n\t/*IN */ "); break;
+ case DEF_OUTPARAM: f_print(fout,",\n\t/*OUT*/ "); break;
+ case DEF_INOUTPARAM: f_print(fout,",\n\t/*I/O*/ "); break;
+ }
+ if (plist->pl.param_flag & OUT_STRING) {
+ f_print(fout,"%s *%s",plist->pl.param_type,plist->pl.param_name);
+ } else {
+ f_print(fout,"%s %s",plist->pl.param_type,plist->pl.param_name);
+ }
+ }
+ }
+ f_print(fout, ");\n");
+}
+
+static
+psprocdef(defp)
+definition *defp;
+{
+ int split_flag = defp->pc.split_flag;
+
+ if (split_flag) {
+ psproc1(defp,1,"int","Start",(1<<DEF_INPARAM )|(1<<DEF_INOUTPARAM));
+ psproc1(defp,1,"int","End", (1<<DEF_OUTPARAM)|(1<<DEF_INOUTPARAM));
+ } else {
+ psproc1(defp,0,"int","",0xFFFFFFFF);
+ }
+
+ psproc1(defp,1,"afs_int32","S",0xFFFFFFFF);
+}
+
pprocdef(proc, vp)
proc_list *proc;
}
if (tok.kind == TOK_SPLIT) {
proc_split = 1;
+ defp->pc.split_flag = 1;
scan2(TOK_EQUAL, TOK_SEMICOLON, &tok);
}
+ else {
+ defp->pc.split_flag = 0;
+ }
if (tok.kind == TOK_EQUAL) {
if (opcodesnotallowed[PackageIndex])
error("Opcode assignment isn't allowed here!");