Go to the documentation of this file.
178 #define MAX_STRING_ARGS 2
179 #define DBX_MAX_ARGS 2
180 #define DBX_MAX_STRING_ARGS 3
181 #define ALLOC_MAX_ARGS MAX_ARGS
182 #define ALLOC_MAX_STRING_ARGS DBX_MAX_STRING_ARGS
186 #define COMMAND_FLAG_NONE 0x00
187 #define COMMAND_FLAG_RET_NONE 0x01
188 #define COMMAND_FLAG_RET_LENGTH 0x02
193 #define COMMAND_WORDSIZE 4
194 #define COMMAND_FIXED_DATA_SIZE ( COMMAND_WORDSIZE * 2 )
195 #define COMMAND_WORD1_OFFSET COMMAND_FIXED_DATA_SIZE
196 #define COMMAND_WORD2_OFFSET ( COMMAND_FIXED_DATA_SIZE + COMMAND_WORDSIZE )
197 #define COMMAND_WORD3_OFFSET ( COMMAND_FIXED_DATA_SIZE + ( COMMAND_WORDSIZE * 2 ) )
198 #define COMMAND_WORD4_OFFSET ( COMMAND_FIXED_DATA_SIZE + ( COMMAND_WORDSIZE * 3 ) )
202 #define putMessageType( buffer, type, flags, noInt, noString ) \
204 buffer[ 0 ] = ( BYTE ) ( type & 0xFF ); \
205 buffer[ 1 ] = ( BYTE ) ( flags & 0xFF ); \
206 buffer[ 2 ] = noInt; \
207 buffer[ 3 ] = noString; \
209 #define getMessageType( buffer, type, flags, noInt, noString ) \
210 type = buffer[ 0 ]; flags = buffer[ 1 ]; \
211 noInt = buffer[ 2 ]; noString = buffer[ 3 ]
215 #define putMessageWord( buffer, word ) \
217 ( buffer )[ 0 ] = ( BYTE ) ( ( ( word ) >> 24 ) & 0xFF ); \
218 ( buffer )[ 1 ] = ( BYTE ) ( ( ( word ) >> 16 ) & 0xFF ); \
219 ( buffer )[ 2 ] = ( BYTE ) ( ( ( word ) >> 8 ) & 0xFF ); \
220 ( buffer )[ 3 ] = ( BYTE ) ( ( word ) & 0xFF ); \
222 #define getMessageWord( buffer ) \
223 ( ( ( ( long ) ( buffer )[ 0 ] ) << 24 ) | \
224 ( ( ( long ) ( buffer )[ 1 ] ) << 16 ) | \
225 ( ( ( long ) ( buffer )[ 2 ] ) << 8 ) | \
226 ( long ) ( buffer )[ 3 ] )
228 #define getMessageLength getMessageWord
229 #define putMessageLength putMessageWord
261 #define DISPATCH_COMMAND( function, command ) \
262 dispatchCommand( &command )
263 #define DISPATCH_COMMAND_DBX( function, command, dbmsInfo ) \
264 dispatchCommand( &command, ( dbmsInfo )->stateInfo, ( dbmsInfo )->dispatchFunction )
265 #define RETURN_VALUE( value ) 0
267 #define DISPATCH_COMMAND( function, command ) \
268 function( NULL, &command )
269 #define DISPATCH_COMMAND_DBX( function, command, dbmsInfo ) \
270 function( ( dbmsInfo )->stateInfo, &command )
271 #define RETURN_VALUE( value ) value
277 #define checkCommandInfo( cmd, length ) \
278 ( ( cmd )->type > COMMAND_NONE && \
279 ( cmd )->type < COMMAND_LAST && \
280 ( ( cmd )->flags == COMMAND_FLAG_NONE || \
281 ( cmd )->flags == COMMAND_FLAG_RET_NONE || \
282 ( cmd )->flags == COMMAND_FLAG_RET_LENGTH ) && \
283 ( cmd )->noArgs >= 1 && ( cmd )->noArgs <= MAX_ARGS && \
284 ( cmd )->noStrArgs >= 0 && ( cmd )->noStrArgs <= MAX_STRING_ARGS && \
285 ( cmd )->strArgLen[ 0 ] >= 0 && \
286 ( cmd )->strArgLen[ 1 ] >= 0 && \
287 ( length ) >= 0 && ( length ) <= RPC_IO_BUFSIZE )
289 #define checkCommandConsistency( cmd, length ) \
290 ( ( ( cmd )->strArgLen[ 0 ] + ( cmd )->strArgLen[ 1 ] ) == \
291 ( length - ( COMMAND_WORDSIZE * ( ( cmd )->noArgs + ( cmd )->noStrArgs ) ) ) )
293 #define dbxCheckCommandInfo( cmd, length ) \
294 ( ( cmd )->type > DBX_COMMAND_NONE && \
295 ( cmd )->type < DBX_COMMAND_LAST && \
296 ( cmd )->flags == COMMAND_FLAG_NONE && \
297 ( cmd )->noArgs >= 0 && ( cmd )->noArgs <= DBX_MAX_ARGS && \
298 ( cmd )->noStrArgs >= 0 && ( cmd )->noStrArgs <= DBX_MAX_STRING_ARGS && \
299 ( cmd )->strArgLen[ 0 ] >= 0 && \
300 ( cmd )->strArgLen[ 1 ] >= 0 && \
301 ( cmd )->strArgLen[ 2 ] >= 0 && \
302 ( length ) >= 0 && ( length ) <= DBX_IO_BUFSIZE )
304 #define dbxCheckCommandConsistency( cmd, length ) \
305 ( ( ( cmd )->strArgLen[ 0 ] + ( cmd )->strArgLen[ 1 ] + ( cmd )->strArgLen[ 2 ] ) == \
306 ( length - ( COMMAND_WORDSIZE * ( ( cmd )->noArgs + ( cmd )->noStrArgs ) ) ) )
313 #ifdef CONFIG_CONSERVE_MEMORY
314 #define MAX_FRAGMENT_SIZE 8192
316 #define MAX_FRAGMENT_SIZE 32768
325 #define RPC_IO_BUFSIZE MAX_FRAGMENT_SIZE + 32
326 #define DBX_IO_BUFSIZE 4096