HIPC  0.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
hipc.c
Go to the documentation of this file.
1 #include <stdint.h>
2 
3 #include <hipc.h>
4 
12 unsigned char hipcMsghdrBdysize(unsigned char const *const msghdr)
13 {
15  return 0;
16  }
17  return msghdr[HIPC_MSGHDR_BYTE_BDYSZ];
18 }
19 
25 unsigned char hipcEndian(void)
26 {
27  uint16_t tmp;
28  unsigned char endian;
29 
30  tmp = 0x0102U;
31  if ((0x01 == ((unsigned char *) &tmp)[0]) &&
32  (0x02 == ((unsigned char *) &tmp)[1])) {
33  endian = 0x42; /* 'B' */
34  } else if ((0x02 == ((unsigned char *) &tmp)[0]) &&
35  (0x01 == ((unsigned char *) &tmp)[1])) {
36  endian = 0x6c; /* 'l' */
37  } else {
38  endian = 0x6f; /* 'o' */
39  }
40  return endian;
41 }
unsigned char hipcMsghdrBdysize(unsigned char const *const msghdr)
Returns message size determined by a message header.
Definition: hipc.c:12
unsigned char hipcEndian(void)
Returns endian of the system.
Definition: hipc.c:25