171
171
#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
174
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
175
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
176
#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
177
#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
178
#define BLOB_FLAG 16 /* Field is a blob */
179
#define UNSIGNED_FLAG 32 /* Field is unsigned */
180
#define DECIMAL_FLAG 64 /* Field is zerofill */
181
#define BINARY_FLAG 128 /* Field is binary */
174
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
175
#define PRI_KEY_FLAG 2 /* Field is part of a primary key */
176
#define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */
177
#define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */
178
#define BLOB_FLAG 16 /* Field is a blob */
179
#define UNSIGNED_FLAG 32 /* Field is unsigned */
180
#define DECIMAL_FLAG 64 /* Field is zerofill */
181
#define BINARY_FLAG 128 /* Field is binary */
183
183
/* The following are only sent to new clients */
184
#define ENUM_FLAG 256 /* field is an enum */
185
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
186
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
187
#define SET_FLAG 2048 /* field is a set */
188
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
184
#define ENUM_FLAG 256 /* field is an enum */
185
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */
186
#define TIMESTAMP_FLAG 1024 /* Field is a timestamp */
187
#define SET_FLAG 2048 /* field is a set */
188
#define NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */
189
189
#define ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */
190
#define NUM_FLAG 32768 /* Field is num (for clients) */
191
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
192
#define GROUP_FLAG 32768 /* Intern: Group field */
193
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
194
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
190
#define NUM_FLAG 32768 /* Field is num (for clients) */
191
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
192
#define GROUP_FLAG 32768 /* Intern: Group field */
193
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
194
#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
195
195
#define GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */
196
196
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
197
#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */
197
#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */
198
198
#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */
199
199
#define FIELD_STORAGE_FLAGS 22 /* Storage type: bit 22, 23 and 24 */
200
200
#define COLUMN_FORMAT_FLAGS 25 /* Column format: bit 25, 26 and 27 */
202
#define REFRESH_GRANT 1 /* Refresh grant tables */
203
#define REFRESH_LOG 2 /* Start on new log file */
204
#define REFRESH_TABLES 4 /* close all tables */
205
#define REFRESH_HOSTS 8 /* Flush host cache */
206
#define REFRESH_STATUS 16 /* Flush status variables */
207
#define REFRESH_THREADS 32 /* Flush thread cache */
202
#define REFRESH_GRANT 1 /* Refresh grant tables */
203
#define REFRESH_LOG 2 /* Start on new log file */
204
#define REFRESH_TABLES 4 /* close all tables */
205
#define REFRESH_HOSTS 8 /* Flush host cache */
206
#define REFRESH_STATUS 16 /* Flush status variables */
207
#define REFRESH_THREADS 32 /* Flush thread cache */
208
208
#define REFRESH_SLAVE 64 /* Reset master info and restart slave
210
210
#define REFRESH_MASTER 128 /* Remove all bin logs in the index
211
and truncate the index */
211
and truncate the index */
213
213
/* The following can't be set with mysql_refresh() */
214
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
215
#define REFRESH_FAST 32768 /* Intern flag */
214
#define REFRESH_READ_LOCK 16384 /* Lock tables for read */
215
#define REFRESH_FAST 32768 /* Intern flag */
217
217
/* RESET (remove all queries) from query cache */
218
#define REFRESH_QUERY_CACHE 65536
218
#define REFRESH_QUERY_CACHE 65536
219
219
#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
220
#define REFRESH_DES_KEY_FILE 0x40000L
221
#define REFRESH_USER_RESOURCES 0x80000L
220
#define REFRESH_DES_KEY_FILE 0x40000L
221
#define REFRESH_USER_RESOURCES 0x80000L
223
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
224
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
225
#define CLIENT_LONG_FLAG 4 /* Get all column flags */
226
#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */
227
#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */
228
#define CLIENT_COMPRESS 32 /* Can use compression protocol */
229
#define CLIENT_ODBC 64 /* Odbc client */
230
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
231
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
232
#define UNUSED_CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
233
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
234
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
223
#define CLIENT_LONG_PASSWORD 1 /* new more secure passwords */
224
#define CLIENT_FOUND_ROWS 2 /* Found instead of affected rows */
225
#define CLIENT_LONG_FLAG 4 /* Get all column flags */
226
#define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */
227
#define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */
228
#define CLIENT_COMPRESS 32 /* Can use compression protocol */
229
#define CLIENT_ODBC 64 /* Odbc client */
230
#define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */
231
#define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */
232
#define UNUSED_CLIENT_PROTOCOL_41 512 /* New 4.1 protocol */
233
#define CLIENT_INTERACTIVE 1024 /* This is an interactive client */
234
#define CLIENT_SSL 2048 /* Switch to SSL after handshake */
235
235
#define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */
236
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
236
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
237
237
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
238
238
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
239
239
#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
459
459
/* Optimized store functions for Intel x86 */
460
460
#if defined(__i386__)
461
#define sint2korr(A) (*((int16_t *) (A)))
462
#define sint3korr(A) ((int32_t) ((((unsigned char) (A)[2]) & 128) ? \
463
(((uint32_t) 255L << 24) | \
464
(((uint32_t) (unsigned char) (A)[2]) << 16) | \
465
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
466
((uint32_t) (unsigned char) (A)[0])) : \
467
(((uint32_t) (unsigned char) (A)[2]) << 16) | \
468
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
469
((uint32_t) (unsigned char) (A)[0])))
470
#define sint4korr(A) (*((long *) (A)))
471
#define uint2korr(A) (*((uint16_t *) (A)))
461
#define sint2korr(A) (*((int16_t *) (A)))
462
#define sint3korr(A) ((int32_t) ((((unsigned char) (A)[2]) & 128) ? \
463
(((uint32_t) 255L << 24) | \
464
(((uint32_t) (unsigned char) (A)[2]) << 16) |\
465
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
466
((uint32_t) (unsigned char) (A)[0])) : \
467
(((uint32_t) (unsigned char) (A)[2]) << 16) |\
468
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
469
((uint32_t) (unsigned char) (A)[0])))
470
#define sint4korr(A) (*((long *) (A)))
471
#define uint2korr(A) (*((uint16_t *) (A)))
472
472
#if defined(HAVE_purify)
473
#define uint3korr(A) (uint32_t) (((uint32_t) ((unsigned char) (A)[0])) + \
474
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
475
(((uint32_t) ((unsigned char) (A)[2])) << 16))
473
#define uint3korr(A) (uint32_t) (((uint32_t) ((unsigned char) (A)[0])) +\
474
(((uint32_t) ((unsigned char) (A)[1])) << 8) +\
475
(((uint32_t) ((unsigned char) (A)[2])) << 16))
480
Please, note, uint3korr reads 4 bytes (not 3) !
481
It means, that you have to provide enough allocated space !
480
Please, note, uint3korr reads 4 bytes (not 3) !
481
It means, that you have to provide enough allocated space !
483
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
483
#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
484
484
#endif /* HAVE_purify */
485
#define uint4korr(A) (*((uint32_t *) (A)))
486
#define uint5korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
487
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
488
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
489
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
490
(((uint64_t) ((unsigned char) (A)[4])) << 32))
491
#define uint6korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
492
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
493
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
494
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
495
(((uint64_t) ((unsigned char) (A)[4])) << 32) + \
485
#define uint4korr(A) (*((uint32_t *) (A)))
486
#define uint5korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) +\
487
(((uint32_t) ((unsigned char) (A)[1])) << 8) +\
488
(((uint32_t) ((unsigned char) (A)[2])) << 16) +\
489
(((uint32_t) ((unsigned char) (A)[3])) << 24)) +\
490
(((uint64_t) ((unsigned char) (A)[4])) << 32))
491
#define uint6korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
492
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
493
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
494
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
495
(((uint64_t) ((unsigned char) (A)[4])) << 32) + \
496
496
(((uint64_t) ((unsigned char) (A)[5])) << 40))
497
#define uint8korr(A) (*((uint64_t *) (A)))
498
#define sint8korr(A) (*((int64_t *) (A)))
499
#define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A)
500
#define int3store(T,A) do { *(T)= (unsigned char) ((A)); \
501
*(T+1)=(unsigned char) (((uint32_t) (A) >> 8)); \
502
*(T+2)=(unsigned char) (((A) >> 16)); } while (0)
503
#define int4store(T,A) *((long *) (T))= (long) (A)
504
#define int5store(T,A) do { *(T)= (unsigned char)((A)); \
505
*((T)+1)=(unsigned char) (((A) >> 8)); \
506
*((T)+2)=(unsigned char) (((A) >> 16)); \
507
*((T)+3)=(unsigned char) (((A) >> 24)); \
508
*((T)+4)=(unsigned char) (((A) >> 32)); } while(0)
497
#define uint8korr(A) (*((uint64_t *) (A)))
498
#define sint8korr(A) (*((int64_t *) (A)))
499
#define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A)
500
#define int3store(T,A) do { *(T)= (unsigned char) ((A));\
501
*(T+1)=(unsigned char) (((uint32_t) (A) >> 8));\
502
*(T+2)=(unsigned char) (((A) >> 16)); } while (0)
503
#define int4store(T,A) *((long *) (T))= (long) (A)
504
#define int5store(T,A) do { *(T)= (unsigned char)((A));\
505
*((T)+1)=(unsigned char) (((A) >> 8));\
506
*((T)+2)=(unsigned char) (((A) >> 16));\
507
*((T)+3)=(unsigned char) (((A) >> 24)); \
508
*((T)+4)=(unsigned char) (((A) >> 32)); } while(0)
509
509
#define int6store(T,A) do { *(T)= (unsigned char)((A)); \
510
*((T)+1)=(unsigned char) (((A) >> 8)); \
511
*((T)+2)=(unsigned char) (((A) >> 16)); \
512
*((T)+3)=(unsigned char) (((A) >> 24)); \
513
*((T)+4)=(unsigned char) (((A) >> 32)); \
514
*((T)+5)=(unsigned char) (((A) >> 40)); } while(0)
515
#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
510
*((T)+1)=(unsigned char) (((A) >> 8)); \
511
*((T)+2)=(unsigned char) (((A) >> 16)); \
512
*((T)+3)=(unsigned char) (((A) >> 24)); \
513
*((T)+4)=(unsigned char) (((A) >> 32)); \
514
*((T)+5)=(unsigned char) (((A) >> 40)); } while(0)
515
#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
521
#define doubleget(V,M) \
522
do { doubleget_union _tmp; \
523
_tmp.m[0] = *((long*)(M)); \
524
_tmp.m[1] = *(((long*) (M))+1); \
525
(V) = _tmp.v; } while(0)
521
#define doubleget(V,M) \
522
do { doubleget_union _tmp; \
523
_tmp.m[0] = *((long*)(M)); \
524
_tmp.m[1] = *(((long*) (M))+1); \
525
(V) = _tmp.v; } while(0)
526
526
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
527
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
527
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
529
529
#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0)
530
530
#define float8get(V,M) doubleget((V),(M))
531
531
#define float4store(V,M) memcpy(V, (&M), sizeof(float))
538
538
We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
539
539
were done before)
541
#define sint2korr(A) (int16_t) (((int16_t) ((unsigned char) (A)[0])) + \
542
((int16_t) ((int16_t) (A)[1]) << 8))
543
#define sint3korr(A) ((int32_t) ((((unsigned char) (A)[2]) & 128) ? \
544
(((uint32_t) 255L << 24) | \
545
(((uint32_t) (unsigned char) (A)[2]) << 16) | \
546
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
547
((uint32_t) (unsigned char) (A)[0])) : \
548
(((uint32_t) (unsigned char) (A)[2]) << 16) | \
549
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
550
((uint32_t) (unsigned char) (A)[0])))
551
#define sint4korr(A) (int32_t) (((int32_t) ((unsigned char) (A)[0])) + \
552
(((int32_t) ((unsigned char) (A)[1]) << 8)) + \
553
(((int32_t) ((unsigned char) (A)[2]) << 16)) + \
554
(((int32_t) ((int16_t) (A)[3]) << 24)))
555
#define sint8korr(A) (int64_t) uint8korr(A)
556
#define uint2korr(A) (uint16_t) (((uint16_t) ((unsigned char) (A)[0])) + \
557
((uint16_t) ((unsigned char) (A)[1]) << 8))
558
#define uint3korr(A) (uint32_t) (((uint32_t) ((unsigned char) (A)[0])) + \
559
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
560
(((uint32_t) ((unsigned char) (A)[2])) << 16))
561
#define uint4korr(A) (uint32_t) (((uint32_t) ((unsigned char) (A)[0])) + \
562
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
563
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
564
(((uint32_t) ((unsigned char) (A)[3])) << 24))
565
#define uint5korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
566
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
567
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
568
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
569
(((uint64_t) ((unsigned char) (A)[4])) << 32))
570
#define uint6korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
571
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
572
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
573
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
574
(((uint64_t) ((unsigned char) (A)[4])) << 32) + \
541
#define sint2korr(A) (int16_t) (((int16_t) ((unsigned char) (A)[0])) +\
542
((int16_t) ((int16_t) (A)[1]) << 8))
543
#define sint3korr(A) ((int32_t) ((((unsigned char) (A)[2]) & 128) ? \
544
(((uint32_t) 255L << 24) | \
545
(((uint32_t) (unsigned char) (A)[2]) << 16) |\
546
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
547
((uint32_t) (unsigned char) (A)[0])) : \
548
(((uint32_t) (unsigned char) (A)[2]) << 16) |\
549
(((uint32_t) (unsigned char) (A)[1]) << 8) | \
550
((uint32_t) (unsigned char) (A)[0])))
551
#define sint4korr(A) (int32_t) (((int32_t) ((unsigned char) (A)[0])) +\
552
(((int32_t) ((unsigned char) (A)[1]) << 8)) +\
553
(((int32_t) ((unsigned char) (A)[2]) << 16)) +\
554
(((int32_t) ((int16_t) (A)[3]) << 24)))
555
#define sint8korr(A) (int64_t) uint8korr(A)
556
#define uint2korr(A) (uint16_t) (((uint16_t) ((unsigned char) (A)[0])) +\
557
((uint16_t) ((unsigned char) (A)[1]) << 8))
558
#define uint3korr(A) (uint32_t) (((uint32_t) ((unsigned char) (A)[0])) +\
559
(((uint32_t) ((unsigned char) (A)[1])) << 8) +\
560
(((uint32_t) ((unsigned char) (A)[2])) << 16))
561
#define uint4korr(A) (uint32_t) (((uint32_t) ((unsigned char) (A)[0])) +\
562
(((uint32_t) ((unsigned char) (A)[1])) << 8) +\
563
(((uint32_t) ((unsigned char) (A)[2])) << 16) +\
564
(((uint32_t) ((unsigned char) (A)[3])) << 24))
565
#define uint5korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) +\
566
(((uint32_t) ((unsigned char) (A)[1])) << 8) +\
567
(((uint32_t) ((unsigned char) (A)[2])) << 16) +\
568
(((uint32_t) ((unsigned char) (A)[3])) << 24)) +\
569
(((uint64_t) ((unsigned char) (A)[4])) << 32))
570
#define uint6korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
571
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
572
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
573
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
574
(((uint64_t) ((unsigned char) (A)[4])) << 32) + \
575
575
(((uint64_t) ((unsigned char) (A)[5])) << 40))
576
#define uint8korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) + \
577
(((uint32_t) ((unsigned char) (A)[1])) << 8) + \
578
(((uint32_t) ((unsigned char) (A)[2])) << 16) + \
579
(((uint32_t) ((unsigned char) (A)[3])) << 24)) + \
580
(((uint64_t) (((uint32_t) ((unsigned char) (A)[4])) + \
581
(((uint32_t) ((unsigned char) (A)[5])) << 8) + \
582
(((uint32_t) ((unsigned char) (A)[6])) << 16) + \
583
(((uint32_t) ((unsigned char) (A)[7])) << 24))) << \
585
#define int2store(T,A) do { uint32_t def_temp= (uint32_t) (A) ; \
586
*((unsigned char*) (T))= (unsigned char)(def_temp); \
587
*((unsigned char*) (T)+1)=(unsigned char)((def_temp >> 8)); \
589
#define int3store(T,A) do { /*lint -save -e734 */ \
590
*((unsigned char*)(T))=(unsigned char) ((A)); \
591
*((unsigned char*) (T)+1)=(unsigned char) (((A) >> 8)); \
592
*((unsigned char*)(T)+2)=(unsigned char) (((A) >> 16)); \
593
/*lint -restore */} while(0)
594
#define int4store(T,A) do { *((char *)(T))=(char) ((A)); \
595
*(((char *)(T))+1)=(char) (((A) >> 8)); \
596
*(((char *)(T))+2)=(char) (((A) >> 16)); \
597
*(((char *)(T))+3)=(char) (((A) >> 24)); } while(0)
598
#define int5store(T,A) do { *((char *)(T))= (char)((A)); \
599
*(((char *)(T))+1)= (char)(((A) >> 8)); \
600
*(((char *)(T))+2)= (char)(((A) >> 16)); \
601
*(((char *)(T))+3)= (char)(((A) >> 24)); \
602
*(((char *)(T))+4)= (char)(((A) >> 32)); \
604
#define int6store(T,A) do { *((char *)(T))= (char)((A)); \
605
*(((char *)(T))+1)= (char)(((A) >> 8)); \
606
*(((char *)(T))+2)= (char)(((A) >> 16)); \
607
*(((char *)(T))+3)= (char)(((A) >> 24)); \
608
*(((char *)(T))+4)= (char)(((A) >> 32)); \
609
*(((char *)(T))+5)= (char)(((A) >> 40)); \
576
#define uint8korr(A) ((uint64_t)(((uint32_t) ((unsigned char) (A)[0])) +\
577
(((uint32_t) ((unsigned char) (A)[1])) << 8) +\
578
(((uint32_t) ((unsigned char) (A)[2])) << 16) +\
579
(((uint32_t) ((unsigned char) (A)[3])) << 24)) +\
580
(((uint64_t) (((uint32_t) ((unsigned char) (A)[4])) +\
581
(((uint32_t) ((unsigned char) (A)[5])) << 8) +\
582
(((uint32_t) ((unsigned char) (A)[6])) << 16) +\
583
(((uint32_t) ((unsigned char) (A)[7])) << 24))) <<\
585
#define int2store(T,A) do { uint32_t def_temp= (uint32_t) (A) ;\
586
*((unsigned char*) (T))= (unsigned char)(def_temp); \
587
*((unsigned char*) (T)+1)=(unsigned char)((def_temp >> 8)); \
589
#define int3store(T,A) do { /*lint -save -e734 */\
590
*((unsigned char*)(T))=(unsigned char) ((A));\
591
*((unsigned char*) (T)+1)=(unsigned char) (((A) >> 8));\
592
*((unsigned char*)(T)+2)=(unsigned char) (((A) >> 16)); \
593
/*lint -restore */} while(0)
594
#define int4store(T,A) do { *((char *)(T))=(char) ((A));\
595
*(((char *)(T))+1)=(char) (((A) >> 8));\
596
*(((char *)(T))+2)=(char) (((A) >> 16));\
597
*(((char *)(T))+3)=(char) (((A) >> 24)); } while(0)
598
#define int5store(T,A) do { *((char *)(T))= (char)((A)); \
599
*(((char *)(T))+1)= (char)(((A) >> 8)); \
600
*(((char *)(T))+2)= (char)(((A) >> 16)); \
601
*(((char *)(T))+3)= (char)(((A) >> 24)); \
602
*(((char *)(T))+4)= (char)(((A) >> 32)); \
604
#define int6store(T,A) do { *((char *)(T))= (char)((A)); \
605
*(((char *)(T))+1)= (char)(((A) >> 8)); \
606
*(((char *)(T))+2)= (char)(((A) >> 16)); \
607
*(((char *)(T))+3)= (char)(((A) >> 24)); \
608
*(((char *)(T))+4)= (char)(((A) >> 32)); \
609
*(((char *)(T))+5)= (char)(((A) >> 40)); \
611
611
#define int8store(T,A) do { uint32_t def_temp= (uint32_t) (A), def_temp2= (uint32_t) ((A) >> 32); \
612
int4store((T),def_temp); \
613
int4store((T+4),def_temp2); } while(0)
612
int4store((T),def_temp); \
613
int4store((T+4),def_temp2); } while(0)
614
614
#ifdef WORDS_BIGENDIAN
615
#define float4store(T,A) do { *(T)= ((unsigned char *) &A)[3]; \
616
*((T)+1)=(char) ((unsigned char *) &A)[2]; \
617
*((T)+2)=(char) ((unsigned char *) &A)[1]; \
618
*((T)+3)=(char) ((unsigned char *) &A)[0]; } while(0)
620
#define float4get(V,M) do { float def_temp; \
621
((unsigned char*) &def_temp)[0]=(M)[3]; \
622
((unsigned char*) &def_temp)[1]=(M)[2]; \
623
((unsigned char*) &def_temp)[2]=(M)[1]; \
624
((unsigned char*) &def_temp)[3]=(M)[0]; \
625
(V)=def_temp; } while(0)
626
#define float8store(T,V) do { *(T)= ((unsigned char *) &V)[7]; \
627
*((T)+1)=(char) ((unsigned char *) &V)[6]; \
628
*((T)+2)=(char) ((unsigned char *) &V)[5]; \
629
*((T)+3)=(char) ((unsigned char *) &V)[4]; \
630
*((T)+4)=(char) ((unsigned char *) &V)[3]; \
631
*((T)+5)=(char) ((unsigned char *) &V)[2]; \
632
*((T)+6)=(char) ((unsigned char *) &V)[1]; \
633
*((T)+7)=(char) ((unsigned char *) &V)[0]; } while(0)
635
#define float8get(V,M) do { double def_temp; \
636
((unsigned char*) &def_temp)[0]=(M)[7]; \
637
((unsigned char*) &def_temp)[1]=(M)[6]; \
638
((unsigned char*) &def_temp)[2]=(M)[5]; \
639
((unsigned char*) &def_temp)[3]=(M)[4]; \
640
((unsigned char*) &def_temp)[4]=(M)[3]; \
641
((unsigned char*) &def_temp)[5]=(M)[2]; \
642
((unsigned char*) &def_temp)[6]=(M)[1]; \
643
((unsigned char*) &def_temp)[7]=(M)[0]; \
644
(V) = def_temp; } while(0)
615
#define float4store(T,A) do { *(T)= ((unsigned char *) &A)[3];\
616
*((T)+1)=(char) ((unsigned char *) &A)[2];\
617
*((T)+2)=(char) ((unsigned char *) &A)[1];\
618
*((T)+3)=(char) ((unsigned char *) &A)[0]; } while(0)
620
#define float4get(V,M) do { float def_temp;\
621
((unsigned char*) &def_temp)[0]=(M)[3];\
622
((unsigned char*) &def_temp)[1]=(M)[2];\
623
((unsigned char*) &def_temp)[2]=(M)[1];\
624
((unsigned char*) &def_temp)[3]=(M)[0];\
625
(V)=def_temp; } while(0)
626
#define float8store(T,V) do { *(T)= ((unsigned char *) &V)[7];\
627
*((T)+1)=(char) ((unsigned char *) &V)[6];\
628
*((T)+2)=(char) ((unsigned char *) &V)[5];\
629
*((T)+3)=(char) ((unsigned char *) &V)[4];\
630
*((T)+4)=(char) ((unsigned char *) &V)[3];\
631
*((T)+5)=(char) ((unsigned char *) &V)[2];\
632
*((T)+6)=(char) ((unsigned char *) &V)[1];\
633
*((T)+7)=(char) ((unsigned char *) &V)[0]; } while(0)
635
#define float8get(V,M) do { double def_temp;\
636
((unsigned char*) &def_temp)[0]=(M)[7];\
637
((unsigned char*) &def_temp)[1]=(M)[6];\
638
((unsigned char*) &def_temp)[2]=(M)[5];\
639
((unsigned char*) &def_temp)[3]=(M)[4];\
640
((unsigned char*) &def_temp)[4]=(M)[3];\
641
((unsigned char*) &def_temp)[5]=(M)[2];\
642
((unsigned char*) &def_temp)[6]=(M)[1];\
643
((unsigned char*) &def_temp)[7]=(M)[0];\
644
(V) = def_temp; } while(0)
646
646
#define float4get(V,M) memcpy(&V, (M), sizeof(float))
647
647
#define float4store(V,M) memcpy(V, (&M), sizeof(float))
649
649
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
650
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((unsigned char *) &V)[4]; \
651
*(((char*)T)+1)=(char) ((unsigned char *) &V)[5]; \
652
*(((char*)T)+2)=(char) ((unsigned char *) &V)[6]; \
653
*(((char*)T)+3)=(char) ((unsigned char *) &V)[7]; \
654
*(((char*)T)+4)=(char) ((unsigned char *) &V)[0]; \
655
*(((char*)T)+5)=(char) ((unsigned char *) &V)[1]; \
656
*(((char*)T)+6)=(char) ((unsigned char *) &V)[2]; \
657
*(((char*)T)+7)=(char) ((unsigned char *) &V)[3]; } \
659
#define doubleget(V,M) do { double def_temp; \
660
((unsigned char*) &def_temp)[0]=(M)[4]; \
661
((unsigned char*) &def_temp)[1]=(M)[5]; \
662
((unsigned char*) &def_temp)[2]=(M)[6]; \
663
((unsigned char*) &def_temp)[3]=(M)[7]; \
664
((unsigned char*) &def_temp)[4]=(M)[0]; \
665
((unsigned char*) &def_temp)[5]=(M)[1]; \
666
((unsigned char*) &def_temp)[6]=(M)[2]; \
667
((unsigned char*) &def_temp)[7]=(M)[3]; \
668
(V) = def_temp; } while(0)
650
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((unsigned char *) &V)[4];\
651
*(((char*)T)+1)=(char) ((unsigned char *) &V)[5];\
652
*(((char*)T)+2)=(char) ((unsigned char *) &V)[6];\
653
*(((char*)T)+3)=(char) ((unsigned char *) &V)[7];\
654
*(((char*)T)+4)=(char) ((unsigned char *) &V)[0];\
655
*(((char*)T)+5)=(char) ((unsigned char *) &V)[1];\
656
*(((char*)T)+6)=(char) ((unsigned char *) &V)[2];\
657
*(((char*)T)+7)=(char) ((unsigned char *) &V)[3]; }\
659
#define doubleget(V,M) do { double def_temp;\
660
((unsigned char*) &def_temp)[0]=(M)[4];\
661
((unsigned char*) &def_temp)[1]=(M)[5];\
662
((unsigned char*) &def_temp)[2]=(M)[6];\
663
((unsigned char*) &def_temp)[3]=(M)[7];\
664
((unsigned char*) &def_temp)[4]=(M)[0];\
665
((unsigned char*) &def_temp)[5]=(M)[1];\
666
((unsigned char*) &def_temp)[6]=(M)[2];\
667
((unsigned char*) &def_temp)[7]=(M)[3];\
668
(V) = def_temp; } while(0)
669
669
#endif /* __FLOAT_WORD_ORDER */
671
671
#define float8get(V,M) doubleget((V),(M))
691
691
#ifdef WORDS_BIGENDIAN
693
#define ushortget(V,M) do { V = (uint16_t) (((uint16_t) ((unsigned char) (M)[1]))+ \
694
((uint16_t) ((uint16_t) (M)[0]) << 8)); } while(0)
695
#define shortget(V,M) do { V = (short) (((short) ((unsigned char) (M)[1]))+ \
696
((short) ((short) (M)[0]) << 8)); } while(0)
697
#define longget(V,M) do { int32_t def_temp; \
698
((unsigned char*) &def_temp)[0]=(M)[0]; \
699
((unsigned char*) &def_temp)[1]=(M)[1]; \
700
((unsigned char*) &def_temp)[2]=(M)[2]; \
701
((unsigned char*) &def_temp)[3]=(M)[3]; \
702
(V)=def_temp; } while(0)
703
#define ulongget(V,M) do { uint32_t def_temp; \
704
((unsigned char*) &def_temp)[0]=(M)[0]; \
705
((unsigned char*) &def_temp)[1]=(M)[1]; \
706
((unsigned char*) &def_temp)[2]=(M)[2]; \
707
((unsigned char*) &def_temp)[3]=(M)[3]; \
708
(V)=def_temp; } while(0)
709
#define shortstore(T,A) do { uint32_t def_temp=(uint32_t) (A) ; \
710
*(((char*)T)+1)=(char)(def_temp); \
711
*(((char*)T)+0)=(char)(def_temp >> 8); } while(0)
712
#define longstore(T,A) do { *(((char*)T)+3)=((A)); \
713
*(((char*)T)+2)=(((A) >> 8)); \
714
*(((char*)T)+1)=(((A) >> 16)); \
715
*(((char*)T)+0)=(((A) >> 24)); } while(0)
693
#define ushortget(V,M) do { V = (uint16_t) (((uint16_t) ((unsigned char) (M)[1]))+\
694
((uint16_t) ((uint16_t) (M)[0]) << 8)); } while(0)
695
#define shortget(V,M) do { V = (short) (((short) ((unsigned char) (M)[1]))+\
696
((short) ((short) (M)[0]) << 8)); } while(0)
697
#define longget(V,M) do { int32_t def_temp;\
698
((unsigned char*) &def_temp)[0]=(M)[0];\
699
((unsigned char*) &def_temp)[1]=(M)[1];\
700
((unsigned char*) &def_temp)[2]=(M)[2];\
701
((unsigned char*) &def_temp)[3]=(M)[3];\
702
(V)=def_temp; } while(0)
703
#define ulongget(V,M) do { uint32_t def_temp;\
704
((unsigned char*) &def_temp)[0]=(M)[0];\
705
((unsigned char*) &def_temp)[1]=(M)[1];\
706
((unsigned char*) &def_temp)[2]=(M)[2];\
707
((unsigned char*) &def_temp)[3]=(M)[3];\
708
(V)=def_temp; } while(0)
709
#define shortstore(T,A) do { uint32_t def_temp=(uint32_t) (A) ;\
710
*(((char*)T)+1)=(char)(def_temp); \
711
*(((char*)T)+0)=(char)(def_temp >> 8); } while(0)
712
#define longstore(T,A) do { *(((char*)T)+3)=((A));\
713
*(((char*)T)+2)=(((A) >> 8));\
714
*(((char*)T)+1)=(((A) >> 16));\
715
*(((char*)T)+0)=(((A) >> 24)); } while(0)
717
717
#define floatget(V,M) memcpy(&V, (M), sizeof(float))
718
718
#define floatstore(T, V) memcpy((T), (&V), sizeof(float))
719
#define doubleget(V, M) memcpy(&V, (M), sizeof(double))
719
#define doubleget(V, M) memcpy(&V, (M), sizeof(double))
720
720
#define doublestore(T, V) memcpy((T), &V, sizeof(double))
721
721
#define int64_tget(V, M) memcpy(&V, (M), sizeof(uint64_t))
722
722
#define int64_tstore(T, V) memcpy((T), &V, sizeof(uint64_t))
726
#define ushortget(V,M) do { V = uint2korr(M); } while(0)
727
#define shortget(V,M) do { V = sint2korr(M); } while(0)
728
#define longget(V,M) do { V = sint4korr(M); } while(0)
726
#define ushortget(V,M) do { V = uint2korr(M); } while(0)
727
#define shortget(V,M) do { V = sint2korr(M); } while(0)
728
#define longget(V,M) do { V = sint4korr(M); } while(0)
729
729
#define ulongget(V,M) do { V = uint4korr(M); } while(0)
730
730
#define shortstore(T,V) int2store(T,V)
731
#define longstore(T,V) int4store(T,V)
731
#define longstore(T,V) int4store(T,V)
732
732
#ifndef floatstore
733
733
#define floatstore(T,V) memcpy((T), (&V), sizeof(float))
734
734
#define floatget(V,M) memcpy(&V, (M), sizeof(float))
736
736
#ifndef doubleget
737
#define doubleget(V, M) memcpy(&V, (M), sizeof(double))
737
#define doubleget(V, M) memcpy(&V, (M), sizeof(double))
738
738
#define doublestore(T,V) memcpy((T), &V, sizeof(double))
739
739
#endif /* doubleget */
740
740
#define int64_tget(V,M) memcpy(&V, (M), sizeof(uint64_t))