From: Aleš Křenek Date: Mon, 30 Jul 2007 15:50:13 +0000 (+0000) Subject: use padded_struct() X-Git-Tag: glite-lb-build_R_1_6_0_1~24 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=987d3e9fe5408e45c2195de33d80273856f78716;p=jra1mw.git use padded_struct() --- diff --git a/org.glite.lb.common/interface/connpool.h b/org.glite.lb.common/interface/connpool.h index 92bcfe2..4f23653 100644 --- a/org.glite.lb.common/interface/connpool.h +++ b/org.glite.lb.common/interface/connpool.h @@ -1,3 +1,7 @@ +#ifndef __GLITE_LB_CONTEXT_INT__ +#define __GLITE_LB_CONTEXT_INT__ + +#include "glite/lb/padstruct.h" #include "glite/security/glite_gss.h" #include "glite/lb/consumer.h" #include "lb_plain_io.h" @@ -15,8 +19,7 @@ extern "C" { #define GLITE_LB_COMMON_CONNPOOL_SIZE 50 - -typedef struct _edg_wll_ConnPool { +glite_lb_padded_struct(_edg_wll_ConnPool,15, /* address and port where we are connected to */ char *peerName; unsigned int peerPort; @@ -25,11 +28,13 @@ typedef struct _edg_wll_ConnPool { gss_cred_id_t gsiCred; edg_wll_GssConnection gss; char *buf; - int bufUse,bufSize; + int bufUse; + int bufSize; /* timestamp of usage of this entry in ctx.connPool */ struct timeval lastUsed; -} edg_wll_ConnPool; +); +typedef struct _edg_wll_ConnPool edg_wll_ConnPool; #endif @@ -95,3 +100,4 @@ edg_wll_Connections* edg_wll_initConnections(); } #endif +#endif diff --git a/org.glite.lb.common/interface/context-int.h b/org.glite.lb.common/interface/context-int.h index b0bb402..76b6a4a 100644 --- a/org.glite.lb.common/interface/context-int.h +++ b/org.glite.lb.common/interface/context-int.h @@ -1,5 +1,5 @@ -#ifndef __EDG_WORKLOAD_LOGGING_COMMON_CONTEXT_H__ -#define __EDG_WORKLOAD_LOGGING_COMMON_CONTEXT_H__ +#ifndef __EDG_WORKLOAD_LOGGING_COMMON_CONTEXT_INT_H__ +#define __EDG_WORKLOAD_LOGGING_COMMON_CONTEXT_INT_H__ #ident "$Header$" @@ -32,16 +32,16 @@ typedef struct _edg_wll_SeqCode { } edg_wll_SeqCode; /* non-gsi one-element analogy of connPool for L&B Proxy server */ -typedef struct _edg_wll_ConnProxy { +glite_lb_padded_struct(_edg_wll_ConnProxy,12, edg_wll_PlainConnection conn; char *buf; size_t bufSize; size_t bufUse; -} edg_wll_ConnProxy; +) +typedef struct _edg_wll_ConnProxy edg_wll_ConnProxy; - -struct _edg_wll_Context { +glite_lb_padded_struct(_edg_wll_Context,120, /* Error handling */ int errCode; /* recent error code */ char *errDesc; /* additional error description */ @@ -53,7 +53,8 @@ struct _edg_wll_Context { edg_wll_ConnPool *connPoolNotif; /* hold _one_ connection from notif-interlogger */ edg_wll_ConnProxy *connProxy; /* holds one plain connection */ - int semaphores,semset; + int semaphores; + int semset; edg_wll_QueryRec **job_index; void *job_index_cols; @@ -108,7 +109,11 @@ struct _edg_wll_Context { char *p_lbproxy_store_sock; char *p_lbproxy_serve_sock; char *p_user_lbproxy; - struct timeval p_log_timeout,p_sync_timeout,p_query_timeout, p_notif_timeout, p_tmp_timeout; + struct timeval p_log_timeout; + struct timeval p_sync_timeout; + struct timeval p_query_timeout; + struct timeval p_notif_timeout; + struct timeval p_tmp_timeout; char *p_query_server; int p_query_server_port; int p_query_server_override; @@ -130,7 +135,7 @@ struct _edg_wll_Context { int use_transactions; int greyjobs; -}; +) /* to be used internally: set, update and and clear the error information in * context, the desc string (if provided) is strdup()-ed diff --git a/org.glite.lb.common/interface/lb_plain_io.h b/org.glite.lb.common/interface/lb_plain_io.h index d423bbc..7ac2411 100644 --- a/org.glite.lb.common/interface/lb_plain_io.h +++ b/org.glite.lb.common/interface/lb_plain_io.h @@ -1,17 +1,19 @@ #ifndef __EDG_WORKLOAD_LOGGING_COMMON_LB_PLAIN_IO_H__ #define __EDG_WORKLOAD_LOGGING_COMMON_LB_PLAIN_IO_H__ +#include "glite/lb/padstruct.h" #ifdef __cplusplus extern "C" { #endif -typedef struct _edg_wll_PlainConnection { +glite_lb_padded_struct(_edg_wll_PlainConnection,6, int sock; char *buf; size_t bufSize; size_t bufUse; -} edg_wll_PlainConnection; +) +typedef struct _edg_wll_PlainConnection edg_wll_PlainConnection; int edg_wll_plain_accept(