/*******************************************************************************
* YORKTOWN ADVANCED SGML PARSER (YASP)                                         *
*         An SGML Parser conforming to International Standard ISO 8879 --      *
*         Standard Generalized Markup Language                                 *
*------------------------------------------------------------------------------*
* Written 1987 - 1993 by                                                       *
*         Pierre G. Richard                                                    *
*         IBM T.J. Watson Research Center                                      *
*         Yorktown Heights, New York                                           *
*         petrus@watson.ibm.com                                                *
*------------------------------------------------------------------------------*
* FUNCTION NAME    = YASP / Header File                                        *
* STATUS           = Version 0, Release 1, Level 35 and up                     *
* COMPONENT NAME   = usrlib.h                                                  *
* DESCRIPTIVE NAME = Prototype all-purpose functions of the tool library       *
* DATE_WR          = 03/01/1987                                                *
* AUTHOR           = Pierre G. Richard - PETRUS at YKTVMX                      *
*                                                                              *
* FUNCTIONAL DESCRIPTION =                                                     *
* IMPLEMENTATION NOTES =                                                       *
* CHANGE HISTORY =                                                             *
*******************************************************************************/

#define malloc(x)    pl_allo(gbla_p,x)
#define zalloc(x)    pl_zallo(gbla_p,x)
#define free(x)      pl_free(gbla_p,x)
#define realloc(x,y) pl_ralo(gbla_p,x,y)
#define exit(x)      prsexit(gbla_p,x)
#define printf       --error--

/* define NALLOC_PWR  5       2 **  5 =   32 bytes defined here */
/* define NALLOC_PWR 11       2 ** 11 = 2048 bytes defined here */
#define NALLOC_PWR 12      /* 2 ** 12 = 4096 bytes defined here */
/* define MAX_ALLOC    ((((uint) ~0) << 8) - (1  << NALLOC_PWR)) */
#define MAX_ALLOC    (((uint) ~0) << 8)

extern void *   C_FCT memcpy     (void *, const void *, uint); /*nooverlap*/
extern void *   C_FCT memmove    (void *, const void *, uint); /*overlap */
extern void *   C_FCT memset     (void *, int, uint);
extern void *   C_FCT memchr     (const void *, int, uint);
extern uint     C_FCT strlen     (const uchar *);
extern int      C_FCT strcmp     (const uchar *, const uchar *);
extern void     P_FCT wqsort     (
   int, int(P_FCT *)(int, int, void *),
   void(P_FCT *)(int, int, void *), void *
);

#ifdef GLOBAL_INCLUDED
extern void *   P_FCT sa_init    (
   GA_P, uint, int (P_FCT *)(uchar *, uchar *, GA_P)
);
extern void     P_FCT sa_instl   (void *, uchar *);
extern uchar *  P_FCT sa_term    (void *, uint *);
extern void *   P_FCT shsh_lod   (void *, void *);
extern void *   P_FCT shsh_fnd   (void *, uchar *);
extern void *   P_FCT shsh_add   (GA_P,void *,uchar *,uint);
extern void     P_FCT prsexit    (GA_P, int);  /* in main module */
extern OFS      P_FCT sk_park    (GA_P, uchar *, uint);
extern uchar *  P_FCT sk_point   (GA_P, OFS);
extern void     P_FCT sk_out     (
   GA_P, int (P_FCT *)(GA_P, AHL, void const *, uint), AHL
);
extern void     P_FCT lst_add    (GA_P, ADLEN *, uchar *, int);
extern boolean  P_FCT lst_del    (GA_P, ADLEN *, uchar *);
extern void     P_FCT lst_tvr    (GA_P, ADLEN *,boolean(P_FCT *)(GA_P,uchar *));
extern void     P_FCT pl_sppop   (GA_P);
extern void     P_FCT pl_sppsh   (GA_P);
extern void     P_FCT pl_clean   (GA_P);
extern int      P_FCT pl_accs    (GA_P, int);
extern void     P_FCT pl_rels    (GA_P);
extern void     P_FCT pl_clrp    (GA_P);
extern void *   P_FCT pl_copy    (GA_P, GLOBAL_AREA *, void *, void *, int);
extern void *   P_FCT pl_allo    (GA_P, uint);
extern void *   P_FCT pl_zallo   (GA_P, uint);
extern void     P_FCT pl_free    (GA_P, void *);
extern void *   P_FCT pl_ralo    (GA_P, void *, uint);
extern boolean  P_FCT ut_open    (GA_P, uint, boolean, uchar *, EXID *, AHL *);
extern int      P_FCT ut_vget    (GA_P, AHL, void * *);
extern void     P_FCT ut_vput    (GA_P, AHL, void *, uint);
extern int      P_FCT ut_read    (GA_P, AHL, void *, uint);
extern AHL *    P_FCT ut_find    (GA_P, uint, uchar *, EXID *);
extern int      P_FCT ut_write   (GA_P, AHL, void const *, uint);
extern boolean  P_FCT ut_close   (GA_P, AHL);
#endif
/******************************************************************************/
