home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / gik2 / ewyio2eu.d2x / EWYNA.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-04  |  6.8 KB  |  167 lines

  1. /*
  2. GIK/2 1.0.1 EWYNA.H 5621-432 (C) COPYRIGHT IBM CORP 1993.  ALL RIGHTS RESERVED.  LICENSED MATERIALS - PROPERTY OF IBM.
  3. */
  4. /**********************************************************************/
  5. /*                                                                    */
  6. /*                     MODULE PROLOGUE                                */
  7. /*                                                                    */
  8. /* COMPONENT NAME:   AIRPLANE EXAMPLE                                 */
  9. /*                                                                    */
  10. /* MODULE NAME:      EWYNA.H                                          */
  11. /*                                                                    */
  12. /* DESCRIPTIVE NAME: Graphics Interface Kit/2 - Airplane Example      */
  13. /*                                                                    */
  14. /* PURPOSE:          General header file                              */
  15. /*                                                                    */
  16. /* COPYRIGHT:        (C) 1993 IBM Corporation                         */
  17. /*                                                                    */
  18. /* DISCLAIMER OF WARRANTIES.  The following [enclosed] code is        */
  19. /* sample code created by IBM Corporation. This sample code is not    */
  20. /* part of any standard or IBM product and is provided to you solely  */
  21. /* for the purpose of assisting you in the development of your        */
  22. /* applications.  The code is provided "AS IS", without               */
  23. /* warranty of any kind.  IBM shall not be liable for any damages     */
  24. /* arising out of your use of the sample code, even if they have been */
  25. /* advised of the possibility of such damages.                        */
  26. /*                                                                    */
  27. /**********************************************************************/
  28.  
  29. /*--------------------------------------------------------------------*/
  30. /* LOCAL CONSTANTS                                                    */
  31. /*--------------------------------------------------------------------*/
  32.  
  33. #define  PRG_TITLE           "AIRLINE RESERVATIONS" // Program Title
  34. #define  DESIGN_NAME         "Airplane Reservation" // Design name
  35. #define  DESIGN_NAME_LEN     21        // Design name length
  36. #define  DRT_SYM_LEN         32        // Length of GS_DRT_SYM string
  37. #define  MAX_NO_SEATS        69        // Number of seats on the plane
  38. #define  AVAILABLE           0         // Seat status available
  39. #define  RESERVED            1         // Seat status reserved
  40. #define  ERROR_MSG_SIZE      100       // Size of error message
  41. #define  MAX_LAST_NAME       25        // Maximum last name length
  42. #define  MAX_FIRST_NAME      18        // Maximum first name length
  43. #define  MAX_TEL             20        // Maximum telephone length
  44. #define  MAX_ADDRESS         80        // Maximum address length
  45. #define  PASS_RESERVED       1         // Passenger status reserved
  46. #define  PASS_OK             2         // Passenger status confirmed
  47. #define  OP_MOVE             1         // Operation performed is move
  48. #define  OP_NOT_MOVE         0         // Operation performed is not move
  49.  
  50. /*--------------------------------------------------------------------*/
  51. /* LOCAL DATA STRUCTURE                                               */
  52. /*--------------------------------------------------------------------*/
  53.  
  54. typedef struct
  55. //
  56. //   Description:
  57. //     Passenger identification data:
  58. //
  59. //       lastName      ...the passenger's last name,
  60. //       firstName     ...the passenger's first name,
  61. //       address       ...the passenger's address.
  62. //
  63. {
  64.   CHAR             lastName[MAX_LAST_NAME+1];
  65.   CHAR             firstName[MAX_FIRST_NAME+1];
  66.   CHAR             address[MAX_ADDRESS+1];
  67. } PASS_ID,*PPASS_ID;
  68.  
  69. typedef struct
  70. //
  71. //   Description:
  72. //     Airplane seat description:
  73. //
  74. //       status        ...the status of the seat: available or reserved,
  75. //       shndPass      ...the handle of the passenger symbol positioned
  76. //                        on the seat,
  77. //       passId        ...the passenger identification.
  78. //
  79. {
  80.   int              status;
  81.   SHND             shndPass;
  82.   PASS_ID          passId;
  83. } SEAT;
  84.  
  85. typedef          struct
  86. //
  87. //  Description:
  88. //
  89. //     Flight data:
  90. //
  91. //       seat          ... data about each seat.
  92. //
  93. {
  94.   SEAT             seat[MAX_NO_SEATS];
  95. } FLIGHT,*PFLIGHT;
  96.  
  97.  
  98. typedef          struct
  99. //
  100. //   Description:
  101. //     Passenger data:
  102. //
  103. //       dhnd          ... handle of the diagram,
  104. //       shndPass      ... handle of the passenger symbol,
  105. //       status        ... passenger's booking status: reserve or OK,
  106. //       passId        ... passenger id,
  107. //       tel           ... passenger's telephone number,
  108. //       seatNo        ... passenger's seat number,
  109. //       meal          ... passenger's ordered meal type,
  110. //       spNeeds       ... passenger's special needs,
  111. //       age           ... passenger's age group,
  112. //       payment       ... passenger's payment type.
  113. //
  114. {
  115.   SHND             shndPass;
  116.   int              status;
  117.   PASS_ID          id;
  118.   CHAR             tel[MAX_TEL+1];
  119.   SHORT            seatNo;
  120.   USHORT           meal, spNeeds, age, payment;
  121. } PASSENGER,*PPASSENGER;
  122.  
  123. typedef          struct
  124. //
  125. //  Description:
  126. //     Flight diagram processing/environment data:
  127. //
  128. //       shndPlane     ... handle of the plane symbol,
  129. //       pass          ... passenger data buffer,
  130. //       passId        ... passenger id data buffer.
  131. //
  132. {
  133.   SHND             shndPlane;
  134.   PASSENGER        pass;
  135.   PASS_ID          passId;
  136. } FLIGHT_ENV,*PFLIGHT_ENV;
  137.  
  138. /*--------------------------------------------------------------------*/
  139. /* LOCAL FUNCTION PROTOTYPES                                          */
  140. /*--------------------------------------------------------------------*/
  141.  
  142. MRESULT GSENTRY ViewDlgProc( HWND, USHORT, MPARAM, MPARAM);
  143. MRESULT GSENTRY DetailsDlgProc( HWND, USHORT, MPARAM, MPARAM);
  144. SHORT   CntPassSym( DHND, SHORT);
  145. BOOL    BlanksEmpty( CHAR *);
  146. VOID    SetPassStatusForm( DHND, SHND, SHORT);
  147. VOID    SetSelPassStatusForm( DHND, SHORT);
  148. VOID    PutPassForm( DHND, SHND, SHORT);
  149. SHORT   PassDetails( DHND, SHND);
  150. BOOL    GetRelatedMp( DHND, SHND, POINTL, SHORT *);
  151. VOID    GetDistance( POINTL, POINTL, double *);
  152. VOID    InitializeDlgBox( HWND, PASSENGER);
  153. VOID    ResetAfNotPass( DHND);
  154. BOOL    UniquePassID( DHND, SHND, PPASS_ID, BOOL);
  155. BOOL    AfSymPosOK( DHND);
  156. VOID    PutAfPassSym( DHND, BOOL);
  157. BOOL    SymPosOK( DHND, SHND, SHORT *);
  158. VOID    UpdatePassPlaneData(DHND,PPASSENGER, BOOL);
  159. VOID    PutPassSym(DHND, SHND, BOOL);
  160. VOID    InitPassData(PPASSENGER, SHND, SHORT);
  161. VOID    InitDiagObjectData(PFLIGHT);
  162. BOOL    NewFile(CHAR *);
  163. USHORT  InitIfNewDiag(DHND, CHAR *);
  164. BOOL    InvWinDlgBox(DHND, PPASSENGER);
  165.  
  166. VOID    RemLeadTrailB(CHAR *);
  167.