[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

rpcgen :-(



I'm trying to use rpcgen. I have the sample program below,
which I didn't write. (Typical lecturer spaghetti code, if I had
a dollar for every program written by a lecturer that I'd had to fix
in the past four years, I'd have quite a few bucks! </rant>)

Anyway, rpcgen appears to like running cpp on the code,
and, well, on hamm:

[9:50pm] hamish@yodeller:~> rpcgen tmp/msg.x 
  {
^^^
/usr/include/gnu/types.h, line 34: expected 'identifier'
[9:50pm] hamish@yodeller:~> cpp: output pipe has been closed


And on bo:

[9:54pm] hamish@silly:~/tmp> rpcgen msg.x 
typedef void * _G_va_list;
^^^^^^^^^^^^
/usr/include/_G_config.h, line 45: voids allowed only inside union and program definitions with one argument
[9:54pm] hamish@silly:~/tmp> cpp: output pipe has been closed

And sadly, even Slowaris, the target platform,

[9:52pm] moffatt@yallara[~/uni/cs505] rpcgen msg.x 
#ident      "@(#)stdio.h     1.49        97/05/09 SMI"      
^
/usr/include/stdio.h, line 15: preprocessor error


Ideas? It doesn't seem very intelligent for rpcgen to be running cpp,
or at least rpcgen needs some sort of update for current cpp lingo.


thanks,
Hamish



/*
 * msg.x: Remote message printing protocol
 */


program MESSAGEPROG
 {version PRINTMESSAGEVERS
   {int PRINTMESSAGE(string) = 1;
   } = 1;
 } = 0x20000099;	/* You should replace the last 6 digits with your UID */ 

/*********************************************************************/
#include <stdio.h>
/* #include "msg.h" */


main(argc, argv)

int argc;
char *argv[];

{
CLIENT *clnt;
int *result;
char *server;
char *message;


  if (argc != 3)
   {fprintf(stderr, "usage:%s<message>\n",argv[0]);
    exit(1);
   }
  server = argv[1];
  message = argv[2];

  clnt = clnt_create(server, MESSAGEPROG, PRINTMESSAGEVERS, "visible");
  if(clnt == (CLIENT *) NULL)
   {clnt_pcreateerror(server);
    exit(1);
   }

  result = printmessage_1(&message, clnt);
  if(result == (int *) NULL)
   {clnt_perror(clnt, server);
    exit(1);
   }

  if(*result == 0)
   {fprintf(stderr, "%s:could not print your messsage\n", argv[0]);
    exit(1);
   }
  printf("message delivered to %s\n", server);
  clnt_destroy (clnt);
  exit(0);
}


/*********************************************************************/
#include <stdio.h>

#if 0
#include  <rpc/rpc.h>
#endif

/* #include "msg.h" */





int *
printmessage_1(msg, req)

char **msg;
struct svc_req *req;

{
static int result;
FILE *f;

  f = fopen ("print_file", "w");
  if(f == (FILE *) NULL)
   {result = 0;
    return (&result);
   }
  fprintf (f, "%s\n", *msg);
  fclose (f);
  result = 1;
  return (&result);

}



-- 
Hamish Moffatt       Mobile: +61 412 011 176       hamish@rising.com.au

Rising Software Australia Pty. Ltd. 
Developers of music education software including Auralia & Musition.
31 Elmhurst Road, Blackburn, Victoria Australia, 3130
Phone: +61 3 9894 4788  Fax: +61 3 9894 3362  USA Toll Free: 1-888-667-7839
Internet: http://www.rising.com.au/


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: