#include #include #include #include #ifdef PACKED #define PACK __attribute__ ((packed)) #else #define PACK #endif typedef struct tagRectType { unsigned short left; unsigned short top; unsigned short right; unsigned short bottom; } PACK RectType; typedef struct tagWinType { char reserved; RectType cBounds; void * data1; long ldata; struct tagWinType * next; } PACK WinType; int main ( int argc, char *argv[]) { char buffer [64]; WinType *wwwPtr; int count; for (count = 0; count < 64; count++) { *(buffer + count) = (char) (count % 16); } // end for diag_printf ("Memory contents\n"); diag_printf ("===================================================\n"); for (count = 0; count < 64; count++) { unsigned char byte; byte = *(buffer + count); diag_printf ("%02x ", byte); if ( (count + 1) % 16 == 0) { diag_printf ("\n"); } // endif } // end for diag_printf ("\n\nSizeof WinType = %d\n\n", sizeof (WinType)); count = 0; count ++; for (count = 0; count < 5; count++) { wwwPtr = (WinType *) &buffer [count]; diag_printf ("WinType.reserved = %02x\n" , wwwPtr->reserved ); diag_printf ("WinType.cBounds.left = %04x\n" , wwwPtr->cBounds.left ); diag_printf ("WinType.cBounds.top = %04x\n" , wwwPtr->cBounds.top ); diag_printf ("WinType.cBounds.right = %04x\n" , wwwPtr->cBounds.right ); diag_printf ("WinType.cBounds.bottom = %04x\n" , wwwPtr->cBounds.bottom ); diag_printf ("WinType.data1 = %08lx\n", wwwPtr->data1 ); diag_printf ("WinType.ldata = %08lx\n", wwwPtr->ldata ); diag_printf ("WinType.next = %08lx\n", wwwPtr->next ); diag_printf ("\n"); } // end for return 0; } // main