--- /dev/null
+/sample.h
+/sample_client
+/sample_server
srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
+# This set of definitions tests the lwp RX library
+#CFLAGS=$(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS)
+#LIBS=${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a
-SRCDIR=/usr/andy/
-LIBRX=${SRCDIR}/lib/librx.a
-DESTDIR=/usr/andy/
-INSTALL=${SRCDIR}/bin/install
-LIBS=${LIBRX} ${SRCDIR}/lib/liblwp.a
-CFLAGS=${DBG} -I. -I${SRCDIR}/include -DDEBUG ${XCFLAGS} ${ARCHFLAGS}
+# This set of definitions tests the pthread one
+CFLAGS=$(COMMON_CFLAGS) $(MT_CFLAGS)
+LIBS=$(TOP_LIBDIR)/libafsauthent.a $(TOP_LIBDIR)/libafsrpc.a \
+ $(TOP_LIBDIR)/util.a
all: sample_client sample_server
sample_client.o: sample.h
sample_server.o: sample.h
-sample.cs.c sample.ss.c sample.er.c sample.h: sample.xg
- rxgen sample.xg
+sample.cs.c: sample.xg
+ $(RXGEN) -A -x -C -o $@ sample.xg
+sample.ss.c: sample.xg
+ $(RXGEN) -A -x -S -o $@ sample.xg
+sample.h: sample.xg
+ $(RXGEN) -A -x -h -o $@ sample.xg
+
+clean:
+ rm -f *.o sample.cs.c sample.ss.c sample_client sample_server
*/
package TEST_
+prefix S
%#include <rx/rx.h>
%#include <rx/rx_null.h>
#include "sample.h"
/* Bogus procedure to get internet address of host */
-static u_long
-GetIpAddress(hostname)
- char *hostname;
+static unsigned int
+GetIpAddress(char *hostname)
{
struct hostent *hostent;
- u_long host;
+ unsigned int host;
hostent = gethostbyname(hostname);
if (!hostent) {
printf("host %s not found", hostname);
exit(1);
}
- if (hostent->h_length != sizeof(u_long)) {
+ if (hostent->h_length != sizeof(unsigned int)) {
printf("host address is disagreeable length (%d)", hostent->h_length);
exit(1);
}
return host;
}
-main(argc, argv)
- char **argv;
+int
+main(int argc, char **argv)
{
struct rx_connection *conn;
u_long host;
error = TEST_Sub(conn, i, i * 2, &result);
printf(" ==> %d, error %d\n", result, error);
}
+
+ return 0;
}
#define N_SECURITY_OBJECTS 1
-main()
+static void Quit(char *);
+
+int
+main(int argc, char **argv)
{
struct rx_securityClass *(securityObjects[N_SECURITY_OBJECTS]);
struct rx_service *service;
rx_StartServer(1); /* Donate this process to the server process pool */
Quit("StartServer returned?");
+
+ return 0;
}
int
-TEST_Add(call, a, b, result)
- struct rx_call *call;
- int a, b;
- int *result;
+STEST_Add(struct rx_call *call, int a, int b, int *result)
{
printf("TEST_Add(%d,%d)\n", a, b);
*result = a + b;
}
int
-TEST_Sub(call, a, b, result)
- struct rx_call *call;
- int a, b;
- int *result;
+STEST_Sub(struct rx_call *call, int a, int b, int *result)
{
printf("TEST_Sub(%d,%d)\n", a, b);
*result = a - b;
return 0;
}
-Quit(msg, a, b)
- char *msg;
+static void
+Quit(char *msg)
{
- fprintf(stderr, msg, a, b);
+ fprintf(stderr, "%s", msg);
exit(1);
}