home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / include / pvfs2-encode-stubs.h < prev    next >
C/C++ Source or Header  |  2010-04-30  |  4KB  |  79 lines

  1. /*
  2.  * (C) 2003-6 Pete Wyckoff, Ohio Supercomputer Center <pw@osc.edu>
  3.  *
  4.  * See COPYING in top-level directory.
  5.  *
  6.  * Stubs for user codes to hide the encoding functions.
  7.  */
  8. #ifndef __PVFS2_ENCODE_STUBS_H
  9. #define __PVFS2_ENCODE_STUBS_H
  10.  
  11. /*
  12.  * All character types are rounded up to avoid seriously unaligned accesses;
  13.  * generally handy elsewhere too.
  14.  */
  15. #define roundup4(x) (((x)+3) & ~3)
  16. #define roundup8(x) (((x)+7) & ~7)
  17.  
  18. /*
  19.  * Look at the pointer value, leave it alone if aligned, or push it up to
  20.  * the next 8 bytes.
  21.  */
  22. #ifdef HAVE_VALGRIND_H
  23. #define align8(pptr) do { \
  24.     int _pad = roundup8((uintptr_t) *(pptr)) - (uintptr_t) *(pptr); \
  25.     memset(*(pptr), 0, _pad); \
  26.     *(pptr) += _pad; \
  27. } while(0);
  28. #else
  29. #define align8(pptr) do { \
  30.     int _pad = roundup8((uintptr_t) *(pptr)) - (uintptr_t) *(pptr); \
  31.     *(pptr) += _pad; \
  32. } while(0);
  33. #endif
  34.  
  35. /*
  36.  * Files that want full definitions for the encoding and decoding functions
  37.  * will define this.  They need access to the full source tree.  Most users
  38.  * expect these noop #defines.
  39.  */
  40. #ifdef __PINT_REQPROTO_ENCODE_FUNCS_C
  41. #include "src/proto/endecode-funcs.h"
  42. #else  /* __PINT_REQPROTO_ENCODE_FUNCS_C */
  43.  
  44. /* dummy declarations to turn off functions */
  45. #define endecode_fields_1(n,t1,x1) struct endecode_fake_struct
  46. #define endecode_fields_1_struct(n,t1,x1) struct endecode_fake_struct
  47. #define endecode_fields_2(n,t1,x1,t2,x2) struct endecode_fake_struct
  48. #define endecode_fields_2_struct(n,t1,x1,t2,x2) struct endecode_fake_struct
  49. #define endecode_fields_3(n,t1,x1,t2,x2,t3,x3) struct endecode_fake_struct
  50. #define endecode_fields_3_struct(n,t1,x1,t2,x2,t3,x3) struct endecode_fake_struct
  51. #define endecode_fields_4(n,t1,x1,t2,x2,t3,x3,t4,x4) struct endecode_fake_struct
  52. #define endecode_fields_4_struct(n,t1,x1,t2,x2,t3,x3,t4,x4) struct endecode_fake_struct
  53. #define endecode_fields_5(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) struct endecode_fake_struct
  54. #define endecode_fields_5_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) struct endecode_fake_struct
  55. #define endecode_fields_6(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6) struct endecode_fake_struct
  56. #define endecode_fields_7_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7) struct endecode_fake_struct
  57. #define endecode_fields_8_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8) struct endecode_fake_struct
  58. #define endecode_fields_9_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9) struct endecode_fake_struct
  59. #define endecode_fields_10_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10) struct endecode_fake_struct
  60. #define endecode_fields_11_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11) struct endecode_fake_struct
  61. #define endecode_fields_12(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12) struct endecode_fake_struct
  62.  
  63. #define endecode_fields_1a(n,t1,x1,tn1,n1,ta1,a1) struct endecode_fake_struct
  64. #define endecode_fields_1a_struct(n,t1,x1,tn1,n1,ta1,a1) struct endecode_fake_struct
  65. #define endecode_fields_1aa_struct(n,t1,x1,tn1,n1,ta1,a1,ta2,a2) struct endecode_fake_struct
  66. #define endecode_fields_2a_struct(n,t1,x1,t2,x2,tn1,n1,ta1,a1) struct endecode_fake_struct
  67. #define endecode_fields_2aa_struct(n,t1,x1,t2,x2,tn1,n1,ta1,a1,ta2,a2) struct endecode_fake_struct
  68. #define endecode_fields_3a_struct(n,t1,x1,t2,x2,t3,x3,tn1,n1,ta1,a1) struct endecode_fake_struct
  69. #define endecode_fields_4aa_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,tn1,n1,ta1,a1,ta2,a2) struct endecode_fake_struct
  70. #define endecode_fields_1a_1a_struct(n,t1,x1,tn1,n1,ta1,a1,t2,x2,tn2,n2,ta2,a2) struct endecode_fake_struct
  71. #define endecode_fields_4a_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,tn1,n1,ta1,a1) struct endecode_fake_struct
  72. #define endecode_fields_5a_struct(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,tn1,n1,ta1,a1) struct endecode_fake_struct
  73.  
  74. #define encode_enum_union_2_struct(name, ename, uname, ut1, un1, en1, ut2, un2, en2) struct endecode_fake_struct
  75.  
  76. #endif  /* __PINT_REQPROTO_ENCODE_FUNCS_C */
  77.  
  78. #endif  /* __PVFS2_ENCODE_STUBS_H */
  79.