
/****************************************************************************/

/*  Module PNLVPTBC.C 

    Copyright 1986 Roundhill Computer Systems Limited
    All rights reserved

    Use and disclosure of this code are prohibited unless in accordance
    with the terms of the PANEL software licence.

    ************************************************************************
    *** THE OBJECT CODE VERSION OF THIS MODULE IS INCLUDED IN THE PANEL  ***
    *** LIBRARY.  IF YOU AMEND AND COMPILE THIS MODULE AND LINK IT WITH  ***
    *** YOUR APPLICATION IT WILL SUPERSEDE THE LIBRARY VERSION.          ***
    ************************************************************************

/*  Modification History (Push-Down List):  

            10.01.86        : Distribution Source Version 6.20

*****************************************************************************/

/*  The Validation Pointer Tables are defined in this module.  To include
    your own validation module, or do delete one of ours to save space, 
    simply change the initialisation in this module to include the name of 
    your own routine or to omit ours.  The dummy routines PARET0 and PARET1
    can be used to eliminate a provided routine.

    Unless a validation routine is mentioned in this module the module in 
    which it is defined will not be included in your program.
    
    To change to a special validation routine for certain sections of your 
    program, you can change these tables dynamically in your program.  
    Suitable statements to do this would be:
    
        int MyOwnValidationFunction();
        PACVTAB[entrynumber] = MyOwnValidationFunction;

    The highest function number in each category can also be increased up to
    a maximum of 255 by changing the defines in this module and arranging
    for suitable initialisation of the additional table entries.  If you 
    specify a validation type for which no initialisation is provided in this
    module, your program is unlikely to remain in control of things.
    
    Note that most of the function numbers correspond with the applicable 
    character validation number or line validation number, but that this is
    not always the case.

*****************************************************************************/

#define CVSIZE 10
#define KVSIZE 10
#define LVSIZE 14
#define FVSIZE  1
#define XVSIZE  4

/*  Define as functions all the routines we wish to use.  The comment in 
    each case includes the filename of the provided source file containing
    the code for the function.                                              */

int PACV00();   /* PNLCV00C.C  default for displayable chars or numerics */
int PACV01();   /* PNLCV01C.C  selected characters in PAVAL or XA NL */
int PACV02();   /* PNLCV02C.C  password asterisks */
int PACV03();   /* PNLCV03C.C  picture validation using XA PV */
int PACV04();   /* PNLCV04C.C  numeric 0 to 9 only */
int PACV05();   /* PNLCV05C.C  emit string after first character entered */
int PACV06();   /* PNLCV06C.C  convert  < > to , . */
int PACV07();   /* PNLCV07C.C  word wrap on entry */
int PACV08();   /* PNLCV08C.C  toggle through list in XA VL */
int PACV09();   /* PNLCV09C.C  check for matching first char in PAMENU field */

int PAKV00();   /* PNLKV00C.C  default, including mask field checks */ 
int PAKV02();   /* PNLCV02C.C  passwords */
int PAKV03();   /* PNLCV03C.C  picture validation */
int PAKV05();   /* PNLCV05C.C  emit string */
int PAKV08();   /* PNLCV08C.C  toggle list */
int PAKV09();   /* PNLCV09C.C  PAMENU */

int PALV00();   /* PNLLV00C.C  default, including numeric field processing */
int PALV02();   /* PNLLV02C.C  check valid value against XA VL */
int PALV11();   /* PNLLV11C.C  date d m y */
int PALV12();   /* PNLLV11C.C  date m d y */
int PALV13();   /* PNLLV11C.C  date y m d */

/*
int PAFV00();*/ /* PNLFV00C.C  Hewlett-Packard Touchscreen */

/*
int PAXV00();*/ /* PNLFV00C.C  Hewlett-Packard Touchscreen */
int PAXV01();   /* PNLXV01C.C  PARDHI read highlighting */
int PAXV02();   /* PNLCV08C.C  toggle list initialise */
int PAXV03();   /* PNLXV03C.C  current date for LV 211/212/213 */

/*  Define filler values */

static int PARET0() { return 0; }
static int PARET1() { return 1; }

/*  Define the maximum value for each table index */

int PACVPM = CVSIZE - 1;
int PAKVPM = KVSIZE - 1;
int PALVPM = LVSIZE - 1;
int PAFVPM = FVSIZE - 1;
int PAXVPM = XVSIZE - 1;

/*  Define and initialise the tables.  These are arrays of pointers to 
    functions returning integers.  The function arguments are undefined.    */

int (*PACVTB[CVSIZE])() = {PACV00, PACV01, PACV02, PACV03, 
                           PACV04, PACV05, PACV06, PACV07,
                           PACV08, PACV09};

int (*PAKVTB[KVSIZE])() = {PAKV00, PAKV00, PAKV02, PAKV03, 
                           PAKV00, PAKV05, PAKV00, PAKV00,
                           PAKV08, PAKV09};

int (*PALVTB[LVSIZE])() = {PALV00, PARET1, PALV02, PARET1, 
                           PARET1, PARET1, PARET1, PARET1,
                           PARET1, PARET1, PARET1, PALV11,
                           PALV12, PALV13};

int (*PAFVTB[FVSIZE])() = {PARET0};

int (*PAXVTB[XVSIZE])() = {PARET0, PAXV01, PAXV02, PAXV03};
