OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/rx/test/generator.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 #define PRIVATE static
00011 #define IN
00012 #define INOUT
00013 #define MACRO_BEGIN     do {
00014 #define MACRO_END       } while (0)
00015 
00016 
00017 typedef enum { FALSE, TRUE } boolean_t;
00018 
00019 /* no. tests per file */
00020 #define TESTS_PER_FILE          50
00021 
00022 /* no: of elems in dir array */
00023 #define DIR_SIZE 3
00024 
00025 /* no: of elems in typ array */
00026 #define TYP_SIZE 11
00027 
00028 /* max strlength among the lems fo the dir array */
00029 #define MAX_DIR_STR 7
00030 
00031 /* max string length among th lems of the typ array */
00032 #define MAX_TYP_STR 16
00033 
00034 /* arrays size to be generated in the idl and itl files */
00035 #define IDL_STR_MAX 1000
00036 #define IDL_FIX_ARRAY_SIZE 15
00037 
00038 /* length of vary/conf attrib , eg" length */
00039 #define ATTRIB_LEN 7
00040 #define ATTRIB_NO 3
00041 
00042 typedef struct {
00043     char direction[MAX_DIR_STR];
00044     char type[MAX_TYP_STR];
00045     int attrib_ct;
00046     char attrib[ATTRIB_NO][ATTRIB_LEN];
00047     boolean_t first;
00048     boolean_t last;
00049     boolean_t length;
00050     boolean_t max;
00051     boolean_t size;
00052     unsigned int instringlen;
00053     char *inValue[IDL_FIX_ARRAY_SIZE];  /* value passed via RPC */
00054     char *inValue2[IDL_FIX_ARRAY_SIZE];
00055     char *outValue[IDL_FIX_ARRAY_SIZE]; /* value returned via RPC */
00056     char *outValue2[IDL_FIX_ARRAY_SIZE];
00057     int vc_low, vc_high, vc_max;        /* array bounds ([in] value) */
00058     int ovc_low, ovc_high;      /* array bounds ([out] value) */
00059 } arg_tuple;
00060 
00061 typedef struct {
00062     int argCount;
00063     arg_tuple *argDescr;
00064 } rpcArgs;
00065 
00066 #define MEM_CHK(x, y) if(!x) {fprintf(stderr, y); exit(1);}
00067 
00068 #define FATAL( y ) {fprintf(stderr, y); exit(1);}
00069 
00070 /* for vary/conf array for testing pusrposes we will assume a
00071 high index of at least 5, so IDL_FIX_ARRAY_SIZE should never be
00072 smaller than MIN_HIGH */
00073 #define MIN_HIGH 2
00074 
00075 /* max length of server name string -- file names <= 8 Chars, append Mgr,
00076 and so limit server name to 5 chars */
00077 #define MAX_SERV_NAME 5
00078 
00079 #define PrintShortUsage \
00080     MACRO_BEGIN \
00081         fprintf( stderr, \
00082 "Usage: generator [-h] [-l] [-f] <inputFileName> [-s] <serverName> \
00083 -o <output dir> [-p] <platform> \n"); \
00084     MACRO_END
00085 
00086 #define PrintLongUsage \
00087     MACRO_BEGIN \
00088         PrintShortUsage; \
00089         fprintf( stderr, \
00090 "\nCommand line options(case insensitive):\
00091 \n\t-h = help message \
00092 \n\t-l = use lwps as the thread model instead of pthreads \
00093 \n\t-f = set the input table file \
00094 \n\t-s = set the server name (truncates to 5 chars) \
00095 \n\t-o = set output directory \
00096 \n\t-p = set target platform (NT or UNIX - defaults to NT) \
00097 \n"); \
00098     MACRO_END
00099 
00100 /* max no: of args 999 */
00101 #define MAX_DIGITS_IN_ARGS 3
00102 
00103 #define MAX_RAND_LENGTH 50
00104 
00105 #define MAX_INDEX_DIGITS 10
00106 
00107 /* size of rpc signature buffer */
00108 #define SIGN_SIZE 10000
00109 
00110 #define SkipWhiteSpaces(p)              \
00111 MACRO_BEGIN                             \
00112     while (isspace(*(p)))               \
00113         (p)++;                          \
00114 MACRO_END
00115 
00116 /* limits for random generation */
00117 #define MIN_CHAR 32
00118 #define MAX_CHAR 126
00119 #define MIN_FLT 0.00000000
00120 #define MAX_FLT 1.00000000
00121 #define MIN_DBL 0.0000000000000000
00122 #define MAX_DBL 1.0000000000000000
 All Data Structures Files Functions Variables