/* t4test.h   (c)Copyright Sequiter Software Inc., 1990-1993.  All rights reserved. */ 
/* Display routine definitions for CodeBase 4.5 testing */

/* #define S4TEST_KEEP_FILES */

#ifdef S4MACINTOSH
#define S4NO_PARMS
#endif

#ifdef S4OS2PM
#define IDR_MAIN     1
#define IDM_ABOUT    9600
#define IDM_DO_TEST  9700
#define EM_CODEBASE_ERROR 9800
#define ID_OK        1
#define ID_CANCEL    2
#define MESSAGELEN          50
#define MSGBOXID        1001
#define IDS_APPNAME     2
#define IDS_UNTITLED    7

extern HWND hwndMainFrame ;
extern HWND hwndMain ;
extern HDC  hdcMain ;
extern HAB  hab ;
extern HMQ  hmq ;
extern CHAR szAppName[MAXNAMEL] ;
extern CHAR szUntitled[MESSAGELEN] ;
#else
#ifdef S4WINDOWS
#include <windows.h>
#else
#define HWND unsigned
#define HANDLE unsigned
#endif
#endif

#ifdef S4UNIX
#include "p4port.h"
#endif

#define  T4_ERROR_WAR     "\r\n\r\nTest Warning Number"
#define  T4_ERROR_SEV     "\r\n\r\nTest Failure Number"

#define t4err_field      -801
#define t4err_append     -802
#define t4err_count      -803
#define t4err_go         -804
#define t4err_data       -805
#define t4err_append_blank  -806
#define t4err_write      -807
#define t4err_close      -808
#define t4err_lock       -809
#define t4err_unlock     -809
#define t4err_recno      -810
#define t4err_deleted    -811
#define t4err_pack       -812
#define t4err_zap        -813
#define t4err_n_fields   -814
#define t4err_name       -815
#define t4err_memory     -816
#define t4err_general    -817
#define t4err_sort       -818
#define t4err_check      -819
#define t4err_tag        -820
#define t4err_seek       -821
#define t4err_reindex    -822
#define t4err_skip       -823
#define t4err_parm       -824
#define t4err_expr       -825
#define t4err_memo       -826
#define t4err_flush      -827
#define t4err_opt        -828
#define t4err_date       -829
#define t4err_position   -830
#define t4err_relate     -831
#define t4err_read       -832

typedef struct
{
#ifdef S4WINDOWS
#ifdef S4MEDIUM
  char *ptr ;
#else
  LPSTR  ptr ;
#endif
#else
  int          n_parms ;
  int          i_parm ;
  char       **parms ;
#endif
} D4PARSE_STR;

typedef struct
{
  HWND      hWnd ;
#ifdef S4OS2PM
  HANDLE    hInst ;
#else
  HANDLE    hInst ;
#endif
  D4PARSE_STR  parse_str ;
  int          x,y ;

#ifdef S4WINDOWS
  TEXTMETRIC   tm ;
  LPMSG        lpmsg ;
  MSG          msg ;  /* Last Message */
  int          did_close ;
  int          did_quit ;
  HCURSOR      hSaveCursor ;
#endif
#ifdef S4OS2PM
  FONTMETRICS  tm ;
  int          did_close ;
  int          did_quit ;
  int          do_box ;
  char         str[80] ;
  int          is_new_line ;
  int          len ;
  int          display_set ;
#endif
} D4DISPLAY;

#ifdef S4TEMP
extern D4DISPLAY display ;
#else
#ifdef S4OS2PM
extern D4DISPLAY display ;
#endif
#endif


#ifdef DLL
extern HANDLE test_hInst ;
#endif

#ifdef S4WINDOWS
extern MSG msg ;
extern TEXTMETRIC tm ;
#endif

#ifdef __cplusplus
extern "C" {
#endif

  void  S4FUNCTION d4display_start( void ) ;
  int   S4FUNCTION d4display_getch( D4DISPLAY * ) ;
  void  S4FUNCTION d4display_init( D4DISPLAY *, HWND ) ;
  void  S4FUNCTION d4display_str( D4DISPLAY *, char *, int ) ;
  void  S4FUNCTION d4display_num( D4DISPLAY *, long, int ) ;
  int   S4FUNCTION d4display_quit( D4DISPLAY * ) ;
  void  S4FUNCTION d4display_wait( D4DISPLAY * ) ;

#ifdef S4WINDOWS
  void S4FUNCTION d4parsestring_init( D4PARSE_STR *, LPSTR ) ;
#else
  void S4FUNCTION d4parsestring_init( D4PARSE_STR *, int , char ** ) ;
#endif

  char *S4FUNCTION d4parsestring_nparm( D4PARSE_STR * ) ;
  int   S4FUNCTION t4test( D4DISPLAY * ) ;

  void S4FUNCTION t4warn( int, char * ) ;
  void S4FUNCTION t4severe( int, char * ) ;

#ifdef __cplusplus
}
#endif
