home *** CD-ROM | disk | FTP | other *** search
- /*
- GIK/2 1.0.1 EWYNA.H 5621-432 (C) COPYRIGHT IBM CORP 1993. ALL RIGHTS RESERVED. LICENSED MATERIALS - PROPERTY OF IBM.
- */
- /**********************************************************************/
- /* */
- /* MODULE PROLOGUE */
- /* */
- /* COMPONENT NAME: AIRPLANE EXAMPLE */
- /* */
- /* MODULE NAME: EWYNA.H */
- /* */
- /* DESCRIPTIVE NAME: Graphics Interface Kit/2 - Airplane Example */
- /* */
- /* PURPOSE: General header file */
- /* */
- /* COPYRIGHT: (C) 1993 IBM Corporation */
- /* */
- /* DISCLAIMER OF WARRANTIES. The following [enclosed] code is */
- /* sample code created by IBM Corporation. This sample code is not */
- /* part of any standard or IBM product and is provided to you solely */
- /* for the purpose of assisting you in the development of your */
- /* applications. The code is provided "AS IS", without */
- /* warranty of any kind. IBM shall not be liable for any damages */
- /* arising out of your use of the sample code, even if they have been */
- /* advised of the possibility of such damages. */
- /* */
- /**********************************************************************/
-
- /*--------------------------------------------------------------------*/
- /* LOCAL CONSTANTS */
- /*--------------------------------------------------------------------*/
-
- #define PRG_TITLE "AIRLINE RESERVATIONS" // Program Title
- #define DESIGN_NAME "Airplane Reservation" // Design name
- #define DESIGN_NAME_LEN 21 // Design name length
- #define DRT_SYM_LEN 32 // Length of GS_DRT_SYM string
- #define MAX_NO_SEATS 69 // Number of seats on the plane
- #define AVAILABLE 0 // Seat status available
- #define RESERVED 1 // Seat status reserved
- #define ERROR_MSG_SIZE 100 // Size of error message
- #define MAX_LAST_NAME 25 // Maximum last name length
- #define MAX_FIRST_NAME 18 // Maximum first name length
- #define MAX_TEL 20 // Maximum telephone length
- #define MAX_ADDRESS 80 // Maximum address length
- #define PASS_RESERVED 1 // Passenger status reserved
- #define PASS_OK 2 // Passenger status confirmed
- #define OP_MOVE 1 // Operation performed is move
- #define OP_NOT_MOVE 0 // Operation performed is not move
-
- /*--------------------------------------------------------------------*/
- /* LOCAL DATA STRUCTURE */
- /*--------------------------------------------------------------------*/
-
- typedef struct
- //
- // Description:
- // Passenger identification data:
- //
- // lastName ...the passenger's last name,
- // firstName ...the passenger's first name,
- // address ...the passenger's address.
- //
- {
- CHAR lastName[MAX_LAST_NAME+1];
- CHAR firstName[MAX_FIRST_NAME+1];
- CHAR address[MAX_ADDRESS+1];
- } PASS_ID,*PPASS_ID;
-
- typedef struct
- //
- // Description:
- // Airplane seat description:
- //
- // status ...the status of the seat: available or reserved,
- // shndPass ...the handle of the passenger symbol positioned
- // on the seat,
- // passId ...the passenger identification.
- //
- {
- int status;
- SHND shndPass;
- PASS_ID passId;
- } SEAT;
-
- typedef struct
- //
- // Description:
- //
- // Flight data:
- //
- // seat ... data about each seat.
- //
- {
- SEAT seat[MAX_NO_SEATS];
- } FLIGHT,*PFLIGHT;
-
-
- typedef struct
- //
- // Description:
- // Passenger data:
- //
- // dhnd ... handle of the diagram,
- // shndPass ... handle of the passenger symbol,
- // status ... passenger's booking status: reserve or OK,
- // passId ... passenger id,
- // tel ... passenger's telephone number,
- // seatNo ... passenger's seat number,
- // meal ... passenger's ordered meal type,
- // spNeeds ... passenger's special needs,
- // age ... passenger's age group,
- // payment ... passenger's payment type.
- //
- {
- SHND shndPass;
- int status;
- PASS_ID id;
- CHAR tel[MAX_TEL+1];
- SHORT seatNo;
- USHORT meal, spNeeds, age, payment;
- } PASSENGER,*PPASSENGER;
-
- typedef struct
- //
- // Description:
- // Flight diagram processing/environment data:
- //
- // shndPlane ... handle of the plane symbol,
- // pass ... passenger data buffer,
- // passId ... passenger id data buffer.
- //
- {
- SHND shndPlane;
- PASSENGER pass;
- PASS_ID passId;
- } FLIGHT_ENV,*PFLIGHT_ENV;
-
- /*--------------------------------------------------------------------*/
- /* LOCAL FUNCTION PROTOTYPES */
- /*--------------------------------------------------------------------*/
-
- MRESULT GSENTRY ViewDlgProc( HWND, USHORT, MPARAM, MPARAM);
- MRESULT GSENTRY DetailsDlgProc( HWND, USHORT, MPARAM, MPARAM);
- SHORT CntPassSym( DHND, SHORT);
- BOOL BlanksEmpty( CHAR *);
- VOID SetPassStatusForm( DHND, SHND, SHORT);
- VOID SetSelPassStatusForm( DHND, SHORT);
- VOID PutPassForm( DHND, SHND, SHORT);
- SHORT PassDetails( DHND, SHND);
- BOOL GetRelatedMp( DHND, SHND, POINTL, SHORT *);
- VOID GetDistance( POINTL, POINTL, double *);
- VOID InitializeDlgBox( HWND, PASSENGER);
- VOID ResetAfNotPass( DHND);
- BOOL UniquePassID( DHND, SHND, PPASS_ID, BOOL);
- BOOL AfSymPosOK( DHND);
- VOID PutAfPassSym( DHND, BOOL);
- BOOL SymPosOK( DHND, SHND, SHORT *);
- VOID UpdatePassPlaneData(DHND,PPASSENGER, BOOL);
- VOID PutPassSym(DHND, SHND, BOOL);
- VOID InitPassData(PPASSENGER, SHND, SHORT);
- VOID InitDiagObjectData(PFLIGHT);
- BOOL NewFile(CHAR *);
- USHORT InitIfNewDiag(DHND, CHAR *);
- BOOL InvWinDlgBox(DHND, PPASSENGER);
-
- VOID RemLeadTrailB(CHAR *);