From: Rafał Długołęcki Date: Fri, 12 Jul 2013 19:56:46 +0000 (+0200) Subject: vlp-10 Using coding style in genint.h and comm.h X-Git-Tag: 3.1~50 X-Git-Url: https://git.dlugolecki.net.pl/?p=vlp.git;a=commitdiff_plain;h=f5e4ddbec282b9ede909f89dcdfff06b3f197de7 vlp-10 Using coding style in genint.h and comm.h --- diff --git a/src/global/comm.h b/src/global/comm.h index 4ebc08b..b5c7f30 100644 --- a/src/global/comm.h +++ b/src/global/comm.h @@ -7,46 +7,36 @@ typedef char string20[20]; typedef struct { - int node; - int pix; - int mark; + int node; + int pix; + int mark; } paddr; -typedef struct -{ - paddr sender; /* address of the sender and */ - paddr receiver; /* receiver of the message */ - int type; /* message type */ - int par; /* prototype or error signal number */ +typedef struct { + paddr sender; /* address of the sender and */ + paddr receiver; /* receiver of the message */ + int type; /* message type */ + int par; /* prototype or error signal number */ } ctrl_msg; - - -typedef struct -{ - ctrl_msg control; - char params[ 256-sizeof(ctrl_msg) ]; +typedef struct { + ctrl_msg control; + char params[256 - sizeof(ctrl_msg)]; } messg; - -typedef struct -{ - int pword[15]; - char pstr[255]; - char pchar; +typedef struct { + int pword[15]; + char pstr[255]; + char pchar; } param_struct; - - -typedef struct -{ - int node; - int program_id; +typedef struct { + int node; + int program_id; } ctx_struct; /* Commm struct for GRAPH element */ - #define GRAPH_ALLOCATE 1 #define GRAPH_EXIT 2 #define GRAPH_FREE 3 @@ -91,8 +81,6 @@ typedef struct /* INT element */ - - #define INT_CONNECTED 1 #define INT_EXITING 2 #define INT_CTX 3 @@ -110,7 +98,8 @@ typedef struct #define NET_PROPAGATE 0 #define NET_PROPAGATE_OUT 1 -/* msg_type = MSG_NET, param.pword[0] = NET_PROPAGATE +/* + msg_type = MSG_NET, param.pword[0] = NET_PROPAGATE param.pword[1] = MSG_INT or MSG_VLP param.pword[2,3] = sender context or node,0 param.pword[4,5] = receiver context or node,0 @@ -154,7 +143,6 @@ typedef struct #define NET_NODES_NUM 26 #define NET_NODES_NUM_RESPONSE 27 - /* VLP message */ #define VLP_WRITE 0 @@ -169,80 +157,22 @@ typedef struct /* Message structure */ /*------------------------------------------------------------*/ - #define MSG_VLP 0 #define MSG_NET 1 #define MSG_GRAPH 2 #define MSG_INT 3 -typedef struct -{ - short msg_type; - param_struct param; - messg int_msg; +typedef struct { + short msg_type; + param_struct param; + messg int_msg; } MESSAGE; -typedef struct -{ - short msg_type; - param_struct param; - +typedef struct { + short msg_type; + param_struct param; } G_MESSAGE; - - - #define TCP_BUFFER_SIZE 30*sizeof(MESSAGE); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/global/genint1.h b/src/global/genint1.h index 9aeb057..e013135 100644 --- a/src/global/genint1.h +++ b/src/global/genint1.h @@ -114,59 +114,57 @@ typedef int bool; #if GEN -typedef int protaddr ; /* mainblock..maxprot ; mainblock = 0; */ +typedef int protaddr; /* mainblock..maxprot ; mainblock = 0; */ /* INDIRECT ADDRESS OF PROTOTYPE */ -typedef int dprotaddr ; /* PROTADDR + DUMMY */ -typedef int protkind ; +typedef int dprotaddr; /* PROTADDR + DUMMY */ +typedef int protkind; #else #define protaddr int #define dprotaddr int #define protkind int #endif - typedef int word; /* Prototype : */ typedef struct { - dprotaddr slprototype ; /* PROTOTYPE OF SYNTACTIC FATHER */ - /* OR DUMMY FOR THE MAIN BLOCK */ - word codeaddr; /* address of code */ - word appetite; /* object's total length */ - word span; /* distance from beginning of object to */ - /* temporary reference variables */ - word reflist; /* beginning and length of table with */ + dprotaddr slprototype; /* PROTOTYPE OF SYNTACTIC FATHER */ + /* OR DUMMY FOR THE MAIN BLOCK */ + word codeaddr; /* address of code */ + word appetite; /* object's total length */ + word span; /* distance from beginning of object to */ + /* temporary reference variables */ + word reflist; /* beginning and length of table with */ - int lthreflist; /* offsets of reference values in object; */ - /* without SL, DL, CL and temporary values */ - word parlist; /* beginning and length of table with */ - int lthparlist; /* offsets of parameters */ + int lthreflist; /* offsets of reference values in object; */ + /* without SL, DL, CL and temporary values */ + word parlist; /* beginning and length of table with */ + int lthparlist; /* offsets of parameters */ - word preflist; /* beginning and length of table with */ - int lthpreflist; /* prototype numbers of prefix sequence */ + word preflist; /* beginning and length of table with */ + int lthpreflist; /* prototype numbers of prefix sequence */ - word lastwill; /* lastwill code address */ - word handlerlist; /* list of handlers, 0 if empty */ - word virtlist; /* address of table for conversion: */ - /* virtual number --> prototype */ + word lastwill; /* lastwill code address */ + word handlerlist; /* list of handlers, 0 if empty */ + word virtlist; /* address of table for conversion: */ + /* virtual number --> prototype */ - /* only for processes : */ - protaddr maskbase ; /* lowest procedure prototype number */ - int masksize ; /* size of RPC mask for that process */ + /* only for processes : */ + protaddr maskbase; /* lowest procedure prototype number */ + int masksize; /* size of RPC mask for that process */ - /* for procedures and functions */ - int virtnumber; /* virtual number or -1 if not virtual */ + /* for procedures and functions */ + int virtnumber; /* virtual number or -1 if not virtual */ - /* for all : */ - protkind kind ; /* kind of unit */ + /* for all : */ + protkind kind; /* kind of unit */ - /* only for procedures, functions and processes : */ - word pfdescr; /* address of table with parameters descr. addresses */ + /* only for procedures, functions and processes : */ + word pfdescr; /* address of table with parameters descr. addresses */ - /* only for functions : */ - int nrarray; - word finaltype; /* type of result */ + /* only for functions : */ + int nrarray; + word finaltype; /* type of result */ } protdescr,*pointprdsc; -