first commit - moved from local dev to git

This commit is contained in:
firebee
2022-10-02 10:09:40 +02:00
commit bbb3ef9333
1861 changed files with 167960 additions and 0 deletions

View File

@@ -0,0 +1,115 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef ABC_RUN_H
#define ABC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,345 @@
#ifndef __AES_XTND_H
#define __AES_XTND_H
#if ( WDLG_DIRECT_CALL == 0 )
/****** Wdialog definitions ***********************************************/
typedef void *DIALOG;
typedef short (__Cdecl *HNDL_OBJ)( DIALOG *dialog, EVNT *events, short obj, short clicks, void *data );
DIALOG *G_decl wdlg_create ( HNDL_OBJ handle_exit, OBJECT *tree, void *user_data, short code, void *data, short flags dglob );
short G_decl wdlg_open ( DIALOG *dialog, char *title, short kind, short x, short y, short code, void *data dglob );
#if MT_OLDWAY
short G_decl wdlg_close ( DIALOG *dialog dglob );
#else
short G_decl wdlg_close ( DIALOG *dialog, short *x, short *y dglob );
#endif
short G_decl wdlg_delete ( DIALOG *dialog dglob );
short G_decl wdlg_get_tree ( DIALOG *dialog, OBJECT **tree, GRECT *r dglob );
short G_decl wdlg_get_edit ( DIALOG *dialog, short *cursor dglob );
void *G_decl wdlg_get_udata ( DIALOG *dialog dglob );
short G_decl wdlg_get_handle ( DIALOG *dialog dglob );
short G_decl wdlg_set_edit ( DIALOG *dialog, short obj dglob );
short G_decl wdlg_set_tree ( DIALOG *dialog, OBJECT *tree dglob );
short G_decl wdlg_set_size ( DIALOG *dialog, GRECT *size dglob );
short G_decl wdlg_set_iconify ( DIALOG *dialog, GRECT *g, char *title, OBJECT *tree, short obj dglob );
short G_decl wdlg_set_uniconify ( DIALOG *dialog, GRECT *g, char *title, OBJECT *tree dglob );
short G_decl wdlg_evnt ( DIALOG *dialog, EVNT *events dglob );
void G_decl wdlg_redraw ( DIALOG *dialog, GRECT *rect, short obj, short depth dglob );
/* Definitionen f<>r <flags> */
#define WDLG_BKGD 1 /* Hintergrundbedienung zulassen */
/* Funktionsnummern f<>r <obj> bei handle_exit(...) */
#define HNDL_INIT -1 /* Dialog initialisieren */
#define HNDL_MESG -2 /* Dialog initialisieren */
#define HNDL_CLSD -3 /* Dialogfenster wurde geschlossen */
#define HNDL_OPEN -5 /* Dialog-Initialisierung abschlie<69>en (zweiter Aufruf am Ende von wdlg_init) */
#define HNDL_EDIT -6 /* Zeichen f<>r ein Edit-Feld <20>berpr<70>fen */
#define HNDL_EDDN -7 /* Zeichen wurde ins Edit-Feld eingetragen */
#define HNDL_EDCH -8 /* Edit-Feld wurde gewechselt */
#define HNDL_MOVE -9 /* Dialog wurde verschoben */
#define HNDL_TOPW -10 /* Dialog-Fenster ist nach oben gekommen */
#define HNDL_UNTP -11 /* Dialog-Fenster ist nicht aktiv */
/****** Listbox definitions ***********************************************/
typedef void *LIST_BOX;
typedef void (__Cdecl *SLCT_ITEM)( LIST_BOX *box, OBJECT *tree, struct _lbox_item *item, void *user_data, short obj_index, short last_state );
typedef short (__Cdecl *SET_ITEM)( LIST_BOX *box, OBJECT *tree, struct _lbox_item *item, short obj_index, void *user_data, GRECT *rect, short first );
typedef struct _lbox_item
{
struct _lbox_item *next; /* Zeiger auf den n<>chsten Eintrag in der Liste */
short selected; /* gibt an, ob das Objekt selektiert ist */
short data1; /* Daten f<>r das Programm... */
void *data2;
void *data3;
} LBOX_ITEM;
#define LBOX_VERT 1 /* Listbox mit vertikalem Slider */
#define LBOX_AUTO 2 /* Auto-Scrolling */
#define LBOX_AUTOSLCT 4 /* automatische Darstellung beim Auto-Scrolling */
#define LBOX_REAL 8 /* Real-Time-Slider */
#define LBOX_SNGL 16 /* nur ein anw<6E>hlbarer Eintrag */
#define LBOX_SHFT 32 /* Mehrfachselektionen mit Shift */
#define LBOX_TOGGLE 64 /* Status eines Eintrags bei Selektion wechseln */
#define LBOX_2SLDRS 128 /* Listbox hat einen hor. und einen vertikalen Slider */
/* #defines f<>r Listboxen mit nur einem Slider */
#define lbox_get_visible \
lbox_get_avis
#define lbox_get_first \
lbox_get_afirst
#define lbox_set_slider \
lbox_set_asldr
#define lbox_scroll_to \
lbox_ascroll_to
LIST_BOX *G_decl (lbox_create)(
OBJECT *tree, SLCT_ITEM slct, SET_ITEM set, LBOX_ITEM *items, short visible_a, short first_a,
short *ctrl_objs, short *objs, short flags, short pause_a, void *user_data, void *dialog,
short visible_b, short first_b, short entries_b, short pause_b dglob );
void G_decl lbox_update ( LIST_BOX *box, GRECT *rect dglob );
short G_decl lbox_do ( LIST_BOX *box, short obj dglob );
short G_decl lbox_delete ( LIST_BOX *box dglob );
short G_decl lbox_cnt_items ( LIST_BOX *box dglob );
OBJECT *G_decl lbox_get_tree ( LIST_BOX *box dglob );
short G_decl lbox_get_avis ( LIST_BOX *box dglob );
void * G_decl lbox_get_udata ( LIST_BOX *box dglob );
short G_decl lbox_get_afirst ( LIST_BOX *box dglob );
short G_decl lbox_get_slct_idx ( LIST_BOX *box dglob );
LBOX_ITEM *
G_decl lbox_get_items ( LIST_BOX *box dglob );
LBOX_ITEM *
G_decl lbox_get_item ( LIST_BOX *box, short n dglob );
LBOX_ITEM *
G_decl lbox_get_slct_item ( LIST_BOX *box dglob );
short G_decl lbox_get_idx ( LBOX_ITEM *items, LBOX_ITEM *search dglob );
short G_decl lbox_get_bvis ( LIST_BOX *box dglob );
short G_decl lbox_get_bentries ( LIST_BOX *box dglob );
short G_decl lbox_get_bfirst ( LIST_BOX *box dglob );
void G_decl lbox_set_asldr ( LIST_BOX *box, short first, GRECT *rect dglob );
void G_decl lbox_set_items ( LIST_BOX *box, LBOX_ITEM *items dglob );
void G_decl lbox_free_items ( LIST_BOX *box dglob );
void G_decl lbox_free_list ( LBOX_ITEM *items dglob );
void G_decl lbox_ascroll_to ( LIST_BOX *box, short first, GRECT *box_rect, GRECT *slider_rect dglob );
void G_decl lbox_set_bsldr ( LIST_BOX *box, short first, GRECT *rect dglob );
void G_decl lbox_set_bentries ( LIST_BOX *box, short entries dglob );
void G_decl lbox_bscroll_to ( LIST_BOX *box, short first, GRECT *box_rect, GRECT *slider_rect dglob );
/****** font selector definitions ***********************************************/
typedef void *FNT_DIALOG;
typedef void (__Cdecl *UTXT_FN)( short x, short y, short *clip_rect, long id, long pt, long ratio, char *string );
typedef struct _fnts_item
{
struct _fnts_item *next; /* Zeiger auf den n<>chsten Font oder 0L (Ende der Liste) */
UTXT_FN display; /* Zeiger auf die Anzeige-Funktion f<>r applikationseigene Fonts */
long id; /* ID des Fonts, >= 65536 f<>r applikationseigene Fonts */
short index; /* Index des Fonts (falls VDI-Font) */
char mono; /* Flag f<>r <20>quidistante Fonts */
char outline; /* Flag f<>r Vektorfont */
short npts; /* Anzahl der vordefinierten Punkth<74>hen */
char *full_name; /* Zeiger auf den vollst<73>ndigen Namen */
char *family_name; /* Zeiger auf den Familiennamen */
char *style_name; /* Zeiger auf den Stilnamen */
char *pts; /* Zeiger auf Feld mit Punkth<74>hen */
long reserved[4]; /* reserviert, m<>ssen 0 sein */
} FNTS_ITEM;
/* Definitionen f<>r <font_flags> bei fnts_create() */
#define FNTS_BTMP 1 /* Bitmapfonts anzeigen */
#define FNTS_OUTL 2 /* Vektorfonts anzeigen */
#define FNTS_MONO 4 /* <20>quidistante Fonts anzeigen */
#define FNTS_PROP 8 /* proportionale Fonts anzeigen */
/* Definitionen f<>r <dialog_flags> bei fnts_create() */
#define FNTS_3D 1 /* 3D-Design benutzen */
/* Definitionen f<>r <button_flags> bei fnts_open() */
#define FNTS_SNAME 0x01 /* Checkbox f<>r die Namen selektieren */
#define FNTS_SSTYLE 0x02 /* Checkbox f<>r die Stile selektieren */
#define FNTS_SSIZE 0x04 /* Checkbox f<>r die H<>he selektieren */
#define FNTS_SRATIO 0x08 /* Checkbox f<>r das Verh<72>ltnis Breite/H<>he selektieren */
#define FNTS_CHNAME 0x0100 /* Checkbox f<>r die Namen anzeigen */
#define FNTS_CHSTYLE 0x0200 /* Checkbox f<>r die Stile anzeigen */
#define FNTS_CHSIZE 0x0400 /* Checkbox f<>r die H<>he anzeigen */
#define FNTS_CHRATIO 0x0800 /* Checkbox f<>r das Verh<72>ltnis Breite/H<>he anzeigen */
#define FNTS_RATIO 0x1000 /* Verh<72>ltnis Breite/H<>he einstellbar */
#define FNTS_BSET 0x2000 /* Button "setzen" anw<6E>hlbar */
#define FNTS_BMARK 0x4000 /* Button "markieren" anw<6E>hlbar */
/* Definitionen f<>r <button> bei fnts_evnt() */
#define FNTS_CANCEL 1 /* "Abbruch" wurde angew<65>hlt */
#define FNTS_OK 2 /* "OK" wurde gedr<64>ckt */
#define FNTS_SET 3 /* "setzen" wurde angew<65>hlt */
#define FNTS_MARK 4 /* "markieren" wurde bet<65>tigt */
#define FNTS_OPT 5 /* der applikationseigene Button wurde ausgew<65>hlt */
FNT_DIALOG *
G_decl fnts_create ( short vdi_handle, short no_fonts, short font_flags, short dialog_flags, char *sample, char *opt_button dglob );
short G_decl fnts_delete ( FNT_DIALOG *fnt_dialog, short vdi_handle dglob );
short G_decl fnts_open ( FNT_DIALOG *fnt_dialog, short button_flags, short x, short y, long id, long pt, long ratio dglob );
#if MT_OLDWAY
short G_decl fnts_close ( FNT_DIALOG *fnt_dialog dglob );
#else
short G_decl fnts_close ( FNT_DIALOG *fnt_dialog, short *x, short *y dglob );
#endif
short G_decl fnts_get_no_styles ( FNT_DIALOG *fnt_dialog, long id dglob );
long G_decl fnts_get_style ( FNT_DIALOG *fnt_dialog, long id, short index dglob );
short G_decl fnts_get_name ( FNT_DIALOG *fnt_dialog, long id, char *full_name, char *family_name, char *style_name dglob );
short G_decl fnts_get_info ( FNT_DIALOG *fnt_dialog, long id, short *mono, short *outline dglob );
short G_decl fnts_add ( FNT_DIALOG *fnt_dialog, FNTS_ITEM *user_fonts dglob );
void G_decl fnts_remove ( FNT_DIALOG *fnt_dialog dglob );
short G_decl fnts_update ( FNT_DIALOG *fnt_dialog, short button_flags, long id, long pt, long ratio dglob );
short G_decl fnts_evnt ( FNT_DIALOG *fnt_dialog, EVNT *events, short *button, short *check_boxes, long *id, long *pt, long *ratio dglob );
short G_decl fnts_do ( FNT_DIALOG *fnt_dialog, short button_flags, long id_in, long pt_in, long ratio_in, short *check_boxes, long *id, long *pt, long *ratio dglob );
#endif /* WDLG_DIRECT_CALL */
/****** file selector definitions ***********************************************/
/* Sortiermodi */
#define SORTBYNAME 0
#define SORTBYDATE 1
#define SORTBYSIZE 2
#define SORTBYTYPE 3
#define SORTBYNONE 4
/* Flags f<>r Dateiauswahl */
#define DOSMODE 1
#define NFOLLOWSLKS 2
#define GETMULTI 8
/* fslx_set_flags */
#define SHOW8P3 1
typedef void XATTR;
typedef short __Cdecl XFSL_FILTER(char *path, char *name, XATTR *xa);
void * G_decl fslx_open(
char *title,
short x, short y,
short *handle,
char *path, short pathlen,
char *fname, short fnamelen,
char *patterns,
XFSL_FILTER *filter,
char *paths,
short sort_mode,
short flags dglob);
short G_decl fslx_evnt(
void *fsd,
EVNT *events,
char *path,
char *fname,
short *button,
short *nfiles,
short *sort_mode,
char **pattern dglob );
void * G_decl fslx_do(
char *title,
char *path, short pathlen,
char *fname, short fnamelen,
char *patterns,
XFSL_FILTER *filter,
char *paths,
short *sort_mode,
short flags,
short *button,
short *nfiles,
char **pattern dglob );
short G_decl fslx_getnxtfile ( void *fsd, char *fname dglob );
short G_decl fslx_close ( void *fsd dglob );
short G_decl fslx_set_flags ( short flags, short *oldval dglob );
/************************************************************************/
#if ( WDLG_DIRECT_CALL == 0 )
#include "PRDIALOG.H" /* Struktur zum Einf<6E>gen eigener Drucker und Unterdialoge */
#include "PRSETTNG.H" /* PRN_SETTINGS-Struktur */
typedef void *PRN_DIALOG;
PRN_DIALOG *
G_decl pdlg_create ( short dialog_flags dglob );
short G_decl pdlg_delete ( PRN_DIALOG *prn_dialog dglob );
short G_decl pdlg_open ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, char *document_name, short option_flags, short x, short y dglob );
short G_decl pdlg_close ( PRN_DIALOG *prn_dialog, short *x, short *y dglob );
long G_decl G_nv(pdlg_get_setsize);
short G_decl pdlg_add_printers ( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info dglob );
short G_decl pdlg_remove_printers ( PRN_DIALOG *prn_dialog dglob );
short G_decl pdlg_update ( PRN_DIALOG *prn_dialog, char *document_name dglob );
short G_decl pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialogs dglob );
short G_decl pdlg_remove_sub_dialogs( PRN_DIALOG *prn_dialog dglob );
PRN_SETTINGS *
G_decl pdlg_new_settings ( PRN_DIALOG *prn_dialog dglob );
short G_decl pdlg_free_settings ( PRN_SETTINGS *settings dglob );
short G_decl pdlg_dflt_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings dglob );
short G_decl pdlg_validate_settings( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings dglob );
short G_decl pdlg_use_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings dglob );
short G_decl pdlg_save_default_settings( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings dglob );
short G_decl pdlg_evnt ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, short *button dglob );
short G_decl pdlg_do ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, char *document_name, short option_flags dglob );
/* <dialog_flags> f<>r pdlg_create() */
#define PDLG_3D 0x0001
/* <option_flags> f<>r pdlg_open/do() */
#define PDLG_PREFS 0x0000 /* Einstelldialog anzeigen */
#define PDLG_PRINT 0x0001 /* Druckdialog anzeigen */
#define PDLG_ALWAYS_COPIES 0x0010 /* immer Kopien anbieten */
#define PDLG_ALWAYS_ORIENT 0x0020 /* immer Querformat anbieten */
#define PDLG_ALWAYS_SCALE 0x0040 /* immer Skalierung anbieten */
#define PDLG_EVENODD 0x0100 /* Option f<>r gerade und ungerade Seiten anbieten */
/* <button> f<>r pdlg_evnt()/pdlg_do */
#define PDLG_CANCEL 1 /* "Abbruch" wurde angew<65>hlt */
#define PDLG_OK 2 /* "OK" wurde gedr<64>ckt */
#endif /*WDLG_DIRECT_CALL*/
/************************************************************************\
/* Editor-Funktionen */
\************************************************************************/
typedef void XEDITINFO;
XEDITINFO *
G_decl edit_create (void);
short G_decl edit_open ( OBJECT *tree, short obj dglob);
void G_decl edit_close ( OBJECT *tree, short obj dglob);
void G_decl edit_delete ( XEDITINFO *xi dglob);
short G_decl edit_cursor ( OBJECT *tree, short obj, short whdl, short show dglob);
short G_decl edit_evnt ( OBJECT *tree, short obj, short whdl, EVNT *ev dglob);
short G_decl edit_get_buf ( OBJECT *tree, short obj, char **buf, long *buflen, long *txtlen dglob );
short G_decl edit_get_format ( OBJECT *tree, short obj, short *tabwidth, short *autowrap dglob );
short G_decl edit_get_colour ( OBJECT *tree, short obj, short *tcolour, short *bcolour dglob );
short G_decl edit_get_cursor ( OBJECT *tree, short obj, char **cursorpos dglob );
short G_decl edit_get_font ( OBJECT *tree, short obj, short *fontID, short *fontH, short *mono dglob );
void G_decl edit_set_buf ( OBJECT *tree, short obj, char *buf, long buflen dglob );
void G_decl edit_set_format ( OBJECT *tree, short obj, short tabwidth, short autowrap dglob );
void G_decl edit_set_font ( OBJECT *tree, short obj, short fontID, short fontH, short mono dglob );
void G_decl edit_set_colour ( OBJECT *tree, short obj, short tcolour, short bcolour dglob );
void G_decl edit_set_cursor ( OBJECT *tree, short obj, char *cursorpos dglob );
short G_decl edit_resized ( OBJECT *tree, short obj, short *oldrh, short *newrh dglob );
short G_decl edit_get_dirty ( OBJECT *tree, short obj dglob );
void G_decl edit_set_dirty ( OBJECT *tree, short obj, short dirty dglob );
void G_decl edit_get_sel ( OBJECT *tree, short obj, char **bsel, char **esel dglob );
void G_decl edit_get_pos ( OBJECT *tree, short obj, short *xscroll, long *yscroll, char **cyscroll, char **cursorpos, short *cx, short *cy dglob );
void G_decl edit_set_pos ( OBJECT *tree, short obj, short xscroll, long yscroll, char *cyscroll, char *cursorpos, short cx, short cy dglob );
void G_decl edit_get_scrollinfo ( OBJECT *tree, short obj, long *nlines, long *yscroll, short *yvis, short *yval, short *ncols, short *xscroll, short *xvis dglob );
short G_decl edit_scroll ( OBJECT *tree, short obj, short whdl, long yscroll, short xscroll dglob );
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1 @@
/* This file is part of the AHCC C Library.

View File

@@ -0,0 +1,158 @@
/* Copyright (c) 2001 - present by Henk Robbers @ Amsterdam
*
* This file is part of AHCM. A Home Cooked Memory allocator.
*
* AHCM is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCM; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Thread safe and debug friendly memory allocator
*/
#ifdef _XA_MEMORY_H
#pragma if_endfile /* AHCC: perform #endif and abandon file immediately */
/* there is also if_endcomp and if_endmake, + the equivalents without if_ */
#else
#define _XA_MEMORY_H
#include <prelude.h>
#include <stdlib.h> /* size_t */
#define XA_lib_replace 1
typedef short XA_key;
/* size must be multiple of 4 */
typedef struct xa_unit
{
long size; /* MUST be in front and include unitprefix !! */
struct xa_unit *next,*prior;
XA_key key,
ty;
char area[0];
} XA_unit;
typedef struct xa_list
{
XA_unit *first, *cur, *last;
} XA_list;
/* size must be multiple of 4 */
typedef struct xa_block /* These are the big ones, at least 8K */
{
long size; /* MUST be in front and include blockprefix!! */
long magic;
struct xa_block *next, *prior;
XA_list used, free;
short mode, filler;
XA_unit area[0];
} XA_block;
#undef MX_STRAM
#undef MX_TTRAM
#undef MX_PREFSTRAM
#undef MX_PREFTTRAM
#undef MX_HEADER
#undef MX_PRIVATE
#undef MX_GLOBAL
#undef MX_SUPERVISOR
#undef MX_READABLE
enum
{
MX_STRAM = 0,
MX_TTRAM = 1,
MX_PREFSTRAM = 2,
MX_PREFTTRAM = 3,
MX_HEADER = (1 << 3),
MX_PRIVATE = ((1 << 3) | (1 << 4)),
MX_GLOBAL = ((1 << 3) | (2 << 4)),
MX_SUPERVISOR= ((1 << 3) | (3 << 4)),
MX_READABLE = ((1 << 3) | (4 << 4))
};
#define XA_LOCAL 1 /* base is defined in local memory */
typedef struct xa_memory XA_memory;
typedef void XA_report(XA_memory *base, XA_block *blk, XA_unit *unit, char *txt, short nr);
typedef short XA_run_out(XA_memory *base, XA_key xkey, XA_key xtype);
struct xa_memory
{
XA_block *first, *last, *cur; /* No free pointer here, blocks that
become free are returned to GEMDOS */
long chunk;
short round,
flags,
mode,
stack;
XA_run_out *runout, /* default out of memory function */
*ranout; /* transient out of memory function */
char *name;
long allocated;
};
extern XA_memory XA_heap_base, XA_local_base, XA_file_base, XA_global_base;
void XA_set_base (XA_memory *base, size_t chunk, short round, short mode, XA_run_out *runout, char *name);
void * XA_alloc (XA_memory *base, size_t amount, XA_run_out *ranout, XA_key , XA_key );
void * XA_calloc (XA_memory *base, size_t items, size_t chunk, XA_run_out *ranout, XA_key , XA_key );
void * XA_realloc (XA_memory *base, void *area, size_t size, XA_run_out *ranout, XA_key , XA_key );
bool XA_free (XA_memory *base, void *area);
void XA_free_all (XA_memory *base, XA_key , XA_key );
void XA_up (XA_memory *base);
void * XA_new (XA_memory *base, size_t size, XA_key key);
void XA_down (XA_memory *base);
bool XA_leaked (XA_memory *base, XA_key , XA_key , XA_report *report, short nr);
void XA_sanity (XA_memory *base, XA_report *report, short nr);
void XA_list_free(XA_memory *base, XA_report *report);
#if XA_lib_replace
/* The below are wrapper functions and do the same
as the macros further below.
You can find them in ahcm.c
By having these functions in ahcm.c
existing library functions are completely replaced.
*/
void *calloc(size_t n, size_t sz);
void *malloc(size_t size);
void *realloc(void *, size_t);
void free(void *);
void _FreeAll(void);
#else
/* In this case, only files that include ahcm.h
invoke AHCM. Other objects are not affected.
Calls to standard C malloc in libraries are not
replaced.
*/
#define calloc(n,l) XA_calloc(nil, (n), (l), nil, 0, 0)
#define malloc(l) XA_alloc (nil, (l), nil, 0, 0)
#define realloc(p,l) XA_realloc(nil, (p), (l), nil, 0, 0)
#define free(a) XA_free (nil, (a), 0)
#define _freeAll() XA_free_all(nil, -1, -1)
#endif
#define unitprefix sizeof(XA_unit)
#define blockprefix sizeof(XA_block)
#define XA_MAGIC 0xf1e2d3c4
void *xmalloc (size_t, XA_key);
void *xcalloc (size_t items, size_t chunk, XA_key key);
void *xrealloc (void *old, size_t size, XA_key key);
void xfree (void *);
void *fmalloc (size_t, XA_key);
void *fcalloc (size_t items, size_t chunk, XA_key key);
void *frealloc (void *old, size_t size, XA_key key);
void ffree (void *);
#endif

View File

@@ -0,0 +1,73 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if __AHCC__
#ifdef _ASSERT_H
# undef _ASSERT_H
# undef assert
#endif
#define _ASSERT_H 1
/* If NDEBUG is defined, do nothing.
If not, and EXPRESSION is zero, print an error message and abort. */
#ifdef NDEBUG
# define assert(expr) ((void)0)
#else /* Not NDEBUG. */
void _Assert(void *);
# define _VAL(x) #x
# define assert(test) ((test) || (_Bool)_Assert(__FILE__ ":" _VAL(__LINE__) " " #test))
#endif /* NDEBUG */
#else /* Pure C */
#if !defined( __ASSERT )
#define __ASSERT
#if !defined(NDEBUG)
#if !defined(__STDLIB)
#include <stdlib.h>
#endif
#if !defined( __STDIO )
#include <stdio.h>
#endif
#define assert( expr )\
((void)((expr)||(fprintf( stderr, \
"\nAssertion failed: %s, file %s, line %d\n",\
#expr, __FILE__, __LINE__ ),\
((short (*)(void))abort)())))
#else
#define assert( expr )
#endif /* NDEBUG */
#endif /* __ASSERT */
#endif

View File

@@ -0,0 +1,46 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/*
* BASEPAGE.H Definition of the basepage structure
*/
#ifndef BASEP_H
#define BASEP_H
typedef struct basep
{
char *p_lowtpa; /* pointer to self (bottom of TPA) */
char *p_hitpa; /* pointer to top of TPA + 1 */
char *p_tbase; /* base of text segment */
long p_tlen; /* length of text segment */
char *p_dbase; /* base of data segment */
long p_dlen; /* length of data segment */
char *p_bbase; /* base of BSS segment */
long p_blen; /* length of BSS segment */
char *p_dta; /* pointer to current DTA */
struct basep *p_parent; /* pointer to parent's basepage */
char *p_reserved; /* reserved for future use */
char *p_env; /* pointer to environment string */
long p_undef[20]; /* scratch area... don't touch */
char p_cmdlin[128]; /* command line image */
} BASEPAGE;
extern BASEPAGE *_base;
#endif BASEP_H

View File

@@ -0,0 +1,64 @@
/* compiler specific defines */
/* this file is guaranteed to be included exactly once if you include
anything at all. all site-dependent or compiler-dependent stuff
should go here!!!
*/
#ifndef _COMPILER_H
# define _COMPILER_H 1
#if ! defined __TURBOC__
#error for Pure C, Turbo C or AHCC only
#endif
/* Undefine everything, so we get a clean slate. */
#undef __USE_POSIX
#undef __USE_POSIX2
#undef __USE_POSIX199309
#undef __USE_XOPEN
#undef __USE_XOPEN_EXTENDED
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
#undef __USE_GNU
#undef __USE_REENTRANT
#undef __FAVOR_BSD
#undef __KERNEL_STRICT_NAMES
#undef __USE_MINTLIB
/* general library stuff */
/* __SIZE_TYPEDEF__: the type returned by sizeof() */
/* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
/* __WCHAR_TYPEDEF__: wide character type (i.e. type of L'x') */
/* __EXITING: the type of a function that exits */
/* __NORETURN: attribute of a function that exits (gcc >= 2.5) */
/* __CDECL: function must get parameters on stack */
#define __SIZE_TYPEDEF__ unsigned long
#define __PTRDIFF_TYPEDEF__ long
#define __WCHAR_TYPEDEF__ short
#define __EXITING void
#define __VA_LIST__ char *
#define __CDECL cdecl
#define __cdecl cdecl
#define __TCC_GEMLIB__
#define __NORETURN
#define __EXTERN
#define __PROTO(x) x
#define __P(x) x
#define __NULL 0L
#define _UID_T unsigned short
#define _GID_T unsigned short
#define _PID_T short
/* used in limits.h, stdio.h */
#define _NFILE (32) /* maximum number of open streams */
#define atarist
#define __BEGIN_DECLS
#define __END_DECLS
#define begin_decls __BEGIN_DECLS
#define end_decls __END_DECLS
#endif /* _COMPILER_H */

View File

@@ -0,0 +1,14 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,

View File

@@ -0,0 +1,38 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* dltoahcc.h */
/* Bridge between dlibs' and AHCC's or PC's FILE structure */
#if defined (__FOR_AHCC_) && ! defined (__DLTOAH__)
#define __DLTOAH__ 1
#define _flag Flags
#define _file Handle
#define _base BufStart
#define _ptr BufPtr
#define _bsiz BufEnd
#define _cnt BufEnd
#define _ch ChrBuf
#endif

View File

@@ -0,0 +1,46 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* From the mintlib modified by Henk Robbers <h.rbbers@chello.nl> */
#if !defined _ERRNO_H
# define _ERRNO_H 1 /* Allow multiple inclusion. */
extern short errno;
#define DEFENUM 1
enum
{
#include "pc_errno.h"
sys_nerr
};
#ifndef ERROR
#define ERROR (-1) /* general error condition */
#endif
typedef struct
{
char *text, *short_text;
short errno;
} ERR_LIST;
#endif

View File

@@ -0,0 +1,164 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined( __EXT_H__ )
#define __EXT_H__
#include <time.h>
extern short __text, __data, __bss;
#define _text &__text
#define _data &__data
#define _bss &__bss
#define FA_UPDATE 0x00
#define FA_RDONLY 0x01
#define FA_HIDDEN 0x02
#define FA_SYSTEM 0x04
#define FA_LABEL 0x08
#define FA_DIREC 0x10
#define FA_ARCH 0x20
#define MAXPATH 119
#define MAXDRIVE 3
#define MAXDIR 102
#define MAXFILE 9
#define MAXEXT 5
/* bits in struct stat mode */
#define S_IFREG 0100000
#define S_IFCHR 0020000
#define S_IFDIR 0040000
#define S_IEXEC 0000100
#define S_IREAD 0000400
#define S_IWRITE 0000200
#if !defined( __STDDEF )
#include <stddef.h>
#endif
struct ffblk
{
char ff_reserved[21]; /* Reserved by TOS */
char ff_attrib; /* Attribute found */
short ff_ftime; /* File time */
short ff_fdate; /* File date */
long ff_fsize; /* File size */
char ff_name[132]; /* File name found */
};
#ifndef HAVE_STRUCT_FT
struct date
{
short da_year; /* Current year */
char da_day, /* Day of the month */
da_mon; /* Month ( 1 = Jan ) */
};
struct time
{
unsigned char
min, /* Minutes */
hour, /* Hours */
hund, /* Hundredths of seconds */
sec; /* Seconds */
};
typedef
struct ftime
{
unsigned ft_hour: 5;
unsigned ft_min: 6;
unsigned ft_tsec: 5;
unsigned ft_year: 7;
unsigned ft_month: 4;
unsigned ft_day: 5;
};
#define HAVE_STRUCT_FT 1
#endif
struct stat
{
short
st_dev,
st_ino,
st_mode,
st_nlink,
st_uid,
st_gid,
st_rdev;
size_t
st_size;
long
st_atime,
st_mtime,
st_ctime;
};
struct dfree
{
unsigned short
df_avail,
df_total,
df_bsec,
df_sclus;
};
short getcurdir( short drive, char *path );
char *getcwd( char *buffer, short bufflen );
short getdisk( void );
void getdfree( short drive, struct dfree *dtable );
short setdisk( short drive );
short findfirst( const char *filename, struct ffblk *ffblk, short attrib );
short findnext( struct ffblk *ffblk );
void getdate( struct date *dateRec );
void gettime( struct time *timeRec );
void setdate( struct date *dateRec );
void settime( struct time *timeRec );
short getftime( short handle, struct ftime *ftimep );
short setftime( short handle, struct ftime *ftimep );
struct tm *ftimtotm( struct ftime *f ); /* code in time.c */
void delay( unsigned long milliseconds );
void sleep( unsigned short seconds );
short kbhit( void );
short getch( void );
short getche( void );
short putch( short c);
short chdir( const char *filename );
short fstat( short handle, struct stat *statbuf );
short stat( const char *path, struct stat *buff );
short access( const char *name, short am );
long fsize( const char *name );
short isatty( short handle );
long filelength( short handle );
size_t coreleft( void );
short chmod(const char *filename, short pmode);
short getpid(void);
#endif

View File

@@ -0,0 +1,92 @@
#define VERTFLAG 0x0100
#define STMODES 0x0080
#define OVERSCAN 0x0040
#define PAL 0x0020
#define VGA_FALCON 0x0010
#define TV 0x0000
#define COL80 0x08
#define COL40 0x00
#define BPS16 4
#define BPS8 3
#define BPS4 2
#define BPS2 1
#define BPS1 0
#define NUMCOLS 7
typedef struct
{
short blocktype;
long blocksize;
void *blockaddr;
} DSPBLOCK;
long locksnd( void );
long unlocksnd( void );
long soundcmd( short mo, short data );
long setbuffer( short reg, void *begaddr, void *endaddr );
long setmode( short mo );
long settracks( short playtracks, short rectracks );
long setmontracks( short montrack );
long setinterrupt( short src_inter, short cause );
long buffoper( short mo );
long dsptristate( short dspxmit, short dsprec );
long gpio( short mo, short data );
long devconnect( short src, short dst, short srcclk, short prescale,
short protocol );
long sndstatus( short reset );
long buffptr( long *ptr );
short Dsp_LoadProg( char *file, short ability, char *buffer );
long Dsp_LodToBinary( char *file, char *codeptr );
void Dsp_DoBlock( char *data_in, long size_in, char *data_out,
long size_out );
void Dsp_BlkHandShake( char *data_in, long size_in, char *data_out,
long size_out );
void Dsp_BlkUnpacked( long *data_in, long size_in, long *data_out,
long size_out );
void Dsp_InStream( char *data_in, long block_size, long num_blocks,
long *blocks_done );
void Dsp_OutStream( char *data_out, long block_size, long num_blocks,
long *blocks_done );
void Dsp_IOStream( char *data_in, char *data_out, long block_insize,
long block_outsize, long num_blocks,
long *blocks_done );
void Dsp_RemoveInterrupts( short mask );
short Dsp_GetWordSize( void );
short Dsp_Lock( void );
void Dsp_Unlock( void );
void Dsp_Available( long *xavailable, long *yavailable );
short Dsp_Reserve( long xreserve, long yreserve );
void Dsp_ExecProg( char *codeptr, long codesize, short ability );
void Dsp_ExecBoot( char *codeptr, long codesize, short ability );
void Dsp_TriggerHC( short vector );
short Dsp_RequestUniqueAbility( void );
short Dsp_GetProgAbility( void );
void Dsp_FlushSubroutines( void );
short Dsp_LoadSubroutine( char *codeptr, long codesize, short ability );
short Dsp_InqSubrAbility( short ability );
short Dsp_RunSubroutine( short handle );
short Dsp_Hf0( short flag );
short Dsp_Hf1( short flag );
short Dsp_Hf2( void );
short Dsp_Hf3( void );
void Dsp_BlkWords( void *data_in, long size_in, void *data_out,
long size_out );
void Dsp_BlkBytes( void *data_in, long size_in, void *data_out,
long size_out );
char Dsp_HStat( void );
void Dsp_SetVectors( void (*receiver)( ), long (*transmitter)( ));
void Dsp_MultBlocks( long numsend, long numreceive,
DSPBLOCK *sendblocks, DSPBLOCK *receiveblocks );
short Vsetmode( short modecode );
short mon_type( void );
long VgetSize( short mo );
void VsetSync( short flag );
void VsetRGB( short index, short count, long *array );
void VgetRGB( short index, short count, long *array );
void VsetMask( short ormask, short andmask, short overlay );

View File

@@ -0,0 +1,50 @@
/* FLOAT.H
Characteristics of floating point types
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __FLOAT )
#define __FLOAT
#define FLT_ROUNDS 1
#define FLT_RADIX 2
#define FLT_MANT_DIG 24
#define FLT_DIG 6
#define FLT_MIN_EXP -125
#define FLT_MIN_10_EXP -37
#define FLT_MAX_EXP 128
#define FLT_MAX_10_EXP 38
#define FLT_EPSILON 1.192093E-07
#define FLT_MIN 1.175494E-38
#define FLT_MAX 3.402823E+38
#define DBL_MANT_DIG 64
#define DBL_DIG 19
#define DBL_MIN_EXP -16383
#define DBL_MIN_10_EXP -4932
#define DBL_MAX_EXP 16384
#define DBL_MAX_10_EXP 4932
#define DBL_EPSILON 5.421010862427522170E-0020
#define DBL_MIN 1.681051571556046753E-4932
#define DBL_MAX 1.189731495357231765E+4932
#define LDBL_MANT_DIG 64
#define LDBL_DIG 19
#define LDBL_MIN_EXP -16383
#define LDBL_MIN_10_EXP -4932
#define LDBL_MAX_EXP 16384
#define LDBL_MAX_10_EXP 4932
#define LDBL_EPSILON 5.421010862427522170E-0020
#define LDBL_MIN 1.681051571556046753E-4932
#define LDBL_MAX 1.189731495357231765E+4932
#endif
/************************************************************************/


View File

@@ -0,0 +1,184 @@
/* Copyright (c) 1990 - present by H. Robbers. ANSI upgrade.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef GEMPB_H
#define GEMPB_H
/* (c) 1990 1999 Henk Robbers Amsterdam
1990: used in a item_selector of my own (called within trap)
1999: adapted to modern OS's like MagiC and MiNT,
added flexibility and compiletime compatability with original binding.
*/
#include <prelude.h>
#if 0
/* define these in your compilers -D options or in the project file */
#define G_MT 0 /* declare as 1 if you generate for Multi Threading version */
#define G_EXT 0 /* declare as 1 if you want extended bindings. */
#define G_MODIFIED 0 /* declare as 1 if you want modified bindings for:
evnt_button, evnt_mouse, objc_draw, form_center,
form_do, form_dial wind_get.... */
/* define these in your compilers -D options or in the project file */
#define G_STACK 0 /* declare as 1 if you want to compile for systems with
parameters all on the stack (faster bindings possible) */
#define PC_GLOB 0 /* declare as 1 if your program uses the global in GEMPARBLK of Pure C */
#endif
#if G_STACK && (sizeof(G_w) == sizeof(G_i))
#define ON_STACK 1
#if __TURBOC__ || __AHCC__ || __ABC__
#define G_decl cdecl /* for bindings */
#define __Cdecl cdecl /* ALWAYS cdecl */
#define CDECL 1
#define __WGS_ELLIPSISD__ 1 /* define this as 1 if you use the 'ellipsis'd version of wind_get & wind_set */
#else
#define G_decl /* or whatever is needed */
#define __Cdecl
#endif
#else
#if __TURBOC__ || __AHCC__ || __ABC__
#define G_decl /* for bindings */
#define __Cdecl cdecl /* ALWAYS cdecl */
#define CDECL 1
#define __WGS_ELLIPSISD__ 1 /* define this as 1 if you use the 'ellipsis'd version of wind_get & wind_set */
#else
#define G_decl /* or whatever is needed */
#define __Cdecl
#endif
#endif
typedef union
{
void * spec; /* PC_GEM */
long l;
short pi[2];
} private;
/* At last give in to the fact that it is a struct, NOT an array */
typedef struct aes_global
{
short version,
count,
id;
private *pprivate;
void **ptree;
void *mem;
short lmem,
nplanes,
res1,res2,
bvdisk,
bvhard;
} GLOBAL;
#define aes_global (_GemParBlk.glob)
#if G_MT /* pass global at the user level */
#define dglob ,GLOBAL *glob
#define pglob glob
#define G_n(x) MT_ ## x
#define G_nv(x) MT_ ## x (GLOBAL *glob) /* for void x(void) */
#else /* use implicit global */
#define dglob
#if PC_GLOB /* use PC's _GemParBlk */
#define pglob 0L
#else /* use simple defaults */
#define pglob &aes_global
#endif
#define G_n(x) x
#define G_nv(x) x(void)
#endif
short __Cdecl G_trap
(short * contrl, /* 4(sp) */
GLOBAL * glob, /* 8(sp) */
short * intin, /* 12(sp) */
short * intout, /* 16(sp) */
void * addrin, /* 20(sp) */
void * addrout); /* 24(sp) */
void __Cdecl _trap_vdi
(short handle, /* 4(sp) */
short fu, /* 6(sp) */
short ii, /* 8(sp) */
short pi, /* 10(sp) */
short * contrl, /* 12(sp) */
short * intin, /* 16(sp) */
short * ptsin, /* 20(sp) */
short * intout, /* 24(sp) */
short * ptsout); /* 28(sp) */
typedef struct
{
short x, y, bstate, kstate;
} EVNTDATA;
typedef struct
{
short out,
x,y,
w,h;
} MOBLK;
typedef enum
{
MU_KEYBD =0x0001,
MU_BUTTON=0x0002,
MU_M1 =0x0004,
MU_M2 =0x0008,
MU_MESAG =0x0010,
MU_TIMER =0x0020,
MU_WHEEL =0x0040, /* AES 4.09 & XaAES */
MU_MX =0x0080, /* XaAES */
MU_NORM_KEYBD =0x0100, /* " */
MU_DYNAMIC_KEYBD=0x0200 /* keybd as a bunch of buttons, includes release of key */
} EVENT_TY;
typedef struct /* Ereignisstruktur f<>r EVNT_multi(), Fensterdialoge, etc. */
{
short mwhich;
short mx;
short my;
short mbutton;
short kstate;
short key;
short mclicks;
short reserved[9];
short msg[16];
} EVNT;
typedef struct
{
short contrl[15];
GLOBAL glob; /* keep the word global reserved for lamguage */
short intin[132];
short intout[140];
void * addrin[16];
void * addrout[16];
} GEMPARBLK;
extern GEMPARBLK _GemParBlk;
extern short _app,gl_apid,gl_ap_version;
short vq_aes( void );
/* AESPB is now completely out of sight */
#endif

View File

@@ -0,0 +1,69 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef _AHCC_LIMITS_H_
#define _AHCC_LIMITS_H_ 1
/* These assume 8-bit char's, 16-bit short int's,
and 16 or 32-bit int's and 32-bit long int's. */
#define CHAR_BIT 8
#define INT_BIT (sizeof(int)*CHAR_BIT) /* HR */
#define SHORT_BIT (sizeof(short)*CHAR_BIT) /* HR */
#define LONG_BIT (sizeof(long)*CHAR_BIT) /* HR */
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 255U
#if __CHAR_UNSIGNED__
#define CHAR_MIN 0
#define CHAR_MAX UCHAR_MAX
#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
#endif
#define MB_LEN_MAX 1
#define LONG_MIN (-2147483647L-1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295LU
#define SHRT_MIN (-32767-1)
#define SHRT_MAX 32767
#define USHRT_MAX 65535U
#if sizeof(int) == 2 /* 16 bit int's */
#define INT_MIN SHRT_MIN
#define INT_MAX SHRT_MAX
#define UINT_MAX USHRT_MAX
#else
#define INT_MIN LONG_MIN
#define INT_MAX LONG_MAX
#define UINT_MAX ULONG_MAX
#endif
#if __LONG_LONG__
#define LLONG_MAX 9223372036854775807LL
#define LLONG_MIN (-LLONG_MAX - 1LL)
#define ULLONG_MAX 18446744073709551615ULL
#endif
#endif

View File

@@ -0,0 +1,403 @@
/*
* MATH.H Math functionality for AHCC & PURE_C
*/
#if ! defined MATH_H
#define MATH_H
#ifdef __NO_FLOAT__
#error floating point not implemented by this compiler
#else
#if __ABC__ || __AHCC__
#define FMATH_H
#define operator __OP__
#define cast __UC__
typedef double FpF(double);
typedef double FpFF(double,double);
FpF ceil, floor;
#ifndef __68881__
FpF sin,cos,tan,asin,acos,atan,log,log10,log2,sqrt,
exp,sinh,asinh,cosh,acosh,tanh,atanh,fabs,
getexp,getman;
/* Of course the following is NON C
* The ANSI standard tells us that standard headers are completely
* implementor defined as long as their function complies the standard.
* They need not even be files at all.
* #include <name> however is the standerd way to invoke them.
* Every implementor has its own way to deal with extracode software.
* I too do it my way.
* Basicly I borrowed this from Algol68, long before I ever heard of C,
* or even C++.
*/
/* ahcc puts every next declaration in front of the table!!
So it is recommended to put these declarations
in ascending order of frequency.
Put the most frequent at the end.
*/
#define __IEEE__
double operator * (double,double) XXmul,
operator / (double,double) XXdiv,
/* operator % (double,double) XXrem, */
operator + (double,double) XXadd,
operator - (double,double) XXsub,
operator - (double) Xneg;
bool operator ! (double) Xnot,
operator < (double,double) XXcmp,
operator > (double,double) XXcmp,
operator <= (double,double) XXcmp,
operator >= (double,double) XXcmp,
operator == (double,double) XXcmp,
operator != (double,double) XXcmp;
unsigned
long cast(double) Xlcnv;
int cast(double) Xlcnv;
unsigned
int cast(double) Xlcnv;
char cast(double) Xlcnv;
unsigned
char cast(double) Xlcnv;
float cast(double) Xfcnv;
long cast(double) Xlcnv;
double cast(float) fXcnv,
cast(unsigned long) ulXcnv,
cast(unsigned int) uiXcnv,
cast(unsigned char) uiXcnv,
cast(char) iXcnv,
cast(int) iXcnv,
cast(long) lXcnv;
#ifdef __IEEE__ /* if allready determined */
/* in fact this is determined by the called software itself,
so here are the names */
float operator * (float,float) FFmul,
operator / (float,float) FFdiv,
/* operator % (float,float) FFrem, */
operator + (float,float) FFadd,
operator - (float,float) FFsub,
operator - (float) Fneg;
bool operator ! (float) Fnot,
operator < (float,float) FFcmp,
operator > (float,float) FFcmp,
operator <= (float,float) FFcmp,
operator >= (float,float) FFcmp,
operator == (float,float) FFcmp,
operator != (float,float) FFcmp;
unsigned
long cast(float) _Flcnv;
int cast(float) _Flcnv;
unsigned
int cast(float) _Flcnv;
char cast(float) _Flcnv;
unsigned
char cast(float) _Flcnv;
long cast(float) _Flcnv;
float cast(unsigned long) _ulFcnv,
cast(unsigned) _uiFcnv,
cast(char) _iFcnv, /* char on stack becomes int */
cast(int) _iFcnv,
cast(long) _lFcnv;
#else
/* here are the old SOZOBON names.
I know some names dont really exist, but this how
it should be done and the missing ones can
be added anytime. */
float operator * (float,float) fpmul,
operator / (float,float) fpdiv,
/* operator % (float,float) fprem, */
operator + (float,float) fpadd,
operator - (float,float) fpsub,
operator - (float) fpneg;
bool operator ! (float) fpnot,
operator < (float,float) fpcmp,
operator > (float,float) fpcmp,
operator <= (float,float) fpcmp,
operator >= (float,float) fpcmp,
operator == (float,float) fpcmp,
operator != (float,float) fpcmp;
unsigned
long cast(float) _fpftol;
int cast(float) _fpftol;
unsigned
int cast(float) _fpftol;
char cast(float) _fpftol;
unsigned
char cast(float) _fpftol;
long cast(float) _fpftol;
float cast(unsigned long) _fpultof,
cast(unsigned) _fpuitof,
cast(char) _fpitof, /* char on stack becomes int */
cast(int) _fpitof,
cast(long) _fpltof;
#endif
#else /* if FPU, built in monadic operators (compiler opt -8) */
#define fabs(f) __FABS__(f)
#define trunc(f) __FINTRZ__(f)
#define fint(f) __FINT__(f)
#define sqrt(f) __FSQRT__(f)
#define fintrz(f) __FINTRZ__(f)
#if ! __COLDFIRE__
#define sin(f) __FSIN__(f)
#define cos(f) __FCOS__(f)
#define tan(f) __FTAN__(f)
#define asin(f) __FASIN__(f)
#define acos(f) __FACOS__(f)
#define atan(f) __FATAN__(f)
#define fetoxm1(f) __FETOXM1__(f)
#define log(f) __FLOGN__(f)
#define flognp1(f) __FLOGNP1__(f)
#define log2(f) __FLOG2__(f)
#define log10(f) __FLOG10__(f)
#define fneg(f) __FNEG__(f)
#define exp(f) __FETOX__(f)
#define sinh(f) __FSINH__(f)
#define cosh(f) __FCOSH__(f)
#define tanh(f) __FTANH__(f)
#define atanh(f) __FATANH__(f)
#define fgetexp(f) __FGETEXP__(f)
#define fgetman(f) __FGETMAN__(f)
#define pow10(f) __FTENTOX__(f)
#define pow2(f) __FTWOTOX__(f)
#else
double ldexp(double b, int n);
double frexp(double b, int *ip);
double modf(double b, double *op);
double fmod( double x, double y );
double cos( double x );
double sin( double x );
double tan( double x );
double acos( double x );
double asin( double x );
double atan( double x );
double cosh( double x );
double sinh( double x );
double tanh( double x );
double atanh( double x );
double log10( double x );
double log2( double x );
double log ( double x );
double exp ( double x );
double pow10( int i );
double pow2 ( double x );
#endif
#endif
FpFF atan2,pow,fmod;
FpF asinh, acosh;
double atof(const char *);
double ldexp(double b, int n);
double frexp(double b, int *ip);
double modf(double b, double *op);
/* Some useful constants, generally to 21 digits */
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309116
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_1_SQRTPI 0.564189583547756286948
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT_2 0.707106781186547524401
#if __COLDFIRE__
#define MAXREAL (double)1.79769313486232E+308 /* 64 bits */
#else
#define MAXREAL (double)1.189731495357231765E+4932 /* 80 bits */
#endif
#define HUGE_VAL MAXREAL
#define _ABS(x) ((x) < 0 ? -(x) : (x))
#undef operator
#undef cast
#else /* not AHCC */
/* MATH.H
Mathematical Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#define __MATH
#if __COLDFIRE__
#define HUGE_VAL 1.79769313486232E+308 /* 64 bits */
#else
#define HUGE_VAL 1.189731495357231765E+4932 /* 80 bits */
#endif
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309116
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_1_SQRTPI 0.564189583547756286948
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT_2 0.707106781186547524401
double fabs( double x );
double ceil( double x );
double floor( double x );
/* double round( double x ); */
double trunc( double x );
double fmod( double x, double y );
double exp( double x );
double log( double x );
double log2( double x );
double log10( double x );
double frexp( double x, int *nptr );
double ldexp( double x, int n );
double modf( double x, double *nptr );
double pow( double x, double y );
double pow10( int i );
double pow2( double i );
double sqrt( double x );
double cos( double x );
double sin( double x );
double tan( double x );
void sincos( double x, double *sin, double *cos );
double acos( double x );
double asin( double x );
double atan( double x );
double atan2( double x, double y );
double cosh( double x );
double sinh( double x );
double tanh( double x );
double acosh( double x );
double asinh( double x );
double atanh( double x );
double pow( double x, double y );
short ftoa( double *x, char *resStr, short ndig, short format,
short *decPnt, short *sign );
double atof( const char *digStr );
typedef enum
{
DOMAIN = 1, /* argument domain error -- log (-1) */
SING, /* argument singularity -- pow (0,-2)) */
OVERFLOW, /* overflow range error -- exp (1000) */
UNDERFLOW /* underflow range error -- exp (-1000) */
} mexcep;
struct exception
{
mexcep type;
char *name;
double arg1;
double arg2;
double retval;
};
void setmatherr( short (*errorfunc)( struct exception *e ) );
short fpumode( short dis );
void xdcnv( double *val, void *rep8bytes );
void dxcnv( void *rep8bytes, double *val );
#if defined( __68881__ )
double fint( double x );
double fintrz( double x );
double fgetexp( double x );
double fgetman( double x );
double frem( double x, double y );
double fsgldiv( double x, double y );
double fsglmul( double x, double y );
double fetoxm1( double x );
double flognp1( double x );
double pow2( double x );
#endif
#if defined( __68881__ ) && !defined( __NFPUIN__ )
/* MC68881 extensions */
/* Arithmetische Befehle: */
#define trunc( x ) __FINTRZ__( x )
#define fabs( x ) __FABS__( x )
#define fgetexp( x ) __FGETEXP__( x )
#define fgetman( x ) __FGETMAN__( x )
#define fint( x ) __FINT__( x )
#define fintrz( x ) __FINTRZ__( x )
#define fmod( x, y ) __FMOD__( y, x )
#define frem( x, y ) __FREM__( y, x )
#define ldexp( x, y ) __FSCALE__( y, x )
#define fsgldiv( x, y ) __FSGLDIV__( y, x )
#define fsglmul( x, y ) __FSGLMUL__( y, x )
/* Potenzen und Logarithmen: */
#define exp( x ) __FETOX__( x )
#define fetoxm1( x ) __FETOXM1__( x )
#define log( x ) __FLOGN__( x )
#define flognp1( x ) __FLOGNP1__( x )
#define log10( x ) __FLOG10__( x )
#define log2( x ) __FLOG2__( x )
#define sqrt( x ) __FSQRT__( x )
#define pow10( x ) __FTENTOX__( x )
#define pow2( x ) __FTWOTOX__( x )
/* Trigonometrie: */
#define acos( x ) __FACOS__( x )
#define asin( x ) __FASIN__( x )
#define atan( x ) __FATAN__( x )
#define cos( x ) __FCOS__( x )
#define sin( x ) __FSIN__( x )
#define tan( x ) __FTAN__( x )
/* Hyperbelfunktionen: */
#define atanh( x ) __FATANH__( x )
#define cosh( x ) __FCOSH__( x )
#define sinh( x ) __FSINH__( x )
#define tanh( x ) __FTANH__( x )
/* Conversionsfunktionen nur f<>r TC881LIB.LIB */
double x80x96cnv( void *rep10bytes );
void x96x80cnv( double rep12bytes, void *rep10bytes );
#endif
#endif /* __ABC__ || __AHCC__ */
#endif /* __NO_FLOAT__ */
#endif /* MATH_H */

View File

@@ -0,0 +1,106 @@
MC68881 equ 0xfa40
COMMAND equ 0x0a
OPERAND equ 0x10
RESTORE equ 0x06
BIZY equ 0x8900
sf0 equ 0x0000; floating point source registers
sf1 equ 0x0400; B12,B11,B10 -- B14=0
sf2 equ 0x0800
sf3 equ 0x0c00
sf4 equ 0x1000
sf5 equ 0x1400
sf6 equ 0x1800
sf7 equ 0x1c00
f0 equ 0x0000; floating point destination registers
f1 equ 0x0080; B9,B8,B7
f2 equ 0x0100
f3 equ 0x0180
f4 equ 0x0200
f5 equ 0x0280
f6 equ 0x0300
f7 equ 0x0380
L equ 0x4000; operand sizes indien geen! src fp reg gegeven
S equ 0x4400; dus: memory to fp reg operations
X equ 0x4800; B12,B11,B10 -- B14=1
P equ 0x4c00
W equ 0x5000
D equ 0x5400
B equ 0x5800
__S__ equ 0x5c00
TO equ 0x0000; richting: B13 -- 0=naar floating point reg
FROM equ 0x2000; 1=naar memory
FR equ FROM
MOVE equ 0x0000; operation codes (B6-B0)
ADD equ 0x0022
SUB equ 0x0028
MUL equ 0x0023
DIV equ 0x0020
MOD equ 0x0021
REM equ 0x0025
ABS equ 0x0018
ACOS equ 0x001c
ASIN equ 0x000c
ATAN equ 0x000a
ATANH equ 0x000d
CMP equ 0x0038
COS equ 0x001d
COSH equ 0x0019
EXP equ 0x0010
ETOX equ EXP
EXPM1 equ 0x0008
ETOXM1 equ EXPM1
GETEXP equ 0x001e
GETMAN equ 0x001f
INT equ 0x0001
INTRZ equ 0x0003
LOGN equ 0x0014
LOG equ LOGN
LOGNP1 equ 0x0006
LOGPM1 equ LOGNP1
LOG2 equ 0x0016
LOG10 equ 0x0015
NEG equ 0x001a
SCALE equ 0x0026
SGLDIV equ 0x0024
SGLMUL equ 0x0027
SIN equ 0x000e
SINCOS equ 0x0030
SINH equ 0x0002
SQRT equ 0x0004
TAN equ 0x000f
TANH equ 0x0009
TENTOX equ 0x0012
EXP10 equ TENTOX
TEST equ 0x003a
TWOTOX equ 0x0011
EXP2 equ TWOTOX
MACRO tak
tst.b (a2)
beq.b *-2
ENDM
MACRO tok
cmpi #BIZY,-1(a2)
beq.b *-6
ENDM
MACRO fcpres
move.L a2,-(sp)
move #MC68881+1,a2
move #0,RESTORE-1(a2)
ENDM
MACRO fcp code
move code,COMMAND-1(a2)
tok
ENDM
MACRO fp code
move code,(a3)
tok
ENDM

View File

@@ -0,0 +1,199 @@
/* signal handling */
#include <trap.h>
#ifndef __NINT_H
#define __NINT_H
#define NSIG 31 /* number of signals recognized */
#ifndef _SIGNAL_H
#define _SIGNAL_H
#define SIGNULL 0 /* not really a signal */
#define SIGHUP 1 /* hangup signal */
#define SIGINT 2 /* sent by ^C */
#define SIGQUIT 3 /* quit signal */
#define SIGILL 4 /* illegal instruction */
#define SIGTRAP 5 /* trace trap */
#define SIGABRT 6 /* abort signal */
#define SIGPRIV 7 /* privilege violation */
#define SIGFPE 8 /* divide by zero */
#define SIGKILL 9 /* cannot be ignored */
#define SIGBUS 10 /* bus error */
#define SIGSEGV 11 /* illegal memory reference */
#define SIGSYS 12 /* bad argument to a system call */
#define SIGPIPE 13 /* broken pipe */
#define SIGALRM 14 /* alarm clock */
#define SIGTERM 15 /* software termination signal */
#define SIGURG 16 /* urgent condition on I/O channel */
#define SIGSTOP 17 /* stop signal not from terminal */
#define SIGTSTP 18 /* stop signal from terminal */
#define SIGCONT 19 /* continue stopped process */
#define SIGCHLD 20 /* child stopped or exited */
#define SIGTTIN 21 /* read by background process */
#define SIGTTOU 22 /* write by background process */
#define SIGIO 23 /* I/O possible on a descriptor */
#define SIGXCPU 24 /* CPU time exhausted */
#define SIGXFSZ 25 /* file size limited exceeded */
#define SIGVTALRM 26 /* virtual timer alarm */
#define SIGPROF 27 /* profiling timer expired */
#define SIGWINCH 28 /* window size changed */
#define SIGUSR1 29 /* user signal 1 */
#define SIGUSR2 30 /* user signal 2 */
#define SIG_DFL 0 /* default signal handler */
#define SIG_IGN 1 /* ignore the signal */
#endif
/* file types */
#define S_IFMT 0170000 /* mask to select file type */
#define S_IFCHR 0020000 /* BIOS special file */
#define S_IFDIR 0040000 /* directory file */
#define S_IFREG 0100000 /* regular file */
#define S_IFIFO 0120000 /* FIFO */
#define S_IMEM 0140000 /* memory region or process */
#define S_IFLNK 0160000 /* symbolic link */
/* special bits: setuid, setgid, sticky bit */
#define S_ISUID 0004000
#define S_ISGID 0002000
#define S_ISVTX 0001000
/* file access modes for user, group, and other*/
#define S_IRUSR 0000400
#define S_IWUSR 0000200
#define S_IXUSR 0000100
#define S_IRGRP 0000040
#define S_IWGRP 0000020
#define S_IXGRP 0000010
#define S_IROTH 0000004
#define S_IWOTH 0000002
#define S_IXOTH 0000001
#define DEFAULT_DIRMODE (0777)
#if 0
#define DEFAULT_MODE (0666)
#endif
typedef struct
{
long msg1;
long msg2;
short pid;
} __MSG;
typedef struct xattr
{
unsigned short mode;
long index;
unsigned short dev;
unsigned short rdev; /* "real" device */
unsigned short nlink;
unsigned short uid;
unsigned short gid;
long size;
long blksize;
long nblocks;
unsigned short mtime, mdate;
unsigned short atime, adate;
unsigned short ctime, cdate;
short attr;
} XATTR;
#define SA_NOCLDSTOP 1
typedef struct
{
void (*sa_handler)( long sig );
long sa_mask;
short sa_flags;
} SIGACTION;
short GEMDOS(0xff) Syield(void);
short GEMDOS(0x100) Fpipe( short *usrh );
short GEMDOS(0x104) Fcntl( short f, long arg, short cmd );
long GEMDOS(0x105) Finstat( short f );
long GEMDOS(0x106) Foutstat( short f );
long GEMDOS(0x107) Fgetchar( short f, short mo );
long GEMDOS(0x108) Fputchar( short f, long c, short mo );
long GEMDOS(0x109) Pwait( void );
short GEMDOS(0x10a) Pnice( short delta );
short GEMDOS(0x10b) Pgetpid( void );
short GEMDOS(0x10c) Pgetppid( void );
short GEMDOS(0x10d) Pgetpgrp( void );
short GEMDOS(0x10e) Psetpgrp( short pid, short newgrp );
short GEMDOS(0x10f) Pgetuid( void );
short GEMDOS(0x110) Psetuid( short id );
short GEMDOS(0x111) Pkill( short pid, short sig );
short GEMDOS(0x113) Pvfork( void );
short GEMDOS(0x114) Pgetgid( void );
short GEMDOS(0x115) Psetgid( short id );
long GEMDOS(0x116) Psigblock( long mask );
long GEMDOS(0x117) Psigsetmask( long mask );
long GEMDOS(0x118) Pusrval( long arg );
void GEMDOS(0x11a) Psigreturn( void );
short GEMDOS(0x11b) Pfork( void );
long GEMDOS(0x11c) Pwait3( short flag, long *rusage );
short GEMDOS(0x11d) Fselect( unsigned short timeout, long *rfds, long *wfds, long *xfds );
void GEMDOS(0x11e) Prusage( long *r );
long GEMDOS(0x11f) Psetlimit( short lim, long value );
long GEMDOS(0x120) Talarm( long secs );
void GEMDOS(0x121) Pause( void );
long GEMDOS(0x122) Sysconf( short n );
long GEMDOS(0x123) Psigpending( void );
long GEMDOS(0x124) Dpathconf( const char * name, short n );
long GEMDOS(0x125) Pmsg( short mo, long mbox, __MSG *msg );
long GEMDOS(0x126) Fmidipipe( short pid, short in, short out );
short GEMDOS(0x127) Prenice( short pid, short delta );
long GEMDOS(0x128) Dopendir( const char *name, short flag );
long GEMDOS(0x129) Dreaddir( short buflen, long dir, char *buf );
long GEMDOS(0x12a) Drewinddir( long dir );
long GEMDOS(0x12b) Dclosedir( long dir );
long GEMDOS(0x12c) Fxattr( short flag, const char *name, XATTR *buf );
long GEMDOS(0x12d) Flink( char *oldname, char *newname );
long GEMDOS(0x12e) Fsymlink( char *oldname, char *newname );
long GEMDOS(0x12f) Freadlink( short size, char *buf, char *name );
long GEMDOS(0x130) Dcntl( short cmd, char *name, long arg );
long GEMDOS(0x131) Fchown( char *name, short uid, short gid );
long GEMDOS(0x132) Fchmod( char *name, short mo );
long GEMDOS(0x133) Pumask( unsigned short mo );
long GEMDOS(0x134) Psemaphore( short mo, long id, long timeout );
long GEMDOS(0x135) Dlock( short mo, short drive );
void GEMDOS(0x136) Psigpause( unsigned long mask );
long GEMDOS(0x137) Psigaction( short sig, SIGACTION *act, SIGACTION *oact );
short GEMDOS(0x138) Pgeteuid( void );
short GEMDOS(0x139) Pgetegid( void );
long GEMDOS(0x13b) Dgetcwd( char *path, short drv, short size );
long GEMDOS(0x13a) Pwaitpid( short pid, short flag, long *rusage );
long GEMDOS(0x13c) Salert(char *msg);
/* The following are not yet official...
long GEMDOS(0x13d) Tmalarm( long secs );
long GEMDOS(0x13e) Psigintr( short vec, short sig);
long GEMDOS(0x13f) Suptime( long *uptime, long *avenrun);
long GEMDOS(0x142) Dxreaddir( short len, long handle, char * buf, long xattr, long *xret );
short GEMDOS(0x143) Dseteuid( short id );
short GEMDOS(0x144) Dsetegid( short id );
short GEMDOS(0x145) Dsetauid( short id );
short GEMDOS(0x146) Dgetauid( short id );
long GEMDOS(0x147) Pgetgroups( short gidsetlen, _GID_T *gidset );
long GEMDOS(0x148) Psetgroups( short gidsetlen, _GID_T *gidset );
long GEMDOS(0x149) Tsetitimer( short which, long *interval, long *value, long *ointerval, long *ovalue );
short GEMDOS(0x14e) Psetreuid( short rid, short eid );
short GEMDOS(0x14f) Psetregid( short rid, short eid );
long GEMDOS(0x150) Sync( void );
void GEMDOS(0x151) Shutdown( long restart );
char * GEMDOS(0x152) Dreadlabel( char *path, char *label, short maxlen );
char * GEMDOS(0x153) Dwritelabel( char *path, char *label);
long GEMDOS(0x154) Ssystem(short mode, long arg1, long arg2);
#define Ssystem(mode, arg1, arg2) Ssystem(mode, (long)(arg1), (long)(arg2))
long GEMDOS(0x155) Tgettimeofday(long tvp, long tzp);
#define Tgettimeofday(tvp, tzp) Tgettimeofday((long)tvp, (long)tzp)
long GEMDOS(0x156) Tsettimeofday(long tvp, long tzp);
#define Tsettimeofday(tvp, tzp) Tsettimeofday((long)tvp, (long)tzp)
long GEMDOS(0x158) Pgetpriority(short which, short who);
long GEMDOS(0x159) Psetpriority(short which, short who, short pri);
*/
#endif

View File

@@ -0,0 +1,230 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if defined DEFENUM
#define deferrno(n, s, t) n = s
#elif defined DEFLIST
#define deferrno(n, s, t) {t, #n, n}
#else
#error invalid macro definition
#endif
/* Nota Bene !!!
These are the (negative) BIOS/XBIOS/GEMDOS replies,
mot the Unix errno codes.
*/
deferrno(ENOERR, 0, "no error"),
deferrno(EERROR, 1, " Generic error"),
deferrno(EBUSY, 2, " Resource busy"),
deferrno(EUKCMD, 3, " Unknown command"),
deferrno(ECRC, 4, " CRC error"),
deferrno(EBADR, 5, " Bad request"),
deferrno(ESPIPE, 6, " Illegal seek"),
deferrno(EMEDIUMTYPE,7, " Wrong medium type"),
deferrno(ESECTOR, 8, " Sector not found"),
deferrno(EPAPER, 9, " Paper low"),
deferrno(EWRITE, 10, " Write fault"),
deferrno(EREAD, 11, " Read fault"),
deferrno(EGENERIC, 12, " General mishap"),
deferrno(EROFS, 13, " Write protect"),
deferrno(ECHMEDIA, 14, " Media change"),
deferrno(ENODEV, 15, " No such device"),
deferrno(EBADSEC, 16, " Bad sectors found"),
deferrno(ENOMEDIUM, 17, " No medium found"),
deferrno(EINSERT, 18, " Insert media"),
deferrno(EDRVNRSP, 19, " Drive not responding"),
deferrno(ESRCH, 20, " No such process"),
deferrno(ECHILD, 21, " No child processes"),
deferrno(EDEADLK, 22, " Resource deadlock would occur"),
deferrno(ENOTBLK, 23, " Block device required"),
deferrno(EISDIR, 24, " Is a directory"),
deferrno(EINVAL, 25, " Invalid argument"),
deferrno(EFTYPE, 26, " Inappropriate file type or format"),
deferrno(EILSEQ, 27, " Illegal byte sequence"),
deferrno(ENOSYS, 32, " Function not implemented"),
deferrno(ENOENT, 33, " No such file or directory"),
deferrno(ENOTDIR, 34, " Not a directory"),
deferrno(EMFILE, 35, " Too many open files"),
deferrno(ENMFILE, 35, " no more matching file"),
deferrno(EACCES, 36, " Permission denied"),
deferrno(EBADF, 37, " Bad file descriptor"),
deferrno(EPERM, 38, " Operation not permitted"),
deferrno(ENOMEM, 39, " Cannot allocate memory"),
deferrno(EFAULT, 40, " Bad address"),
deferrno(ENXIO, 46, " No such device or address"),
deferrno(ERR_47, 47, " error 47"),
deferrno(EXDEV, 48, " Cross-device link"),
deferrno(ENMFILES, 49, " No more matching file names"),
deferrno(ENFILE, 50, " File table overflow"),
deferrno(ELOCKED, 58, " Locking conflict"),
deferrno(ENSLOCK, 59, " No such lock"),
deferrno(EBADARG, 64, " Bad argument"),
deferrno(EINTERNAL, 65, " Internal error"),
deferrno(ENOEXEC, 66, " Invalid executable file format"),
deferrno(ESBLOCK, 67, " Memory block growth failure"),
deferrno(EBREAK, 68, " Aborted by user"),
deferrno(EXCPT, 69, " Terminated with bombs"),
deferrno(ETXTBSY, 70, " Text file busy"),
deferrno(EFBIG, 71, " File too big"),
deferrno(ELOOP, 80, " Too many symbolic links"),
deferrno(EPIPE, 81, " Broken pipe"),
deferrno(EMLINK, 82, " Too many links"),
deferrno(ENOTEMPTY, 83, " Directory not empty"),
deferrno(ERR_84, 84, "error 84"),
deferrno(EEXIST, 85, " File exists"),
deferrno(ENAMETOOLONG,86, " Name too long"),
deferrno(ENOTTY, 87, " Not a tty"),
deferrno(ERANGE, 88, " Range error"),
deferrno(EDOM, 89, " Domain error"),
deferrno(EIO, 90, " I/O error"),
deferrno(ENOSPC, 91, " No space left on device"),
/* Error number 92-99 reserved for TraPatch.*/
deferrno(EPROCLIM, 100, " Too many processes for user"),
deferrno(EUSERS, 101, " Too many users"),
deferrno(EDQUOT, 102, " Quota exceeded"),
deferrno(ESTALE, 103, " Stale NFS file handle"),
deferrno(EREMOTE, 104, " Object is remote"),
deferrno(EBADRPC, 105, " RPC struct is bad"),
deferrno(ERPCMISMATCH,106, " RPC version wrong"),
deferrno(EPROGUNAVAIL,107, " RPC program not available"),
deferrno(EPROGMISMATCH,108, " RPC program version wrong"),
deferrno(EPROCUNAVAIL,109, " RPC bad procedure for program"),
deferrno(ENOLCK, 110, " No locks available"),
deferrno(EAUTH, 111, " Authentication error"),
deferrno(ENEEDAUTH, 112, " Need authenticator"),
deferrno(EBACKGROUND,113, " Inappropriate operation for background process"),
deferrno(EBADMSG, 114, " Not a data message"),
deferrno(EIDRM, 115, " Identifier removed"),
deferrno(EMULTIHOP, 116, " Multihop attempted"),
deferrno(ENODATA, 117, " No data available"),
deferrno(ENOLINK, 118, " Link has been severed"),
deferrno(ENOMSG, 119, " No message of desired type"),
deferrno(ENOSR, 120, " Out of streams resources"),
deferrno(ENOSTR, 121, " Device not a stream"),
deferrno(EOVERFLOW, 122, " Value too large for defined data type"),
deferrno(EPROTO, 123, " Protocol error"),
deferrno(ETIME, 124, " Timer expired"),
deferrno(E2BIG, 125, " Argument list too long"),
deferrno(ERESTART, 126, " Interrupted system call should be restarted"),
deferrno(ECHRNG, 127, " Channel number out of range"),
deferrno(EINTR, 128, " Interrupted function call"),
/* Falcon XBIOS errors. */
deferrno(ESNDLOCKED,129, " Sound system is already locked"),
deferrno(ESNDNOTLOCK,130, " Sound system is not locked"),
deferrno(EL2NSYNC, 131, " Level 2 not synchronized"),
deferrno(EL3HLT, 132, " Level 3 halted"),
deferrno(EL3RST, 133, " Level 3 reset"),
deferrno(ELNRNG, 134, " Link number out of range"),
deferrno(EUNATCH, 135, " Protocol driver not attached"),
deferrno(ENOCSI, 136, " No CSI structure available"),
deferrno(EL2HLT, 137, " Level 2 halted"),
deferrno(EBADE, 138, " Invalid exchange"),
deferrno(EXFULL, 139, " Exchange full"),
deferrno(ENOANO, 140, " No anode"),
deferrno(EBADRQC, 141, " Invalid request code"),
deferrno(EBADSLT, 142, " Invalid slot"),
deferrno(EBFONT, 143, " Bad font file format"),
deferrno(ENONET, 144, " Machine is not on the network"),
deferrno(ENOPKG, 145, " Package is not installed"),
deferrno(EADV, 146, " Advertise error"),
deferrno(ESRMNT, 147, " Srmount error"),
deferrno(ECOMM, 148, " Communication error on send"),
deferrno(EDOTDOT, 149, " RFS specific error"),
deferrno(ELIBACC, 150, " Cannot access a needed shared library"),
deferrno(ELIBBAD, 151, " Accessing a corrupted shared library"),
deferrno(ELIBSCN, 152, " .lib section in a.out corrupted"),
deferrno(ELIBMAX, 153, " Attempting to link too many shared libraries"),
deferrno(ELIBEXEC, 154, " Cannot exec a shared library directly"),
deferrno(ESTRPIPE, 155, " Streams pipe error"),
deferrno(EUCLEAN, 156, " Structure needs cleaning"),
deferrno(ENOTNAM, 157, " Not a XENIX named type file"),
deferrno(ENAVAIL, 158, " NO XENIX semaphores available"),
deferrno(EREMOTEIO, 159, " Remote I/O error"),
deferrno(EMOUNT, 200, " Mount error"),
deferrno(ENOTSOCK, 300, " Socket operation on non-socket."),
deferrno(_NE_BASE, 300, ""),
deferrno(EDESTADDRREQ,301, " Destination address required"),
deferrno(EMSGSIZE, 302, " Message too long"),
deferrno(EPROTOTYPE,303, " Protocol wrong type for socket"),
deferrno(ENOPROTOOPT,304, " Protocol not available"),
deferrno(EPROTONOSUPPORT,305, " Protocol not supported"),
deferrno(ESOCKTNOSUPPORT,306, " Socket type not supported"),
deferrno(EOPNOTSUPP, 307, " Operation not supported"),
deferrno(EPFNOSUPPORT, 308, " Protocol family not supported"),
deferrno(EAFNOSUPPORT, 309, " Address family not supported by protocol"),
deferrno(EADDRINUSE, 310, " Address already in use"),
deferrno(EADDRNOTAVAIL, 311, " Cannot assign requested address"),
deferrno(ENETDOWN, 312, " Network is down"),
deferrno(ENETUNREACH, 313, " Network is unreachable"),
deferrno(ENETRESET, 314, " Network dropped conn. because of reset"),
deferrno(ECONNABORTED, 315, " Software caused connection abort"),
deferrno(ECONNRESET, 316, " Connection reset by peer"),
deferrno(EISCONN, 317, " Socket is already connected"),
deferrno(ENOTCONN, 318, " Socket is not connected"),
deferrno(ESHUTDOWN, 319, " Cannot send after shutdown"),
deferrno(ETIMEDOUT, 320, " Connection timed out"),
deferrno(ECONNREFUSED, 321, " Connection refused"),
deferrno(EHOSTDOWN, 322, " Host is down"),
deferrno(EHOSTUNREACH, 323, " No route to host"),
deferrno(EALREADY, 324, " Operation already in progress"),
deferrno(EINPROGRESS, 325, " Operation now in progress"),
deferrno(EAGAIN, 326, " Operation would block"),
deferrno(EWOULDBLOCK, 326, ""),
deferrno(ENOBUFS, 327, " No buffer space available"),
deferrno(ETOOMANYREFS, 328, " Too many references"),
#undef DEFENUM
#undef DEFLIST
#undef deferrno

View File

@@ -0,0 +1,294 @@
/*******************************************************************************
*
* Project name : NORMALIZED KEY CODE CONVERTER (NKCC)
* Module name : Global definitions
* Symbol prefix: nkc
*
* Author : Harald Siegmund (HS)
* Co-Authors : -
* Write access : HS
*
* Notes : -
*-------------------------------------------------------------------------------
* Things to do : -
*
*-------------------------------------------------------------------------------
* History:
*
* 1990:
* May 23-24: creation of file
* Jul 09: nkc_kstate()
* Aug 03: nkc_cmp(); NK_MASK
* Sep 15: nkc_init(): beflag,vdihnd; BE_...
* nkc_exit() has now a result
* Sep 16: nkc_timer()
* Oct 03: nkc_vlink()/vunlink(); NKXM_...
* Oct 07: removing NK_MASK (use nkc_cmp() for key code comparism!)
* Nov 13: NK_LEFT/NK_RIGHT exchanged
* Dec 11: MU_XTIMER
* 1991:
* Apr 13: nkc_conv() renamed to nkc_tconv()
* nkc_gconv()
* rearranging prototypes
* May 29: nkc_toupper, nkc_tolower
* Aug 22: NKS_DEADKEY changed
* NKS_D_...
* nkc_set() changed
* nkc_init() now returns version #
* Aug 26: NK_INVALID
* Sep 07: NK_TERM
* Sep 14: NKF_IGNUM
* Nov 16: NKS_CTRL
* Dec 29: NK_RVD...
* 1992:
* Jan 03: redefining BE_...
* NKI_...
* first parameter of nkc_init() is now of type 'unsigned long'
* Jan 12: NK_TERM: int-cast added
* 1993:
* Dec 11: new file header
* adding documentation markers and section headers
* nkc_toupper() and nkc_tolower() are functions now
* Dec 12: new: nkc_n2tos(), nkc_n2gem()
*
***************************************************************************/
/*KEY _NAME="Global NKCC definitions (C language)" */
/*END*/
#ifndef __NKCC
#define __NKCC
/*KEY _END */
/*******************************************************************************
* *
* MACROS *
* *
*******************************************************************************/
/*START*/
/* flags for NKCC initialization */
#define NKI_BUTHND 0x00000001UL /* install button event handler */
#define NKI_BHTOS 0x00000002UL /* additional flag: only if TOS has */
/* mouse click bug */
#define NKI_NO200HZ 0x00000004UL /* don't install 200 Hz clock interrupt */
/* (this flag is ignored if the button */
/* event handler is being activated) */
/*END*/
/*START*/
/* flag combinations for compatibility with old versions of NKCC */
#define BE_ON NKI_BUTHND
#define BE_OFF 0
#define BE_TOS (NKI_BUTHND | NKI_BHTOS)
/*END*/
/*START*/
/* flags for special key code handling */
#define NKS_ALTNUM 0x00000001UL /* Alt + numeric pad -> ASCII */
#define NKS_CTRL 0x00000002UL /* Control key emulation */
/* deadkey management: */
#define NKS_D_CIRCUM 0x00010000UL /* ^ accent circumflex */
#define NKS_D_TILDE 0x00020000UL /* ~ accent tilde */
#define NKS_D_AGUI 0x00040000UL /* ' accent agui */
#define NKS_D_GRAVE 0x00080000UL /* ` accent grave */
#define NKS_D_UMLAUT 0x00100000UL /* <20> umlaut */
#define NKS_D_QUOTE 0x00200000UL /* " quote, synonym for umlaut */
#define NKS_D_SMOERE 0x00400000UL /* <20> smoerebroed */
#define NKS_D_CEDIL 0x00800000UL /* , cedil */
#define NKS_D_SLASH 0x01000000UL /* / slash, for scandinavian characters */
#define NKS_DEADKEY 0xffff0000UL /* all deadkeys */
/*END*/
/*START*/
/* NKCC key code flags */
#define NKF_FUNC 0x8000 /* function */
#define NKF_RESVD 0x4000 /* resvd, ignore it! */
#define NKF_NUM 0x2000 /* numeric pad */
#define NKF_CAPS 0x1000 /* CapsLock */
#define NKF_ALT 0x0800 /* Alternate */
#define NKF_CTRL 0x0400 /* Control */
#define NKF_SHIFT 0x0300 /* any Shift key */
#define NKF_LSH 0x0200 /* left Shift key */
#define NKF_RSH 0x0100 /* right Shift key */
#define NKF_IGNUM NKF_RESVD /* special flag for nkc_cmp() */
/*END*/
/*START*/
/* special key codes for keys performing a function */
#define NK_INVALID 0x00 /* invalid key code */
#define NK_UP 0x01 /* cursor up */
#define NK_DOWN 0x02 /* cursor down */
#define NK_RIGHT 0x03 /* cursor right */
#define NK_LEFT 0x04 /* cursor left */
#define NK_RVD05 0x05 /* reserved! */
#define NK_RVD06 0x06 /* reserved! */
#define NK_RVD07 0x07 /* reserved! */
#define NK_BS 0x08 /* Backspace */
#define NK_TAB 0x09 /* Tab */
#define NK_ENTER 0x0a /* Enter */
#define NK_INS 0x0b /* Insert */
#define NK_CLRHOME 0x0c /* Clr/Home */
#define NK_RET 0x0d /* Return */
#define NK_HELP 0x0e /* Help */
#define NK_UNDO 0x0f /* Undo */
#define NK_F1 0x10 /* function key #1 */
#define NK_F2 0x11 /* function key #2 */
#define NK_F3 0x12 /* function key #3 */
#define NK_F4 0x13 /* function key #4 */
#define NK_F5 0x14 /* function key #5 */
#define NK_F6 0x15 /* function key #6 */
#define NK_F7 0x16 /* function key #7 */
#define NK_F8 0x17 /* function key #8 */
#define NK_F9 0x18 /* function key #9 */
#define NK_F10 0x19 /* function key #10 */
#define NK_RVD1A 0x1a /* reserved! */
#define NK_ESC 0x1b /* Esc */
#define NK_RVD1C 0x1c /* reserved! */
#define NK_RVD1D 0x1d /* reserved! */
#define NK_RVD1E 0x1e /* reserved! */
#define NK_DEL 0x1f /* Delete */
/* terminator for key code tables */
#define NK_TERM ((short)(NKF_FUNC | NK_INVALID))
/*END*/
/*START*/
/* ASCII codes less than 32 */
#define NUL 0x00 /* Null */
#define SOH 0x01 /* Start Of Header */
#define STX 0x02 /* Start Of Text */
#define ETX 0x03 /* End Of Text */
#define EOT 0x04 /* End Of Transmission */
#define ENQ 0x05 /* Enquiry */
#define ACK 0x06 /* positive Acknowledgement */
#define BEL 0x07 /* Bell */
#define BS 0x08 /* BackSpace */
#define HT 0x09 /* Horizontal Tab */
#define LF 0x0a /* Line Feed */
#define VT 0x0b /* Vertical Tab */
#define FF 0x0c /* Form Feed */
#define CR 0x0d /* Carriage Return */
#define SO 0x0e /* Shift Out */
#define SI 0x0f /* Shift In */
#define DLE 0x10 /* Data Link Escape */
#define DC1 0x11 /* Device Control 1 */
#define XON 0x11 /* same as DC1 */
#define DC2 0x12 /* Device Control 2 */
#define DC3 0x13 /* Device Control 3 */
#define XOFF 0x13 /* same as DC3 */
#define DC4 0x14 /* Device Control 4 */
#define NAK 0x15 /* Negative Acknowledgement */
#define SYN 0x16 /* Synchronize */
#define ETB 0x17 /* End of Transmission Block */
#define CAN 0x18 /* Cancel */
#define EM 0x19 /* End of Medium */
#define SUB 0x1a /* Substitute */
#define ESC 0x1b /* Escape */
#define FS 0x1c /* Form Separator */
#define GS 0x1d /* Group Separator */
#define RS 0x1e /* Record Separator */
#define US 0x1f /* Unit Separator */
/*END*/
/*START*/
/* XBRA vector link/unlink modes */
#define NKXM_NUM 0 /* by vector number */
#define NKXM_ADR 1 /* by vector address */
/*END*/
/*START*/
/* additional flag in event mask */
#define MU_XTIMER 0x100
/*END*/
/*******************************************************************************
* *
* PROTOTYPES *
* *
*******************************************************************************/
/* install NKCC */
short nkc_init(unsigned long flags,short vdihnd,short *pglobal);
/* deinstall NKCC */
short nkc_exit(void);
/* set special key flags */
void nkc_set(unsigned long flags);
/* NKCC key input via GEMDOS */
short nkc_conin(void);
/* console input status via GEMDOS */
short nkc_cstat(void);
/* NKCC multi event */
short cdecl nkc_multi(
short mflags,
short mbclicks,short mbmask,short mbstate,
short mm1flags,short mm1x,short mm1y,short mm1width,short mm1height,
short mm2flags,short mm2x,short mm2y,short mm2width,short mm2height,
short *mmgpbuff,
short mtlocount,short mthicount,
short *mmox,short *mmoy,short *mmbutton,short *mmokstate,
short *mkreturn,short *mbreturn);
/* convert key code in TOS format to normalized format */
short nkc_tconv(long toskey);
/* convert key code in GEM format to normalized format */
short nkc_gconv(short gemkey);
/* convert key code in normalized format to TOS format */
long nkc_n2tos(short nkcode);
/* convert key code in normalized format to GEM format */
short nkc_n2gem(short nkcode);
/* return shift key state */
short nkc_kstate(void);
/* get 200 Hz system clock counter */
unsigned long nkc_timer(void);
/* compare two key codes due to standard comparism rules */
short nkc_cmp(short refkey,short kcode);
/* link function to XBRA vector list */
void nkc_vlink(long vector,short mo,void *pfnc);
/* unlink function from XBRA vector list */
short nkc_vunlink(long vector,short mo,void *pfnc);
/* convert character to upper case */
unsigned char nkc_toupper(unsigned char chr);
/* convert character to lower case */
unsigned char nkc_tolower(unsigned char chr);
#endif /* #ifndef __NKCC */
/* End Of File */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,388 @@
/* VDI.H
GEM VDI Definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __VDI__ )
#define __VDI__
#define VDI_H
typedef struct
{
short contrl[15];
short intin[132];
short intout[140];
short ptsin[145];
short ptsout[145];
} VDIPARBLK;
typedef struct
{
short *contrl;
short *intin;
short *ptsin;
short *intout;
short *ptsout;
} VDIPB;
extern VDIPARBLK _VDIParBlk;
void vdi( VDIPB *vdipb );
/****** Control definitions *********************************************/
void v_opnwk( short *work_in, short *handle, short *work_out);
void v_clswk( short handle );
void v_opnvwk( short *work_in, short *handle, short *work_out);
void v_clsvwk( short handle );
void v_clrwk( short handle );
void v_updwk( short handle );
short vst_load_fonts( short handle, short select );
void vst_unload_fonts( short handle, short select );
void vs_clip( short handle, short clip_flag, short *pxyarray );
/****** Output definitions **********************************************/
void v_pline( short handle, short count, short *pxyarray );
void v_pmarker( short handle, short count, short *pxyarray );
void v_gtext( short handle, short x, short y, char *string );
void v_fillarea( short handle, short count, short *pxyarray );
void v_cellarray( short handle, short *pxyarray, short row_length,
short el_used, short num_rows, short wrt_mode,
short *colarray );
void v_contourfill( short handle, short x, short y, short index );
void vr_recfl( short handle, short *pxyarray );
void v_bar( short handle, short *pxyarray );
void v_arc( short handle, short x, short y, short radius,
short begang, short endang );
void v_pieslice( short handle, short x, short y, short radius,
short begang, short endang );
void v_circle( short handle, short x, short y, short radius );
void v_ellarc( short handle, short x, short y, short xradius,
short yradius, short begang, short endang );
void v_ellpie( short handle, short x, short y, short xradius,
short yradius, short begang, short endang );
void v_ellipse( short handle, short x, short y, short xradius,
short yradius );
void v_rbox ( short handle, short *pxyarray );
void v_rfbox ( short handle, short *pxyarray );
void v_justified( short handle,short x, short y, char *string,
short length, short word_space,
short char_space );
/****** Attribute definitions *****************************************/
#define IP_HOLLOW 0
#define IP_1PATT 1
#define IP_2PATT 2
#define IP_3PATT 3
#define IP_4PATT 4
#define IP_5PATT 5
#define IP_6PATT 6
#define IP_SOLID 7
/* gsx modes */
#define MD_REPLACE 1
#define MD_TRANS 2
#define MD_XOR 3
#define MD_ERASE 4
/* gsx styles */
#define FIS_HOLLOW 0
#define FIS_SOLID 1
#define FIS_PATTERN 2
#define FIS_HATCH 3
#define FIS_USER 4
/* bit blt rules */
#define ALL_WHITE 0
#define S_AND_D 1
#define S_AND_NOTD 2
#define S_ONLY 3
#define NOTS_AND_D 4
#define D_ONLY 5
#define S_XOR_D 6
#define S_OR_D 7
#define NOT_SORD 8
#define NOT_SXORD 9
#define D_INVERT 10
#define NOT_D 11
#define S_OR_NOTD 12
#define NOTS_OR_D 13
#define NOT_SANDD 14
#define ALL_BLACK 15
/* linetypes */
#define SOLID 1
#define LONGDASH 2
#define DOT 3
#define DASHDOT 4
#define DASH 5
#define DASH2DOT 6
#define USERLINE 7
#define SQUARE 0
#define ARROWED 1
#define ROUND 2
/* Lattice C should better use the TF_xxx-constants anyway... */
#define THICKENED 0x01
#define SHADED 0x02
#define SKEWED 0x04
#define UNDERLINED 0x08
#define OUTLINE 0x10
#define SHADOW 0x20
short vswr_mode( short handle, short mo );
void vs_color( short handle, short index, short *rgb_in );
short vsl_type( short handle, short style );
void vsl_udsty( short handle, short pattern );
short vsl_width( short handle, short width );
short vsl_color( short handle, short color_index );
void vsl_ends( short handle, short beg_style, short end_style );
short vsm_type( short handle, short symbol );
short vsm_height( short handle, short height );
short vsm_color( short handle, short color_index );
void vst_height( short handle, short height, short *char_width,
short *char_height, short *cell_width,
short *cell_height );
short vst_point( short handle, short point, short *char_width,
short *char_height, short *cell_width,
short *cell_height );
short vst_rotation( short handle, short angle );
short vst_font( short handle, short font );
short vst_color( short handle, short color_index );
short vst_effects( short handle, short effect );
void vst_alignment( short handle, short hor_in, short vert_in,
short *hor_out, short *vert_out );
short vsf_interior( short handle, short style );
short vsf_style( short handle, short style_index );
short vsf_color( short handle, short color_index );
short vsf_perimeter( short handle, short per_vis );
void vsf_udpat( short handle, short *pfill_pat, short planes );
/****** Raster definitions *********************************************/
typedef struct
{
void * fd_addr;
short fd_w,
fd_h,
fd_wdwidth,
fd_stand,
fd_nplanes,
fd_r1,
fd_r2,
fd_r3;
} MFDB;
void vro_cpyfm( short handle, short vr_mode, short *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB );
void vrt_cpyfm( short handle, short vr_mode, short *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB,
short *color_index );
void vr_trnfm( short handle, MFDB *psrcMFDB, MFDB *pdesMFDB );
void v_get_pixel( short handle, short x, short y, short *pel,
short *index );
/****** Input definitions **********************************************/
void vsin_mode( short phys_handle, short dev_type, short mo );
void vrq_locator( short phys_handle, short x, short y, short *xout,
short *yout, short *term );
short vsm_locator( short phys_handle, short x, short y, short *xout,
short *yout, short *term );
void vrq_valuator( short phys_handle, short valuator_in,
short *valuator_out, short *terminator );
void vsm_valuator( short phys_handle, short val_in, short *val_out,
short *term, short *status );
void vrq_choice( short phys_handle, short ch_in, short *ch_out );
short vsm_choice( short phys_handle, short *choice );
void vrq_string( short phys_handle, short max_length, short echo_mode,
short *echo_xy, char *string );
short vsm_string( short phys_handle, short max_length, short echo_mode,
short *echo_xy, char *string );
void vsc_form( short phys_handle, MFORM *pcur_form );
void vex_timv( short phys_handle, short (*tim_addr)(), short (**otim_addr)(),
short *tim_conv );
void v_show_c( short phys_handle, short reset );
void v_hide_c( short phys_handle );
void vq_mouse( short phys_handle, short *pstatus, short *x, short *y );
void vex_butv( short phys_handle, short (*pusrcode)(), short (**psavcode)() );
void vex_motv( short phys_handle, short (*pusrcode)(), short (**psavcode)() );
void vex_curv( short phys_handle, short (*pusrcode)(), short (**psavcode)() );
void vex_whlv( short phys_handle, short (*pusrcode)(), short (**psavcode)() ); /* HR 111002: wheel support */
void vq_key_s( short phys_handle, short *pstatus );
/****** Inquire definitions *******************************************/
void vq_extnd( short handle, short owflag, short *work_out );
short vq_color( short handle, short color_index,
short set_flag, short *rgb );
void vql_attributes( short handle, short *attrib );
void vqm_attributes( short handle, short *attrib );
void vqf_attributes( short handle, short *attrib );
void vqt_attributes( short handle, short *attrib );
void vqt_extent( short handle, char *string, short *extent );
short vqt_width( short handle, short character,
short *cell_width, short *left_delta,
short *right_delta );
short vqt_name( short handle, short element_num, char *name );
void vq_cellarray( short handle, short *pxyarray,
short row_length, short num_rows,
short *el_used, short *rows_used,
short *status, short *colarray );
void vqin_mode( short handle, short dew_type, short *input_mode );
void vqt_fontinfo( short handle, short *minADE, short *maxADE,
short *distances, short *maxwidth,
short *effects );
/****** Escape definitions *********************************************/
void vq_chcells( short handle, short *rows, short *columns );
void v_exit_cur( short handle );
void v_enter_cur( short handle );
void v_curup( short handle );
void v_curdown( short handle );
void v_curright( short handle );
void v_curleft( short handle );
void v_curhome( short handle );
void v_eeos( short handle );
void v_eeol( short handle );
void vs_curaddress( short handle, short Row, short Column );
void v_curaddress( short handle, short Row, short Column );
void v_curtext( short handle, char *string );
void v_rvon( short handle );
void v_rvoff( short handle );
void vq_curaddress( short handle, short *Row, short *Column );
short vq_tabstatus( short handle );
void v_hardcopy( short handle );
void v_dspcur( short handle, short x, short y );
void v_rmcur( short handle );
void v_form_adv( short handle );
void v_output_window( short handle, short *xyarray );
void v_clear_disp_list( short handle );
void v_bit_image( short handle, const char *filename,
short aspect, short x_scale, short y_scale,
short h_align, short v_align, short *xyarray );
void vq_scan( short handle, short *g_slice, short *g_page,
short *a_slice, short *a_page, short *div_fac);
void v_alpha_text( short handle, char *string );
void vs_palette( short handle, short palette );
void v_sound( short handle, short frequency, short duration );
short vs_mute( short handle, short action );
void vqp_films( short handle, char *film_names );
void vqp_state( short handle, short *port, char *film_name,
short *lightness, short *interlace,
short *planes, short *indexes );
void vsp_state( short handle, short port, short film_num,
short lightness, short interlace, short planes,
short *indexes );
void vsp_save( short handle );
void vsp_message( short handle );
short vqp_error( short handle );
void v_meta_extents( short handle, short min_x, short min_y,
short max_x, short max_y );
void v_write_meta( short handle,
short num_intin, short *intin,
short num_ptsin, short *ptsin );
void vm_coords( short handle, short llx, short lly, short urx, short ury );
void vm_filename( short handle, const char *filename );
void vm_pagesize( short handle, short pgwidth, short pdheight );
void v_offset( short handle, short offset );
void v_fontinit( short handle, short fh_high, short fh_low );
void v_escape2000( short handle, short times );
void vt_resolution( short handle, short xres, short yres,
short *xset, short *yset );
void vt_axis( short handle, short xres, short yres,
short *xset, short *yset );
void vt_origin( short handle, short xorigin, short yorigin );
void vq_tdimensions( short handle, short *xdimension, short *ydimension );
void vt_alignment( short handle, short dx, short dy );
void vsp_film( short handle, short index, short lightness );
void vsc_expose( short handle, short state );
#define GDOS_NONE -2L /* no GDOS installed */
#define GDOS_FSM 0x5F46534DL /* '_FSM' - FSMGDOS installed */
#define GDOS_FNT 0x5F464E54L /* '_FNT' - FONTGDOS installed */
short vq_gdos( void );
long vq_vgdos( void );
short v_bez_on( short handle );
void v_bez_off( short handle );
void v_set_app_buff( short handle, void *address, short nparagraphs );
void v_bez( short handle, short count, short *xyarr,
char *bezarr, short *extent, short *totpts, short *totmoves );
void v_bez_fill( short handle, short count, short *xyarr,
char *bezarr, short *extent, short *totpts,
short *totmoves );
short v_bez_qual( short handle, short prcnt, short *actual );
/****** SpeedoGDOS definitions ********************************************/
typedef long fix31;
void vqt_f_extent( short handle, char *string, short *extent );
void v_ftext( short handle, short x, short y, char *string );
void v_ftext_offset( short handle, short x, short y, char *string, short *offset );
void v_killoutline( short handle, void *component );
void v_getoutline( short handle, short ch, short *xyarray,
char *bezarray, short maxverts, short *numverts );
void vst_scratch( short handle, short mo );
void vst_error( short handle, short mo, short *errorvar );
void vqt_advance( short handle, short ch, short *advx, short *advy,
short *remx, short *remy );
void vqt_advance32( short handle, short ch, fix31 *advx, fix31 *advy );
short vst_arbpt( short handle, short point, short *chwd, short *chht,
short *cellwd, short *cellht );
fix31 vst_arbpt32( short handle, fix31 point, short *chwd, short *chht,
short *cellwd, short *cellht );
void vst_charmap( short handle, short mo );
void v_getbitmap_info( short handle, short ch, fix31 *advx, fix31 *advy,
fix31 *xoff, fix31 *yoff, fix31 *width,
fix31 *height );
void vqt_pairkern( short handle, short ch1, short ch2, fix31 *x, fix31 *y );
void vqt_trackkern( short handle, fix31 *x, fix31 *y );
void vqt_fontheader( short handle, char *buffer, char *pathname );
void vst_kern( short handle, short tmode, short pmode, short *tracks,
short *pairs );
fix31 vst_setsize32( short handle, fix31 point, short *chwd, short *chht,
short *cellwd, short *cellht );
void vqt_devinfo( short handle, short devnum, short *devexits,
char *devstr );
short v_flushcache( short handle );
void vqt_cachesize( short handle, short which_cache, long *size );
void vqt_get_table( short handle, short **map );
short v_loadcache( short handle, char *filename, short mo );
short v_savecache( short handle, char *filename );
short vst_setsize( short handle, short point, short *chwd, short *chht,
short *cellwd, short *cellht );
short vst_skew( short handle, short skew );
#endif
/***********************************************************************/

View File

@@ -0,0 +1,54 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if defined DEFENUM
#define deferrno(n, s, t) n = s
#elif defined DEFLIST
#define deferrno(n, s, t) {t, #n, n}
#else
#error invalid macro definition
#endif
deferrno(ENOERR, 0, "no error"),
deferrno(EPERM, 1, "file permission denied"),
deferrno(ENOENT, 2, "File not found"),
deferrno(EIO, 5, "general i/o error"),
deferrno(EBADF, 9, "invalid file handle"),
deferrno(EILLSPE, 10, "illegal file specification "),
deferrno(EINVMEM, 11, "invalid heap block "),
deferrno(ENOMEM, 12, "heap overflow"),
deferrno(EACCES, 13, "file access mode error"),
deferrno(EEXIST, 17, "file already exists"),
deferrno(EPLFMT, 18, "program load format error"),
deferrno(ENODEV, 19, "device error"),
deferrno(ENOTDIR, 20, "path not found"),
deferrno(EINVAL, 22, "invalid parameter"),
deferrno(ENFILE, 23, "file table overflow"),
deferrno(EMFILE, 24, "too many open files"),
deferrno(ENOSPC, 28, "disk full"),
deferrno(ESPIPE, 29, "seek error"),
deferrno(EROFS, 30, "read only device"),
deferrno(ENOSYS, 32, "function not implemented"),
deferrno(EDOM, 33, "Domain error"),
deferrno(ERANGE, 34, "range error"),
deferrno(ENMFILE, 35, "no more matching file"),
#undef DEFENUM
#undef DEFLIST
#undef deferrno

View File

@@ -0,0 +1,100 @@
/* (c) 1991-present by H. Robbers te Amsterdam
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PRELUDE_H
#define PRELUDE_H
/* HR: the word global should really be kept reserved for (future?)
use as the opposite of auto, local or static. */
#undef TRUE
#undef FALSE
#undef true
#undef false
#undef NULL
#undef null
#undef NIL
#undef nil
#ifndef __NO_FLOAT__
typedef double real;
#endif
#if ! __ABC__ /* FOR_A 0; Not for 'ABC' compiler. */
#define and && /* ISO646 */
#define or || /* ISO646 */
#define not !
#define eq ==
#define ne !=
#define ge >=
#define le <=
#define mod %
#define global
#define nil 0L
#define esac break;
#define elif else if
#define od while(1); /* ; no mistake */
#ifndef __NO_FLOAT__
typedef double extended;
typedef float single;
typedef struct { double re, im; } complex;
typedef complex compl;
#endif
#endif /* !__ABC__ */
#if ! __bool_true_false_are_defined
/* these are otherwise built in or provided by stdbool.h */
typedef enum
{
false = 0,
true
} _Bool, bool;
#define __bool_true_false_are_defined 1
#elif __AHCC__
typedef _Bool bool;
#endif
#define othw }else{
#define NULL 0L
#define null 0L
#define NIL 0L
#define FALSE false
#define TRUE true
typedef const char Cchar;
typedef const char * Cstr;
typedef char * Wstr;
typedef unsigned char uchar;
typedef unsigned short uint, ushort;
typedef unsigned long ulong;
#if __AHCC__
typedef short bits; /* use these for bitfields */
typedef unsigned short ubits;
#else
/* Pure C doesnt accept short for bit fields */
typedef int bits; /* use these for bitfields */
typedef unsigned int ubits;
#endif
#define K *1024
#define fall_thru
#define EOS '\0'
#endif

View File

@@ -0,0 +1,20 @@
/* PROCESS.H
Process Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __PROCESS )
#define __PROCESS
short exec( char *filename, char *cmdlstr, char *envstr, short *retcode );
#endif
/************************************************************************/


View File

@@ -0,0 +1,626 @@
#include <stddef.h>
#include <limits.h>
#include <signal.h>
/*
* For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
* do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
*/
#if ( (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) \
|| (defined(__WATCOMC__) && ( \
defined (_STDINT_H_INCLUDED) \
|| __WATCOMC__ >= 1250 ) \
) \
|| (defined(__GNUC__) && ( defined(_STDINT_H) \
|| defined(_STDINT_H_) ) \
) \
) && !defined(_PSTDINT_H_INCLUDED)
#include <stdint.h>
#define _PSTDINT_H_INCLUDED
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
# endif
# ifndef PRINTF_INT64_HEX_WIDTH
# define PRINTF_INT64_HEX_WIDTH "16"
# endif
# ifndef PRINTF_INT32_HEX_WIDTH
# define PRINTF_INT32_HEX_WIDTH "8"
# endif
# ifndef PRINTF_INT16_HEX_WIDTH
# define PRINTF_INT16_HEX_WIDTH "4"
# endif
# ifndef PRINTF_INT8_HEX_WIDTH
# define PRINTF_INT8_HEX_WIDTH "2"
# endif
# ifndef PRINTF_INT64_DEC_WIDTH
# define PRINTF_INT64_DEC_WIDTH "20"
# endif
# ifndef PRINTF_INT32_DEC_WIDTH
# define PRINTF_INT32_DEC_WIDTH "10"
# endif
# ifndef PRINTF_INT16_DEC_WIDTH
# define PRINTF_INT16_DEC_WIDTH "5"
# endif
# ifndef PRINTF_INT8_DEC_WIDTH
# define PRINTF_INT8_DEC_WIDTH "3"
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
# endif
/*
* Something really weird is going on with Open Watcom. Just pull some of
* these duplicated definitions from Open Watcom's stdint.h file for now.
*/
# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
# if !defined (INT64_C)
# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
# endif
# if !defined (UINT64_C)
# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
# endif
# if !defined (INT32_C)
# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
# endif
# if !defined (UINT32_C)
# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
# endif
# if !defined (INT16_C)
# define INT16_C(x) (x)
# endif
# if !defined (UINT16_C)
# define UINT16_C(x) (x)
# endif
# if !defined (INT8_C)
# define INT8_C(x) (x)
# endif
# if !defined (UINT8_C)
# define UINT8_C(x) (x)
# endif
# if !defined (UINT64_MAX)
# define UINT64_MAX 18446744073709551615ULL
# endif
# if !defined (INT64_MAX)
# define INT64_MAX 9223372036854775807LL
# endif
# if !defined (UINT32_MAX)
# define UINT32_MAX 4294967295UL
# endif
# if !defined (INT32_MAX)
# define INT32_MAX 2147483647L
# endif
# if !defined (INTMAX_MAX)
# define INTMAX_MAX INT64_MAX
# endif
# if !defined (INTMAX_MIN)
# define INTMAX_MIN INT64_MIN
# endif
# endif
#endif
#ifndef _PSTDINT_H_INCLUDED
#define _PSTDINT_H_INCLUDED
#ifndef SIZE_MAX
# define SIZE_MAX (~(size_t)0)
#endif
/*
* Deduce the type assignments from limits.h under the assumption that
* integer sizes in bits are powers of 2, and follow the ANSI
* definitions.
*/
#ifndef UINT8_MAX
# define UINT8_MAX 0xff
#endif
#ifndef uint8_t
# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
typedef unsigned char uint8_t;
# define UINT8_C(v) ((uint8_t) v)
# else
# error "Platform not supported"
# endif
#endif
#ifndef INT8_MAX
# define INT8_MAX 0x7f
#endif
#ifndef INT8_MIN
# define INT8_MIN INT8_C(0x80)
#endif
#ifndef int8_t
# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
typedef signed char int8_t;
# define INT8_C(v) ((int8_t) v)
# else
# error "Platform not supported"
# endif
#endif
#ifndef UINT16_MAX
# define UINT16_MAX 0xffff
#endif
#ifndef uint16_t
#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
typedef unsigned int uint16_t;
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER ""
# endif
# define UINT16_C(v) ((uint16_t) (v))
#elif (USHRT_MAX == UINT16_MAX)
typedef unsigned short uint16_t;
# define UINT16_C(v) ((uint16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef INT16_MAX
# define INT16_MAX 0x7fff
#endif
#ifndef INT16_MIN
# define INT16_MIN INT16_C(0x8000)
#endif
#ifndef int16_t
#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
typedef signed int int16_t;
# define INT16_C(v) ((int16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER ""
# endif
#elif (SHRT_MAX == INT16_MAX)
typedef signed short int16_t;
# define INT16_C(v) ((int16_t) (v))
# ifndef PRINTF_INT16_MODIFIER
# define PRINTF_INT16_MODIFIER "h"
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef UINT32_MAX
# define UINT32_MAX (0xffffffffUL)
#endif
#ifndef uint32_t
#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
typedef unsigned long uint32_t;
# define UINT32_C(v) v ## UL
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
#elif (UINT_MAX == UINT32_MAX)
typedef unsigned int uint32_t;
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
# define UINT32_C(v) v ## U
#elif (USHRT_MAX == UINT32_MAX)
typedef unsigned short uint32_t;
# define UINT32_C(v) ((unsigned short) (v))
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#else
#error "Platform not supported"
#endif
#endif
#ifndef INT32_MAX
# define INT32_MAX (0x7fffffffL)
#endif
#ifndef INT32_MIN
# define INT32_MIN INT32_C(0x80000000)
#endif
#ifndef int32_t
#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
typedef signed long int32_t;
# define INT32_C(v) v ## L
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER "l"
# endif
#elif (INT_MAX == INT32_MAX)
typedef signed int int32_t;
# define INT32_C(v) v
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#elif (SHRT_MAX == INT32_MAX)
typedef signed short int32_t;
# define INT32_C(v) ((short) (v))
# ifndef PRINTF_INT32_MODIFIER
# define PRINTF_INT32_MODIFIER ""
# endif
#else
#error "Platform not supported"
#endif
#endif
/*
* The macro stdint_int64_defined is temporarily used to record
* whether or not 64 integer support is available. It must be
* defined for any 64 integer extensions for new platforms that are
* added.
*/
#undef stdint_int64_defined
#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
# if (__STDC__ && __STDC_VERSION >= 199901L) || defined (S_SPLINT_S)
# define stdint_int64_defined
typedef long long int64_t;
typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# endif
#endif
#if !defined (stdint_int64_defined)
# if defined(__GNUC__)
# define stdint_int64_defined
__extension__ typedef long long int64_t;
__extension__ typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
# define stdint_int64_defined
typedef long long int64_t;
typedef unsigned long long uint64_t;
# define UINT64_C(v) v ## ULL
# define INT64_C(v) v ## LL
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "ll"
# endif
# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
# define stdint_int64_defined
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
# define UINT64_C(v) v ## UI64
# define INT64_C(v) v ## I64
# ifndef PRINTF_INT64_MODIFIER
# define PRINTF_INT64_MODIFIER "I64"
# endif
# endif
#endif
#if !defined (LONG_LONG_MAX) && defined (INT64_C)
# define LONG_LONG_MAX INT64_C (9223372036854775807)
#endif
#ifndef ULONG_LONG_MAX
# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
#endif
#if !defined (INT64_MAX) && defined (INT64_C)
# define INT64_MAX INT64_C (9223372036854775807)
#endif
#if !defined (INT64_MIN) && defined (INT64_C)
# define INT64_MIN INT64_C (-9223372036854775808)
#endif
#if !defined (UINT64_MAX) && defined (INT64_C)
# define UINT64_MAX UINT64_C (18446744073709551615)
#endif
/*
* Width of hexadecimal for number field.
*/
#ifndef PRINTF_INT64_HEX_WIDTH
# define PRINTF_INT64_HEX_WIDTH "16"
#endif
#ifndef PRINTF_INT32_HEX_WIDTH
# define PRINTF_INT32_HEX_WIDTH "8"
#endif
#ifndef PRINTF_INT16_HEX_WIDTH
# define PRINTF_INT16_HEX_WIDTH "4"
#endif
#ifndef PRINTF_INT8_HEX_WIDTH
# define PRINTF_INT8_HEX_WIDTH "2"
#endif
#ifndef PRINTF_INT64_DEC_WIDTH
# define PRINTF_INT64_DEC_WIDTH "20"
#endif
#ifndef PRINTF_INT32_DEC_WIDTH
# define PRINTF_INT32_DEC_WIDTH "10"
#endif
#ifndef PRINTF_INT16_DEC_WIDTH
# define PRINTF_INT16_DEC_WIDTH "5"
#endif
#ifndef PRINTF_INT8_DEC_WIDTH
# define PRINTF_INT8_DEC_WIDTH "3"
#endif
/*
* Ok, lets not worry about 128 bit integers for now. Moore's law says
* we don't need to worry about that until about 2040 at which point
* we'll have bigger things to worry about.
*/
#ifdef stdint_int64_defined
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
# define INTMAX_MAX INT64_MAX
# define INTMAX_MIN INT64_MIN
# define UINTMAX_MAX UINT64_MAX
# define UINTMAX_C(v) UINT64_C(v)
# define INTMAX_C(v) INT64_C(v)
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
# endif
#else
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
# define INTMAX_MAX INT32_MAX
# define UINTMAX_MAX UINT32_MAX
# define UINTMAX_C(v) UINT32_C(v)
# define INTMAX_C(v) INT32_C(v)
# ifndef PRINTF_INTMAX_MODIFIER
# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
# endif
# ifndef PRINTF_INTMAX_HEX_WIDTH
# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
# endif
# ifndef PRINTF_INTMAX_DEC_WIDTH
# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
# endif
#endif
/*
* Because this file currently only supports platforms which have
* precise powers of 2 as bit sizes for the default integers, the
* least definitions are all trivial. Its possible that a future
* version of this file could have different definitions.
*/
#ifndef stdint_least_defined
typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
# define UINT_LEAST8_MAX UINT8_MAX
# define INT_LEAST8_MAX INT8_MAX
# define UINT_LEAST16_MAX UINT16_MAX
# define INT_LEAST16_MAX INT16_MAX
# define UINT_LEAST32_MAX UINT32_MAX
# define INT_LEAST32_MAX INT32_MAX
# define INT_LEAST8_MIN INT8_MIN
# define INT_LEAST16_MIN INT16_MIN
# define INT_LEAST32_MIN INT32_MIN
# ifdef stdint_int64_defined
typedef int64_t int_least64_t;
typedef uint64_t uint_least64_t;
# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
# define UINT_LEAST64_MAX UINT64_MAX
# define INT_LEAST64_MAX INT64_MAX
# define INT_LEAST64_MIN INT64_MIN
# endif
#endif
#undef stdint_least_defined
/*
* The ANSI C committee pretending to know or specify anything about
* performance is the epitome of misguided arrogance. The mandate of
* this file is to *ONLY* ever support that absolute minimum
* definition of the fast integer types, for compatibility purposes.
* No extensions, and no attempt to suggest what may or may not be a
* faster integer type will ever be made in this file. Developers are
* warned to stay away from these types when using this or any other
* stdint.h.
*/
typedef int_least8_t int_fast8_t;
typedef uint_least8_t uint_fast8_t;
typedef int_least16_t int_fast16_t;
typedef uint_least16_t uint_fast16_t;
typedef int_least32_t int_fast32_t;
typedef uint_least32_t uint_fast32_t;
#define UINT_FAST8_MAX UINT_LEAST8_MAX
#define INT_FAST8_MAX INT_LEAST8_MAX
#define UINT_FAST16_MAX UINT_LEAST16_MAX
#define INT_FAST16_MAX INT_LEAST16_MAX
#define UINT_FAST32_MAX UINT_LEAST32_MAX
#define INT_FAST32_MAX INT_LEAST32_MAX
#define INT_FAST8_MIN INT_LEAST8_MIN
#define INT_FAST16_MIN INT_LEAST16_MIN
#define INT_FAST32_MIN INT_LEAST32_MIN
#ifdef stdint_int64_defined
typedef int_least64_t int_fast64_t;
typedef uint_least64_t uint_fast64_t;
# define UINT_FAST64_MAX UINT_LEAST64_MAX
# define INT_FAST64_MAX INT_LEAST64_MAX
# define INT_FAST64_MIN INT_LEAST64_MIN
#endif
#undef stdint_int64_defined
/*
* Whatever piecemeal, per compiler thing we can do about the wchar_t
* type limits.
*/
#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__)
# include <wchar.h>
# ifndef WCHAR_MIN
# define WCHAR_MIN 0
# endif
# ifndef WCHAR_MAX
# define WCHAR_MAX ((wchar_t)-1)
# endif
#endif
/*
* Whatever piecemeal, per compiler/platform thing we can do about the
* (u)intptr_t types and limits.
*/
#if defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)
# define STDINT_H_UINTPTR_T_DEFINED
#endif
#ifndef STDINT_H_UINTPTR_T_DEFINED
# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64)
# define stdint_intptr_bits 64
# elif defined (__WATCOMC__) || defined (__TURBOC__)
# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
# define stdint_intptr_bits 16
# else
# define stdint_intptr_bits 32
# endif
# elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
# define stdint_intptr_bits 32
# elif defined (__INTEL_COMPILER)
/* TODO -- what will Intel do about x86-64? */
# endif
# ifdef stdint_intptr_bits
# define stdint_intptr_glue3_i(a,b,c) a##b##c
# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
# ifndef PRINTF_INTPTR_MODIFIER
# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
# endif
# ifndef PTRDIFF_MAX
# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
# endif
# ifndef PTRDIFF_MIN
# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
# endif
# ifndef UINTPTR_MAX
# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
# endif
# ifndef INTPTR_MAX
# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
# endif
# ifndef INTPTR_MIN
# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
# endif
# ifndef INTPTR_C
# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
# endif
# ifndef UINTPTR_C
# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
# endif
typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
# else
/* TODO -- This following is likely wrong for some platforms, and does
nothing for the definition of uintptr_t. */
typedef ptrdiff_t intptr_t;
# endif
# define STDINT_H_UINTPTR_T_DEFINED
#endif
/*
* Assumes sig_atomic_t is signed and we have a 2s complement machine.
*/
#ifndef SIG_ATOMIC_MAX
# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
#endif
#endif
#if defined (__TEST_PSTDINT_FOR_CORRECTNESS)
/*
* Please compile with the maximum warning settings to make sure macros are not
* defined more than once.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define glue3_aux(x,y,z) x ## y ## z
#define glue3(x,y,z) glue3_aux(x,y,z)
#define DECLU(bits) glue3(uint,bits,_t) glue3(u,bits,=) glue3(UINT,bits,_C) (0);
#define DECLI(bits) glue3(int,bits,_t) glue3(i,bits,=) glue3(INT,bits,_C) (0);
#define DECL(us,bits) glue3(DECL,us,) (bits)
#define TESTUMAX(bits) glue3(u,bits,=) glue3(~,u,bits); if (glue3(UINT,bits,_MAX) glue3(!=,u,bits)) printf ("Something wrong with UINT%d_MAX\n", bits)
int main () {
DECL(I,8)
DECL(U,8)
DECL(I,16)
DECL(U,16)
DECL(I,32)
DECL(U,32)
#ifdef INT64_MAX
DECL(I,64)
DECL(U,64)
#endif
intmax_t imax = INTMAX_C(0);
uintmax_t umax = UINTMAX_C(0);
char str0[256], str1[256];
sprintf (str0, "%d %x\n", 0, ~0);
sprintf (str1, "%d %x\n", i8, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i8 : %s\n", str1);
sprintf (str1, "%u %x\n", u8, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with u8 : %s\n", str1);
sprintf (str1, "%d %x\n", i16, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i16 : %s\n", str1);
sprintf (str1, "%u %x\n", u16, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with u16 : %s\n", str1);
sprintf (str1, "%" PRINTF_INT32_MODIFIER "d %x\n", i32, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i32 : %s\n", str1);
sprintf (str1, "%" PRINTF_INT32_MODIFIER "u %x\n", u32, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with u32 : %s\n", str1);
#ifdef INT64_MAX
sprintf (str1, "%" PRINTF_INT64_MODIFIER "d %x\n", i64, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with i64 : %s\n", str1);
#endif
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "d %x\n", imax, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with imax : %s\n", str1);
sprintf (str1, "%" PRINTF_INTMAX_MODIFIER "u %x\n", umax, ~0);
if (0 != strcmp (str0, str1)) printf ("Something wrong with umax : %s\n", str1);
TESTUMAX(8);
TESTUMAX(16);
TESTUMAX(32);
#ifdef INT64_MAX
TESTUMAX(64);
#endif
return EXIT_SUCCESS;
}
#endif

View File

@@ -0,0 +1,45 @@
/* Copyright (c) 2014 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Also usable with Pure C */
#ifndef ROTATE_H
#define ROTATE_H
#if __COLDFIRE__
/* rotate macros for Coldfire compatible code */
#define __rorb(a,n) (((unsigned char)a>>n)|((unsigned char)a<<((sizeof(a)*8)-n)))
#define __ror (a,n) (((unsigned int)a>>n)|((unsigned int)a<<((sizeof(a)*8)-n)))
#define __rorl(a,n) (((unsigned long)a>>n)|((unsigned long)a<<((sizeof(a)*8)-n)))
#define __rolb(a,n) (((unsigned char)a<<n)|((unsigned char)a>>((sizeof(a)*8)-n)))
#define __rol (a,n) (((unsigned int)a<<n)|((unsigned int)a>>((sizeof(a)*8)-n)))
#define __roll(a,n) (((unsigned long)a<<n)|((unsigned long)a>>((sizeof(a)*8)-n)))
#else
/* rotate macros for M68K code */
int rorb(char a, int n) 0161070;
int ror (int a, int n) 0161170;
int rorl(long a, int n) 0161270;
int rolb(char a, int n) 0161470;
int rol (int a, int n) 0161570;
int roll(long a, int n) 0161670;
#endif
#endif

View File

@@ -0,0 +1,143 @@
/********************************/
/* file scancode.h */
/* Holger Weets & Frank Specht */
/* letzte Aenderung: 28.01.90 */
/* back to UK HR: 15.04.92 */
/********************************/
#ifndef __SCANCODE_H
#define __SCANCODE_H
typedef enum
{
CNTRL_A = 0x1e01,
CNTRL_B = 0x3002,
CNTRL_C = 0x2e03,
CNTRL_D = 0x2004,
CNTRL_E = 0x1205,
CNTRL_F = 0x2106,
CNTRL_G = 0x2207,
CNTRL_H = 0x2308,
CNTRL_I = 0x1709,
CNTRL_J = 0x240a,
CNTRL_K = 0x250b,
CNTRL_L = 0x260c,
CNTRL_M = 0x320d,
CNTRL_N = 0x310e,
CNTRL_O = 0x180f,
CNTRL_P = 0x1910,
CNTRL_Q = 0x1011,
CNTRL_R = 0x1312,
CNTRL_S = 0x1f13,
CNTRL_T = 0x1414,
CNTRL_U = 0x1615,
CNTRL_V = 0x2f16,
CNTRL_W = 0x1117,
CNTRL_X = 0x2d18,
CNTRL_Y = 0x1519, /* 4'92 */
CNTRL_Z = 0x2c1a, /* 4'92 */
CNTRL_AE = 0X2804,
CNTRL_OE = 0x2714,
CNTRL_UE = 0x1a01,
CNTRL_1 = 0x0211,
CNTRL_2 = 0x0300,
CNTRL_3 = 0x0413,
CNTRL_4 = 0x0514,
CNTRL_5 = 0x0615,
CNTRL_6 = 0x071e,
CNTRL_7 = 0x0817,
CNTRL_8 = 0x0918,
CNTRL_9 = 0x0a19,
CNTRL_0 = 0x0b10,
CNTRL_CL = 0x7300,
CNTRL_CR = 0x7400,
CNTRL_HOME = 0x7700,
CNTRL_DEL = 0x531F,
CNTRL_SP = 0x3900,
ALT_A = 0x1e00,
ALT_B = 0x3000,
ALT_C = 0x2e00,
ALT_D = 0x2000,
ALT_E = 0x1200,
ALT_F = 0x2100,
ALT_G = 0x2200,
ALT_H = 0x2300,
ALT_I = 0x1700,
ALT_J = 0x2400,
ALT_K = 0x2500,
ALT_L = 0x2600,
ALT_M = 0x3200,
ALT_N = 0x3100,
ALT_O = 0x1800,
ALT_P = 0x1900,
ALT_Q = 0x1000,
ALT_R = 0x1300,
ALT_S = 0x1f00,
ALT_T = 0x1400,
ALT_U = 0x1600,
ALT_V = 0x2f00,
ALT_W = 0x1100,
ALT_X = 0x2d00,
ALT_Y = 0x2c00,
ALT_Z = 0x1500,
ALT_AE = 0x285d,
ALT_OE = 0x275b,
ALT_UE = 0x1a40,
ALT_1 = 0x7800, /* ab TOS x.06 allein alpha blok */
ALT_2 = 0x7900,
ALT_3 = 0x7a00,
ALT_4 = 0x7b00,
ALT_5 = 0x7c00,
ALT_6 = 0x7d00,
ALT_7 = 0x7e00,
ALT_8 = 0x7f00,
ALT_9 = -0x8000,
ALT_0 = -0x7f00,
SH_ALT_AE = 0x287d,
SH_ALT_OE = 0x277b,
SH_ALT_UE = 0x1a5c,
ESCAPE = 0x011b,
BACKSPACE = 0x0e08,
DELETE = 0x537f,
INSERT = 0x5200,
SHFT_INS = 0x5230,
RETURN = 0x1c0d,
ENTER = 0x720d,
CUR_UP = 0x4800,
SHFT_CU = 0x4838,
CUR_LEFT = 0x4b00,
SHFT_CL = 0x4b34,
CUR_RIGHT = 0x4d00,
SHFT_CR = 0x4d36,
CUR_DOWN = 0x5000,
SHFT_CD = 0x5032,
HOME = 0x4700,
SHFT_HOME = 0x4737,
UNDO = 0x6100,
TAB = 0x0f09,
HELP = 0x6200,
F1 = 0x3b00,
SHFT_F1 = 0x5400,
F2 = 0x3c00,
SHFT_F2 = 0x5500,
F3 = 0x3d00,
SHFT_F3 = 0x5600,
F4 = 0x3e00,
SHFT_F4 = 0x5700,
F5 = 0x3f00,
SHFT_F5 = 0x5800,
F6 = 0x4000,
SHFT_F6 = 0x5900,
F7 = 0x4100,
SHFT_F7 = 0x5a00,
F8 = 0x4200,
SHFT_F8 = 0x5b00,
F9 = 0x4300,
SHFT_F9 = 0x5c00,
F10 = 0x4400,
SHFT_F10 = 0x5d00
} SCANCODE;
#endif

View File

@@ -0,0 +1,36 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef _SETJMP_H
#define _SETJMP_H 1
#ifdef __68881__
typedef long jmp_buf[14 + 15]; /* retaddr, 12 regs, sigmask fpu state */
#else
typedef long jmp_buf[14]; /* retaddr, 12 regs, sigmask */
#endif
typedef jmp_buf sigjmp_buf;
long sigsetjmp (sigjmp_buf env, long savemask);
long siglongjmp (sigjmp_buf env, long val);
short setjmp (jmp_buf);
void longjmp (jmp_buf, short);
#endif /* _SETJMP_H */

View File

@@ -0,0 +1,145 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef _SIGNAL_H
#define _SIGNAL_H
#define __NSIG 32 /* number of signals recognized */
enum
{
SIGNULL, /* not really a signal */
SIGHUP, /* hangup signal */
SIGINT, /* sent by ^C */
SIGQUIT, /* quit signal */
SIGILL, /* illegal instruction */
SIGTRAP, /* trace trap */
SIGABRT, /* abort signal */
SIGIOT = SIGABRT,
SIGPRIV, /* privilege violation */
SIGEMT = SIGPRIV,
SIGFPE, /* divide by zero */
SIGKILL, /* cannot be ignored */
SIGBUS, /* bus error */
SIGSEGV, /* illegal memory reference */
SIGSYS, /* bad argument to a system call */
SIGPIPE, /* broken pipe */
SIGALRM, /* alarm clock */
SIGTERM, /* software termination signal */
SIGURG, /* urgent condition on I/O channel */
SIGSTOP, /* stop signal not from terminal */
SIGTSTP, /* stop signal from terminal */
SIGCONT, /* continue stopped process */
SIGCHLD, /* child stopped or exited */
SIGTTIN, /* read by background process */
SIGTTOU, /* write by background process */
SIGIO, /* I/O possible on a descriptor */
SIGXCPU, /* CPU time exhausted */
SIGXFSZ, /* file size limited exceeded */
SIGVTALRM, /* virtual timer alarm */
SIGPROF, /* profiling timer expired */
SIGWINCH, /* window size changed */
SIGUSR1, /* user signal 1 */
SIGUSR2, /* user signal 2 */
SIGPWR, /* power failure (restart) */
NSIG
};
#ifndef BADSIG
#define BADSIG SIG_ERR
#endif
typedef void cdecl (*__Sigfunc) (short signum);
typedef short sig_atomic_t;
#define SIG_DFL ((__Sigfunc)0L)
#define SIG_IGN ((__Sigfunc)1L)
#define SIG_ERR ((__Sigfunc)-1L)
#define SignalBad SIG_ERR
#define SignalDefault SIG_DFL
#define SignalIgnore SIG_IGN
__Sigfunc signal (short sig, __Sigfunc func);
__Sigfunc __signal (short sig, __Sigfunc func);
short raise (short sig);
short kill (short, short);
short __kill (short, short);
short killpg (short, short);
short __killpg (short, short);
#define _SIGSET_INDEX(__sig) (__sig / 32)
#define _SIGSET_BITPOS(__sig) (__sig % 32)
#define _SIGSET_MAX_INDEX (__NSIG / 32)
typedef struct
{
long __sigset_data[_SIGSET_MAX_INDEX + 1];
} sigset_t;
#ifdef __MINT__
struct sigaction
{
__Sigfunc sa_handler; /* pointer to signal handler */
sigset_t sa_mask; /* additional signals masked during delivery */
short sa_flags; /* signal specific flags */
/* signal flags */
#define SA_NOCLDSTOP 1 /* don't send SIGCHLD when they stop */
};
#ifdef __USE_BSD
#ifdef __MSHORT__
long sigsetmask (long mask);
long __sigsetmask (long mask);
long sigblock (long mask);
long __sigblock (long mask);
#else
short sigsetmask (long mask);
short __sigsetmask (long mask);
short sigblock (long mask);
short __sigblock (long mask);
#endif
/* a mask for signals */
#define sigmask(__sig) (1L << (__sig))
#endif /* BSD */
short sigaction (short, const struct sigaction *, struct sigaction *);
short __sigaction (short, const struct sigaction *, struct sigaction *);
short sigaddset (sigset_t *set, short signo);
short sigdelset (sigset_t *set, short signo);
short sigemptyset (sigset_t *set);
short sigfillset (sigset_t *set);
short sigismember (sigset_t *set, short signo);
void sigpause (long mask);
void __sigpause (long mask);
short sigpending (sigset_t *set);
short __sigpending (sigset_t *set);
short sigprocmask (short how, const sigset_t *set, sigset_t *oset);
void sigreturn (void);
void __sigreturn (void);
short sigsuspend (const sigset_t *sigmask);
/* values for "how" parameter to sigprocmask() */
#define SIG_BLOCK 0
#define SIG_UNBLOCK 1
#define SIG_SETMASK 2
#endif /* __MINT__ */
#endif /* _SIGNAL_H */

View File

@@ -0,0 +1,35 @@
/*
* STAT.H
*/
#ifndef STAT_H
#define STAT_H
#include <types.h>
struct stat /* maps to the DTA up to the st_name field */
{
char st_rsvd[21]; /* reserved field. DON'T TOUCH! */
uchar st_mode; /* file mode flags */
time_t st_mtime; /* last modification time/date */
long st_size; /* file size in bytes */
char st_name[14]; /* file name */
dev_t st_dev; /* drive id (0 == A:) */
uchar st_nlink; /* number of links (always == 1) */
};
#define st_atime st_mtime /* last access time */
#define st_ctime st_mtime /* creation time */
#define st_rdev st_dev /* drive id */
#define S_IFMT 0xD6 /* mask for type of file */
#define S_IFHID 0x02 /* hidden */
#define S_IFSYS 0x04 /* system */
#define S_IFDIR 0x10 /* directory */
#define S_IREAD 0x40 /* read permission */
#define S_IWRITE 0x80 /* write permission */
#define S_ISRO 0x01 /* file is read-only */
#define S_ISVOL 0x08 /* file is volume label */
#define S_ISARC 0x20 /* file is written to and closed? */
#endif STAT_H

View File

@@ -0,0 +1,23 @@
/* STDARG.H
Parameter List Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined(__STDARG)
#define __STDARG
typedef char * va_list;
#define va_start(ap, parmN) ((ap) = (char *)...)
#define va_arg(ap, type) \
((sizeof(type) == 1) ? \
(*(type *)((ap += 2) - 1)) : \
(*((type *)(ap))++))
#define va_end(ap) (void)0
#endif

View File

@@ -0,0 +1,43 @@
/* (c) 1991-2008 by H. Robbers te Amsterdam
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if ! __bool_true_false_are_defined /* always defined by AHCC itself */
typedef enum
{
false = 0,
true
} _Bool, bool;
# define __bool_true_false_are_defined 1
#elif __AHCC__
/* AHCC has builtin boolean constants 'false' and 'true'.
and basic boolean type _Bool (C99) */
typedef _Bool bool;
#endif
#if ! defined FALSE
# define FALSE false
# define TRUE true
#endif

View File

@@ -0,0 +1,41 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined( __STDDEF )
#define __STDDEF
typedef unsigned long size_t;
#ifndef _COMPILER_H
typedef unsigned long __SIZE_TYPEDEF__;
#endif
typedef long ptrdiff_t;
#define _SIZE_T
#if __AHCC__
#define offsetof(type, ident) __offsetof__ type.ident
#else
#define offsetof(type,ident) ((size_t)&(((type *)0)->ident))
#endif
/* test autodepend: change this line */
#ifndef NULL
#define NULL 0L
#endif
#endif

View File

@@ -0,0 +1,145 @@
/*
* ISO C99: Integer types <stdint.h> for Pure C and AHCC
* based on stdint.h from GCC
*
* adapted to Pure C by Simon Sunnyboy / Paradize <marndt@asmsoftware.de>
*
* limitations: no 64 bit datatypes
*/
#ifndef __PUREC__
#error Pure C and AHCC only!
#endif
#ifndef _STDINT_H
#define _STDINT_H 1
/* Exact integral types */
/* Signed. */
typedef signed char int8_t;
#ifndef __AHCC__
typedef int int16_t;
#else
#if __MSHORT__
typedef int int16_t;
#else
typedef short int16_t;
#endif
#endif
typedef long int32_t;
/* Unsigned. */
typedef unsigned char uint8_t;
#ifndef __AHCC__
typedef unsigned int uint16_t;
#else
#if __MSHORT__
typedef unsigned int uint16_t;
#else
typedef unsigned short uint16_t;
#endif
#endif
typedef unsigned long uint32_t;
/* Small types. */
/* Signed. */
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
/* Unsigned. */
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
/* Fast types. */
/* Signed. */
typedef int int_fast8_t;
#ifndef __AHCC__
typedef int int_fast16_t;
#else
#if __MSHORT__
typedef int int_fast16_t;
#else
typedef short int_fast16_t;
#endif
#endif
typedef long int_fast32_t;
/* Unsigned. */
typedef unsigned int uint_fast8_t;
#ifndef __AHCC__
typedef int uint_fast16_t;
#else
#if __MSHORT__
typedef int uint_fast16_t;
#else
typedef short uint_fast16_t;
#endif
#endif
typedef unsigned int uint_fast32_t;
/* Types for `void *' pointers. */
typedef int intptr_t;
typedef unsigned int uintptr_t;
/* Limits of integral types. */
/* Minimum of signed integral types. */
# define INT8_MIN (-128)
# define INT16_MIN (-32767-1)
# define INT32_MIN (-2147483647-1)
/* Maximum of signed integral types. */
# define INT8_MAX (127)
# define INT16_MAX (32767)
# define INT32_MAX (2147483647)
/* Maximum of unsigned integral types. */
# define UINT8_MAX (255)
# define UINT16_MAX (65535)
# define UINT32_MAX (4294967295U)
/* Minimum of signed integral types having a minimum size. */
# define INT_LEAST8_MIN INT8_MIN
# define INT_LEAST16_MIN INT16_MIN
# define INT_LEAST32_MIN INT32_MIN
/* Maximum of signed integral types having a minimum size. */
# define INT_LEAST8_MAX INT8_MAX
# define INT_LEAST16_MAX INT16_MAX
# define INT_LEAST32_MAX INT32_MAX
/* Maximum of unsigned integral types having a minimum size. */
# define UINT_LEAST8_MAX (255)
# define UINT_LEAST16_MAX (65535)
# define UINT_LEAST32_MAX (4294967295U)
/* Minimum of fast signed integral types having a minimum size. */
# define INT_FAST8_MIN INT8_MIN
# define INT_FAST16_MIN INT16_MIN
# define INT_FAST32_MIN INT32_MIN
/* Maximum of fast signed integral types having a minimum size. */
# define INT_FAST8_MAX (127)
# define INT_FAST16_MAX (32767)
# define INT_FAST32_MAX (2147483647)
/* Maximum of fast unsigned integral types having a minimum size. */
# define UINT_FAST8_MAX (255)
# define INTPTR_MIN INT16_MIN
# define INTPTR_MAX INT16_MAX
# define UINTPTR_MAX UINT16_MAX
# define SIZE_MAX (4294967295U)
#endif /* stdint.h */

View File

@@ -0,0 +1,223 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* stdio.h */
#if !defined( __STDIO_H_ )
#define __STDIO_H_
#include <stdarg.h>
#if !defined( __STDDEF )
#include <stddef.h>
#endif
typedef unsigned long fpos_t;
#include <errno.h>
/* old
typedef struct
{
short _cnt; /* # of bytes in buffer */
unsigned char *_ptr; /* current buffer pointer */
unsigned char *_base; /* base of file buffer */
unsigned short _flag; /* file status flags */
short _file; /* file handle */
size_t _bsiz; /* buffer size */
unsigned char _ch; /* tiny buffer, for "unbuffered" i/o */
}
FILE;
*/
/* Try to make Pure C and AHCC FILE structure alike */
typedef struct
{
unsigned char *BufPtr; /* current buffer pointer */
long _cnt; /* # of bytes in buffer */
unsigned char *BufStart; /* base of file buffer */
size_t _bsiz; /* buffer size */
short Handle; /* file handle */
unsigned char Flags,Mode; /* file status flags, file mode */
unsigned char ChrBuf; /* tiny buffer, for "unbuffered" i/o */
char ungetFlag;
}
FILE;
typedef short InFunc(void *ip);
typedef short OutFunc(char c, void *op);
typedef short UnFunc(short c, void *ip);
/****** FileIo constants ************************************************/
#define OPEN_MAX 32
#define FOPEN_MAX 32
#define FILENAME_MAX 128
#define PATH_MAX 132
#define BUFSIZ 1024
#define EOF (-1) /* end of file */
#undef EOS
#define EOS '\0' /* end-of-string indicator */
#define O_RDONLY 0x00
#define O_WRONLY 0x01
#define O_RDWR 0x02
#define O_APPEND 0x08
#define O_CREAT 0x20
#define O_TRUNC 0x40
#define O_EXCL 0x80
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define TMP_MAX 65535
#define L_tmpnam 13
/* Mode flags */
#define _IOFBF 0 /* full buffering */
#define _IOLBF 1 /* line buffering */
#define _IONBF 2 /* no buffering */
extern FILE _iob[];
/* standard streams */
#define stdin (&_StdInF)
#define stdout (&_StdOutF)
#define stderr (&_StdErrF)
#define stdprn (&_StdPrnF)
#define stdaux (&_StdAuxF)
/* External data */
extern FILE _StdInF;
extern FILE _StdOutF;
extern FILE _StdErrF;
extern FILE _StdPrnF;
extern FILE _StdAuxF;
/* StreamIO routines */
FILE * fopen ( const char *filename, const char *mo );
FILE * freopen ( const char *filename, const char *mo, FILE *stream );
FILE * tmpfile ( void );
void clearerr ( FILE *stream );
short fclose ( FILE *stream );
short feof ( FILE *stream );
short ferror ( FILE *stream );
short fflush ( FILE *stream );
short fgetc ( FILE *stream );
short fgetpos ( FILE *stream, fpos_t *pos );
short fprintf ( FILE *stream, const char *format, ... );
short d_fprintf ( FILE *stream, const char *format, ... );
short fscanf ( FILE *stream, const char *format, ... );
short fseek ( FILE *stream, long offset, short mo );
void rewind ( FILE *stream);
short fsetpos ( FILE *stream, const fpos_t *pos );
long ftell ( FILE *stream );
void setbuf ( FILE *stream, void *buf );
short setvbuf ( FILE *stream, void *, short , size_t );
short vfprintf ( FILE *stream, const char *format, va_list param );
short vfscanf ( FILE *stream, const char *format, va_list param );
short fileno ( FILE *stream );
size_t fread ( void *buf, size_t elem_Siz, size_t count,
FILE *stream );
char * fgets ( char *str, short n,
FILE *stream );
size_t fwrite ( const void *buf, size_t elem_Siz, size_t count,
FILE *stream );
short fputc ( short ch,
FILE *stream );
short fputs ( const char *str,
FILE *stream );
/* other IO routines */
char * gets ( char *str );
void perror ( char *s );
void perrorf (char *fmt, ...);
short d_printf ( const char *format, ... ); /* HR used when debugging */
short printf ( const char *format, ... );
short puts ( const char *str );
short scanf ( const char *format, ... );
short sprintf ( char *string, const char *format, ... );
short sscanf ( const char *string, const char *format, ... );
char * tmpnam ( char *s );
short vprintf ( const char *format, va_list param );
short vsprintf ( char *string, const char *format, va_list param );
short vscanf ( const char *format, va_list param );
short vsscanf ( char *string, const char *format, va_list param );
/* FileIo macros */
#define getc( c ) fgetc( c )
#define getchar() fgetc( stdin )
#define ungetchar( c) fungetc(c, stdin)
#define putc( c, s ) fputc( c, s )
#define putchar( c ) fputc( c, stdout )
#define exists(f ) access( f, 0x00 )
/* GEMDOS Handle level FileIO routines */
short open ( const char *filename, short access, ... );
short close ( short handle );
short creat ( const char *filename, ...);
size_t read ( short handle, void *buf, size_t nbyte );
size_t write ( short handle, const void *buf, size_t nbyte );
size_t lseek ( short handle, size_t offset, short mo );
short remove ( const char *filename );
short unlink ( const char *filename );
short rename ( const char *oldname, const char *newname );
/* In dlibs, not in PC */
FILE * fopenp ( const char *filename, const char *mode );
FILE * fdopen ( short h, const char *mode );
char * fullpath ( char *full, const char *part );
char * findfile ( const char *afn, const char *ext );
char * pfindfile ( const char *path, const char *afn, const char *ext );
short fungetc ( short c, FILE *fp );
short ungetc ( short c, FILE *fp );
short cprintf ( const char *fmt, ... );
void cputs ( char *data );
short getw ( FILE *fp );
short putw ( short n, FILE *fp );
long getl ( FILE *fp);
long putl ( long n, FILE *fp );
size_t tell ( short h );
short rmdir ( const char *pathname );
short mkdir ( const char *pathname );
short dup ( short handle);
short dup2 ( short handle1, short handle2 );
short _tttty ( FILE *fp );
char *_splitpath
(
const char *src,
char *drive,
char *path,
char *file,
char *ext
);
short printf_dmode( short );
#ifndef ERROR
#define ERROR (-1) /* general error condition */
#endif
#endif

View File

@@ -0,0 +1,134 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* (c) by Henk Robbers <h.robbers@chello.nl> */
#if !defined( __STDLIB )
#define __STDLIB
#if !defined( __STDDEF )
#include <stddef.h>
#endif
#define EXIT_FAILURE !0
#define EXIT_SUCCESS 0
#define RAND_MAX 32767
typedef struct
{
short quot;
short rem;
} div_t;
typedef struct
{
long quot;
long rem;
} ldiv_t;
#ifndef __NO_FLOAT__
double atof( const char *str );
double myatof( const char *str );
char *ecvt( double d, short ndig, short *dec, short *sign );
char *fcvt( double d, short ndig, short *dec, short *sign );
char *gcvt( double value, short dec, char * buf );
double strtod( const char *s, const char **endptr );
#endif
short atoi( const char *str );
long atol( const char *str );
char *itoa( short value, char *string, short radix );
char *ltoa( long value, char *string, short radix );
char *ultoa( unsigned long value, char *string, short radix );
#if 0 /* __68020__ */
char *lltoa( long long value, char *string, short radix );
char *ulltoa( /* unsigned */ long long value, char *string, short radix );
#endif
short abs( short x );
long labs( long x );
div_t div( short n, short d );
ldiv_t ldiv( long n, long d );
short rand( void );
void srand( unsigned short seed );
#define random( x ) (rand() % (x))
long strtol( const char *str, const char **ptr, short base );
unsigned
long strtoul(const char *str, const char **ptr, short base );
short system( const char *command );
void exit( short status );
void abort( void );
short atexit( void (*func)( void ) );
char * getenv(const char *name);
short putenv(const char *entry);
typedef short StdCompare(const void * p1, const void *p2);
void * bsearch( const void *key, const void *base,
size_t nmemb, size_t size,
StdCompare *compar);
void * lsearch(void *key, void *base,
size_t *num, size_t size,
StdCompare *cmp);
void * lfind(void *key, void *base,
size_t *num, size_t size,
StdCompare *cmp);
void qsort( void *base,
size_t nmemb, size_t size,
StdCompare *compar);
void hsort( void *base,
size_t nmemb, size_t size,
StdCompare *compar);
char * ctlcnv(char *string);
short brk(void *address);
void * sbrk(size_t amount);
/*
/* maximum and minumum for any type of number */
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))
/* swap any objects which can be XORed */
#define swap(a,b) ((a)=(a)^((b)=(b)^((a)=(a)^(b))))
/* lo and hi byte of a word */
#define lobyte(x) (((unsigned char *)&(x))[1])
#define hibyte(x) (((unsigned char *)&(x))[0])
/* lo and hi word of a long */
#define loword(x) (((unsigned short *)&(x))[1])
#define hiword(x) (((unsigned short *)&(x))[0])
*/
#if ! defined (_XA_MEMORY_H)
#include <ahcm.h> /* HR: A home cooked memory allocator */
#endif
#endif

View File

@@ -0,0 +1,88 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* string.h */
#if !defined( __STRING )
#define __STRING
#if !defined( __STDDEF )
#include <stddef.h>
#endif
char * strcat ( char *s1, const char *s2 );
char * strncat ( char *s1, const char *s2, size_t n );
short strcmp ( const char *s1, const char *s2);
short stricmp ( const char *s1, const char *s2 );
short strcmpi ( const char *s1, const char *s2 );
short strncmp ( const char *s1, const char *s2, size_t n );
short strnicmp ( const char *s1, const char *s2, size_t n );
short strncmpi ( const char *s1, const char *s2, size_t n );
char * strcpy ( char *s1, const char *s2 );
char * strncpy ( char *s1, const char *s2, size_t n );
char * strdup ( const char *s );
size_t strlen ( const char *s );
char * strchr ( const char *s, short c );
char * strrchr ( const char *s, short c );
size_t strspn ( const char *s, const char *set );
size_t strcspn ( const char *s, const char *set );
char *strpbrk ( const char *s, const char *set );
char * strstr ( const char *src, const char *sub );
char * strtok ( char *str, const char *set );
char * strupr ( char *s );
char * strlwr ( char *s );
char * strrev ( char *s );
char * strset ( char *s, short c );
char * strnset ( char *s, short c, size_t n );
char * stradj (char *string, short dir);
char * strerror ( short errnum );
void * memchr ( const void *ptr, short val, size_t len );
short memcmp ( const void *ptr1, const void *ptr2, size_t len );
void * memcpy ( void *dest, const void *src, size_t len );
void * memmove ( void *dest, const void *src, size_t len );
void * memset ( void *ptr, short val, size_t len );
#define zero(x) memset(&(x), 0, sizeof(x))
#define pzero(x) memset(x, 0, sizeof(*(x)))
#define rzero(x) memset(x, 0, sizeof(x))
/* in dlibs, not in PC lib */
short memicmp ( const char *mem1, const char *mem2, size_t len );
void * memccpy ( char *dst, const char *src, const char c, short cnt );
char * stristr ( const char *string, const char *pattern);
short strirpl ( char *string,const char *ptrn, const char *rpl, short n);
short strrpl ( char *string, const char *ptrn, const char *rpl, short n);
char * strpcpy ( char *dest, char *start, char *e);
ptrdiff_t strpos ( char *string, char symbol);
ptrdiff_t strrpos ( char *string, char symbol);
char * strrpbrk ( const char *string, const char *set);
char * substr ( char *dest, char *source, size_t start, size_t e);
char * subnstr ( char *dest, char *source, size_t start, size_t length);
void swab ( char *src, char *dst, size_t n);
void * bzero ( void *dest, size_t len);
#endif

View File

@@ -0,0 +1,142 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* time.h */
#if !defined( __TIME )
#define __TIME
#ifndef PRELUDE_H
#include <prelude.h>
#endif
#define CLK_TCK 200
#define CLOCKS_PER_SEC CLK_TCK
#include <stddef.h>
typedef long time_t;
typedef long clock_t;
extern long timezone;
extern short daylight;
#ifndef HAVE_DOSTIME
typedef struct
{
unsigned short
time,
date;
} DOSTIME;
#define HAVE_DOSTIME 1
#endif
#ifndef HAVE_STRUCT_FT
struct date
{
short da_year; /* Current year */
char da_day, /* Day of the month */
da_mon; /* Month ( 1 = Jan ) */
};
struct time
{
unsigned char
min, /* Minutes */
hour, /* Hours */
hund, /* Hundredths of seconds */
sec; /* Seconds */
};
typedef
struct ftime
{
ubits ft_hour: 5;
ubits ft_min: 6;
ubits ft_tsec: 5;
ubits ft_year: 7;
ubits ft_month: 4;
ubits ft_day: 5;
};
#define HAVE_STRUCT_FT 1
#endif
typedef union
{
time_t tt;
DOSTIME dt;
struct
{
ubits hour: 5;
ubits min: 6;
ubits tsec: 5;
ubits year: 7;
ubits month: 4;
ubits day: 5;
} ft;
} FTIME;
struct tm
{
short tm_sec; /* seconds after the minute -- [0, 59] */
short tm_min; /* minutes after the hour -- [0, 59] */
short tm_hour; /* hours since midnight -- [0, 23] */
short tm_mday; /* day of the month -- [1, 31] */
short tm_mon; /* months since January -- [0, 11] */
short tm_year; /* years since 1900 -- [ ] */
short tm_wday; /* day since Sunday -- [0, 6] */
short tm_yday; /* day since January 1 -- [0, 365] */
short tm_isdst; /* daylight saving time flag */
};
typedef struct tm _TM;
#define asciitime asctime
char * asctime ( const struct tm *tblock );
char * ctime ( const time_t *timer );
struct tm * gmtime ( const time_t *clock );
struct tm * localtime( const time_t *clock );
time_t time ( time_t *timer );
time_t mktime ( struct tm *timeptr );
clock_t clock ( void );
size_t strftime( char *s, size_t max_size, const char *format,
const struct tm *timeptr );
#ifndef __NO_FLOAT__
double difftime( time_t time2, time_t time1 );
#endif
time_t ftimtosec(FTIME *ft);
void fttotm (_TM *t, FTIME *ft);
time_t date_and_time_to_seconds(_TM *t, short startyear);
_TM * seconds_to_date_and_time(time_t timer, _TM *t, short startyear);
void stime (time_t *rawtime);
short utime (char *pathname, time_t *rawtime);
clock_t start_timer(clock_t *t);
clock_t time_since(clock_t *t);
#endif

View File

@@ -0,0 +1,401 @@
/* TOS.H
Tos Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __TOS )
#define __TOS
#include <trap.h> /* AHCC: __syscall__ */
typedef struct /* used by Cconrs */
{
unsigned char maxlen;
unsigned char actuallen;
char buffer[255];
} LINE;
typedef struct /* used by Fsetdta, Fgetdta */
{
char d_reserved[21];
unsigned char d_attrib;
unsigned short d_time;
unsigned short d_date;
unsigned long d_length;
char d_fname[14];
} DTA;
typedef struct /* used by Dfree */
{
unsigned long b_free;
unsigned long b_total;
unsigned long b_secsiz;
unsigned long b_clsiz;
} DISKINFO;
typedef struct baspag /* used by Pexec */
{
void *p_lowtpa;
void *p_hitpa;
void *p_tbase;
long p_tlen;
void *p_dbase;
long p_dlen;
void *p_bbase;
long p_blen;
DTA *p_dta;
struct baspag *p_parent;
long p_resrvd0;
char *p_env;
char p_stdfh[6];
char p_resrvd1;
char p_curdrv;
long p_resrvd2[18];
char p_cmdlin[128];
} BASPAG;
typedef struct /* used by Getbpb */
{
short recsiz,
clsiz,
clsizb,
rdlen,
fsiz,
fatrec,
datrec,
numcl,
bflags;
short dntracks, /* HR 2'97 added */
dnsides,
dspc,
dspt,
dhidden;
long dserial;
} BPB;
#ifndef HAVE_DOSTIME
typedef struct
{
unsigned short time;
unsigned short date;
} DOSTIME;
#define HAVE_DOSTIME 1
#endif
typedef struct /* used by Iorec */
{
void *ibuf;
short ibufsiz;
short ibufhd;
short ibuftl;
short ibuflow;
short ibufhi;
} IOREC;
typedef struct /* used by Kbdvbase */
{
void (*kb_midivec)();
void (*kb_vkbderr)();
void (*kb_vmiderr)();
void (*kb_statvec)();
void (*kb_mousevec)();
void (*kb_clockvec)();
void (*kb_joyvec)();
void (*kb_midisys)();
void (*kb_kbdsys)();
} KBDVBASE;
typedef struct /* used by Pexec */
{
unsigned char length;
char command_tail[128];
} COMMAND;
typedef struct /* used by Initmouse */
{
char topmode;
char buttons;
char x_scale;
char y_scale;
short x_max;
short y_max;
short x_start;
short y_start;
} MOUSE;
typedef struct /* used by Prtblk */
{
void *pb_scrptr;
short pb_offset;
short pb_width;
short pb_height;
short pb_left;
short pb_right;
short pb_screz;
short pb_prrez;
void *pb_colptr;
short pb_prtype;
short pb_prport;
void *pb_mask;
} PBDEF;
typedef struct /* used by Keytbl */
{
char *unshift;
char *shift;
char *capslock;
} KEYTAB;
typedef struct __md
{
struct __md *m_link;
void *m_start;
long m_length;
BASPAG *m_own;
} MD;
typedef struct /* used by Getmpb */
{
MD *mp_mfl;
MD *mp_mal;
MD *mp_rover;
} MPB;
typedef struct
{
short (*Bconstat) ();
long (*Bconin) ();
short (*Bcostat) ();
void (*Bconout) ();
long (*Rsconf) ();
IOREC *iorec;
} MAPTAB;
typedef struct
{
MAPTAB *maptab;
short maptabsize;
} BCONMAP;
/* system variable _sysbase (0x4F2L) points to next structure */
typedef struct _syshdr
{
unsigned short os_entry; /* $00 BRA to reset handler */
unsigned short os_version; /* $02 TOS version number */
void *os_start; /* $04 -> reset handler */
struct _syshdr *os_base; /* $08 -> baseof OS */
void *os_membot; /* $0c -> end BIOS/GEMDOS/VDI ram usage */
void *os_rsv1; /* $10 << unused,reserved >> */
long *os_magic; /* $14 -> GEM memoryusage parm. block */
long os_gendat; /* $18 Date of system build($MMDDYYYY) */
short os_palmode; /* $1c OS configuration bits */
short os_gendatg; /* $1e DOS-format date of systembuild */
/*
The next three fields are only available in TOS versions 1.2 and
greater
*/
void *_root; /* $20 -> base of OS pool */
long *kbshift; /* $24 -> keyboard shift state variable */
BASPAG **_run; /* $28 -> GEMDOS PID of current process */
void *p_rsv2; /* $2c << unused, reserved >> */
} SYSHDR;
/* attributes for Fcreate/Fsfirst/Fsnext: */
#define FA_READONLY 0x01
#define FA_HIDDEN 0x02
#define FA_SYSTEM 0x04
#define FA_VOLUME 0x08
#define FA_SUBDIR 0x10
#define FA_ARCHIVE 0x20
/* Fopen modes: */
#define FO_READ 0
#define FO_WRITE 1
#define FO_RW 2
extern BASPAG *_BasPag;
extern long _PgmSize;
long TRAP( 1) gemdos( void, ... );
long TRAP(13) bios ( void, ... );
long TRAP(14) xbios ( void, ... );
/****** Tos *************************************************************/
void GEMDOS(0) Pterm0( void );
long GEMDOS(1) Cconin( void );
void GEMDOS(2) Cconout( short c );
short GEMDOS(3) Cauxin( void );
void GEMDOS(4) Cauxout( short c );
short GEMDOS(5) Cprnout( short c );
long GEMDOS(6) Crawio( short w );
long GEMDOS(7) Crawcin( void );
long GEMDOS(8) Cnecin( void );
short GEMDOS(9) Cconws( const char *buf );
void GEMDOS(10) Cconrs( LINE *buf );
short GEMDOS(11) Cconis( void );
long GEMDOS(14) Dsetdrv( short drv );
short GEMDOS(16) Cconos( void );
short GEMDOS(17) Cprnos( void );
short GEMDOS(18) Cauxis( void );
short GEMDOS(19) Cauxos( void );
short GEMDOS(25) Dgetdrv( void );
void GEMDOS(26) Fsetdta( DTA *buf );
long GEMDOS(32) Super( void *stack );
unsigned short GEMDOS(42) Tgetdate( void );
unsigned short GEMDOS(43) Tsetdate( unsigned short date );
unsigned short GEMDOS(44) Tgettime( void );
unsigned short GEMDOS(45) Tsettime( unsigned short time );
DTA * GEMDOS(47) Fgetdta( void );
short GEMDOS(48) Sversion( void );
void GEMDOS(49) Ptermres( long keepcnt, short retcode );
short GEMDOS(54) Dfree( DISKINFO *buf, short driveno );
short GEMDOS(57) Dcreate( const char *path );
short GEMDOS(58) Ddelete( const char *path );
short GEMDOS(59) Dsetpath( const char *path );
long GEMDOS(60) Fcreate( const char *filename, short attr );
long GEMDOS(61) Fopen( const char *filename, short mo );
short GEMDOS(62) Fclose( short handle );
long GEMDOS(63) Fread( short handle, long count, void *buf );
long GEMDOS(64) Fwrite( short handle, long count, void *buf );
short GEMDOS(65) Fdelete( const char *filename );
long GEMDOS(66) Fseek( long offset, short handle, short seekmode );
short GEMDOS(67) Fattrib( const char *filename, short wflag, short attrib );
long GEMDOS(69) Fdup( short handle );
short GEMDOS(70) Fforce( short stch, short nonstdh );
short GEMDOS(71) Dgetpath( char *path, short driveno );
void * GEMDOS(72) Malloc( long number );
short GEMDOS(73) Mfree( void *block );
short GEMDOS(74) Mshrink( short zero, void *block, long newsiz );
long GEMDOS(75) Pexec( short mo, char *ptr1, void *ptr2, void *ptr3 );
void GEMDOS(76) Pterm( short retcode );
short GEMDOS(78) Fsfirst( const char *filename, short attr );
short GEMDOS(79) Fsnext( void );
short GEMDOS(86) Frename( short zero, const char *oldname, const char *newname );
short GEMDOS(87) Fdatime( DOSTIME *timeptr, short handle, short wflag );
short GEMDOS(0x119) Pdomain( short newdom );
void * GEMDOS(0x112) Psignal( short sig, void *handler );
/****** TOS 030 Gemdos Extension ****************************************/
void * GEMDOS(68) Mxalloc( long number, short mo );
long GEMDOS(20) Maddalt( void *start, long size );
/****** Network Gemdos Extension ****************************************/
long GEMDOS(92) Flock( short handle, short mo, long start, long length );
/****** Bios ************************************************************/
void BIOS( 0) Getmpb( MPB *ptr );
short BIOS( 1) Bconstat( short dev );
long BIOS( 2) Bconin( short dev );
long BIOS( 3) Bconout( short dev, short c );
long BIOS( 4) Rwabs( short rwflag, void *buf, short cnt, short recnr, short dev );
void (* BIOS(5) Setexc( short number, void (*exchdlr)() )) ();
long BIOS( 6) Tickcal( void );
BPB * BIOS( 7) Getbpb( short dev );
long BIOS( 8) Bcostat( short dev );
long BIOS( 9) Mediach( short dev );
long BIOS(10) Drvmap( void );
long BIOS(11) Kbshift( short mo );
long BIOS(12) Lrwabs( short rwflag, void *buf, short cnt, short recnr, short dev );
/****** XBios ***********************************************************/
void XBIOS(0) Initmouse( short , MOUSE *, void (*)() );
void * XBIOS(1) Ssbrk( short count );
void * XBIOS(2) Physbase( void );
void * XBIOS(3) Logbase( void );
short XBIOS(4) Getrez( void );
void XBIOS(5) Setscreen( void *laddr, void *paddr, short rez );
void XBIOS(6) Setpalette( void *pallptr );
short XBIOS(7) Setcolor( short colornum, short color );
short XBIOS(8) Floprd( void *buf, void *filler, short devno, short sectno,
short trackno, short sideno, short count );
short XBIOS(9) Flopwr( void *buf, void *filler, short devno, short sectno,
short trackno, short sideno, short count );
short XBIOS(10) Flopfmt( void *buf, void *filler, short devno, short spt, short trackno,
short sideno, short interlv, long magic, short virgin );
void XBIOS(12) Midiws( short cnt, void *ptr );
void XBIOS(13) Mfpint( short erno, void (*vector)() );
IOREC * XBIOS(14) Iorec( short dev );
long XBIOS(15) Rsconf( short baud, short ctr, short ucr, short rsr, short tsr, short scr );
KEYTAB *XBIOS(16) Keytbl( void *unshift, void *shift, void *capslock );
long XBIOS(17) Random( void );
void XBIOS(18) Protobt( void *buf, long serialno, short disktype, short execflag );
short XBIOS(19) Flopver( void *buf, void *filler, short devno, short sectno,
short trackno, short sideno, short count );
void XBIOS(20) Scrdmp( void );
short XBIOS(21) Cursconf( short func, short rate );
void XBIOS(22) Settime( unsigned long time );
unsigned
long XBIOS(23) Gettime( void );
void XBIOS(24) Bioskeys( void );
void XBIOS(25) Ikbdws( short count, void *ptr );
void XBIOS(26) Jdisint( short number );
void XBIOS(27) Jenabint( short number );
char XBIOS(28) Giaccess( char data, short regno );
void XBIOS(29) Offgibit( short bitno );
void XBIOS(30) Ongibit( short bitno );
void XBIOS(31) Xbtimer( short timer, short control, short data, void (*vector)() );
void * XBIOS(32) Dosound( void *buf );
short XBIOS(33) Setprt( short config );
KBDVBASE * XBIOS(34)Kbdvbase( void );
short XBIOS(35) Kbrate( short initial, short repeat );
void XBIOS(36) Prtblk( PBDEF *par );
void XBIOS(37) Vsync( void );
typedef long Supfunc(void);
long XBIOS(38) Supexec( Supfunc *func);
void XBIOS(39) Puntaes( void );
short XBIOS(41) Floprate( short devno, short newrate );
short XBIOS(64) Blitmode( short mo );
/* TOS030 XBios */
short XBIOS(42) DMAread( long sector, short count, void *buffer, short devno );
short XBIOS(43) DMAwrite( long sector, short count, void *buffer, short devno );
long XBIOS(44) Bconmap( short devno );
short XBIOS(46) NVMaccess( short opcode, short start, short count, void *buffer );
short XBIOS(80) Esetshift( short shftMode );
short XBIOS(81) Egetshift( void );
short XBIOS(82) EsetBank( short bankNum );
short XBIOS(83) EsetColor( short colorNum, short color );
void XBIOS(84) EsetPalette( short colorNum, short count, short *palettePtr );
void XBIOS(85) EgetPalette( short colorNum, short count, short *palettePtr );
short XBIOS(86) EsetGray( short swtch );
short XBIOS(87) EsetSmear( short swtch );
/* MinT Gemdos */
#ifdef __MINT__
#include <mint.h>
#endif
/* Falcon Gemdos*/
#ifdef __FALCON__
#include <falcon.h>
#endif
#endif
/************************************************************************/

View File

@@ -0,0 +1,33 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* From the mintlib modified by Henk Robbers <h.rbbers@chello.nl> */
#if !defined _TOS_ERR_H
# define _TOS_ERR_H 1 /* Allow multiple inclusion. */
#define DEFENUM 1
enum
{
#include "mint_err.h"
_NE_MAX
};
#endif

View File

@@ -0,0 +1,16 @@
#ifndef TOS_GEM_H
#define TOS_GEM_H
#ifndef __TOS
#include <tos.h>
#endif
#ifndef __AES__
#include <np_aes.h>
#endif
#ifndef __VDI__
#include <np_vdi.h>
#endif
#endif

View File

@@ -0,0 +1 @@
/* TRAP.H

View File

@@ -0,0 +1,122 @@
/* AV-Protokoll, erweiterte Definition vom 26.06.1995
Genaue Beschreibung der Messages in der Dokumentation
zu Thing (THING.HYP ab Version 0.54) */
#ifndef __vaproto__
#define __vaproto__
#define VAPRO 1
/* AES-Messages */
typedef enum
{
AV_PROTOKOLL = 0x4700,
VA_PROTOSTATUS = 0x4701,
AV_GETSTATUS = 0x4703,
AV_STATUS = 0x4704,
VA_SETSTATUS = 0x4705,
AV_SENDKEY = 0x4710,
VA_START = 0x4711,
AV_ASKFILEFONT = 0x4712,
VA_FILEFONT = 0x4713,
AV_ASKCONFONT = 0x4714,
VA_CONFONT = 0x4715,
AV_ASKOBJECT = 0x4716,
VA_OBJECT = 0x4717,
AV_OPENCONSOLE = 0x4718,
VA_CONSOLEOPEN = 0x4719,
AV_OPENWIND = 0x4720,
VA_WINDOPEN = 0x4721,
AV_STARTPROG = 0x4722,
VA_PROGSTART = 0x4723,
AV_ACCWINDOPEN = 0x4724,
VA_DRAGACCWIND = 0x4725,
AV_ACCWINDCLOSED = 0x4726,
AV_COPY_DRAGGED = 0x4728,
VA_COPY_COMPLETE = 0x4729,
AV_PATH_UPDATE = 0x4730,
AV_WHAT_IZIT = 0x4732,
VA_THAT_IZIT = 0x4733,
AV_DRAG_ON_WINDOW = 0x4734,
VA_DRAG_COMPLETE = 0x4735,
AV_EXIT = 0x4736,
AV_STARTED = 0x4738,
VA_FONTCHANGED = 0x4739,
AV_XWIND = 0x4740,
VA_XOPEN = 0x4741,
/* Neue Messages seit dem 26.06.1995 */
AV_VIEW = 0x4751,
VA_VIEWED = 0x4752,
AV_FILEINFO = 0x4753,
VA_FILECHANGED = 0x4754,
AV_COPYFILE = 0x4755,
VA_FILECOPIED = 0x4756,
AV_DELFILE = 0x4757,
VA_FILEDELETED = 0x4758,
AV_SETWINDPOS = 0x4759,
VA_PATH_UPDATE = 0x4760,
VA_HIGH /* HR please always do this! */
} AV_VA;
/* Objekttypen f<>r VA_THAT_IZIT */
enum
{
VA_OB_UNKNOWN,
VA_OB_TRASHCAN,
VA_OB_SHREDDER,
VA_OB_CLIPBOARD,
VA_OB_FILE,
VA_OB_FOLDER,
VA_OB_DRIVE,
VA_OB_WINDOW,
VA_OB_NOTEPAD,
VA_OB_NOTE
};
typedef enum
{
VV_SETSTATUS = 0x0001,
VV_START = 0x0002,
VV_STARTED = 0x0004,
VV_FONTCHANGED = 0x0008,
VV_ACC_QUOTING = 0x0010,
VV_PATH_UPDATE = 0x0020
} av_va_give;
typedef enum
{ /* mp[3]: */
AA_SENDKEY = 0x0001, /* b0: MAGXDESK, THING */
AA_ASKFILEFONT = 0x0002, /* b1: THING */
AA_ASKCONFONT = 0x0004, /* b2: THING */
AA_ASKOBJECT = 0x0008,
AA_OPENWIND = 0x0010, /* b4: MAGXDESK, THING */
AA_STARTPROG = 0x0020, /* b5: MAGXDESK, THING */
AA_ACCWIND = 0x0040, /* b6: THING */
AA_STATUS = 0x0080, /* b7: THING */
AA_COPY_DRAGGED= 0x0100, /* b8: THING */
AA_DRAG_ON_WINDOW=0x0200, /* b9: MAGXDESK, THING */
AA_EXIT = 0x0400, /* b10: MAGXDESK, THING */
AA_XWIND = 0x0800, /* b11: MAGXDESK, THING */
AA_FONTCHANGED = 0x1000, /* b2: THING */
AA_STARTED = 0x2000, /* b13: MAGXDESK, THING */
AA_SRV_QUOTING = 0x4000, /* b14: THING */
AA_FILE = 0x8000, /* b15: THING */
/* mp[4]: THING */
AA_COPY = 0x0001,
AA_DELETE = 0x0002,
AA_VIEW = 0x0004,
AA_SETWINDPOS = 0x0008,
AA_COPYFILELINH= 0x0010,
AA_SENDCLICK = 0x0020
} av_va_have;
/* Makros zum Testen auf Quoting */
#define VA_ACC_QUOTING(a) ((a) & VV_ACC_QUOTING)
#define VA_SERVER_QUOTING(a) ((a) & AA_SRV_QUOTING)
#endif

View File

@@ -0,0 +1,388 @@
/* VDI.H
GEM VDI Definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __VDI__ )
#define __VDI__
#define VDI_H
typedef struct
{
short contrl[15];
short intin[132];
short intout[140];
short ptsin[145];
short ptsout[145];
} VDIPARBLK;
typedef struct
{
short *contrl;
short *intin;
short *ptsin;
short *intout;
short *ptsout;
} VDIPB;
extern VDIPARBLK _VDIParBlk;
void vdi( VDIPB *vdipb );
/****** Control definitions *********************************************/
void v_opnwk(short *work_in, short *handle,short *work_out);
void v_clswk( short handle );
void v_opnvwk(short *work_in,short *handle,short *work_out);
void v_clsvwk( short handle );
void v_clrwk( short handle );
void v_updwk( short handle );
short vst_load_fonts( short handle, short select );
void vst_unload_fonts( short handle, short select );
void vs_clip( short handle, short clip_flag, short *pxyarray );
/****** Output definitions **********************************************/
void v_pline( short handle, short count, short *pxyarray );
void v_pmarker( short handle, short count, short *pxyarray );
void v_gtext( short handle, short x, short y, char *string );
void v_fillarea( short handle, short count, short *pxyarray );
void v_cellarray( short handle, short *pxyarray, short row_length,
short el_used, short num_rows, short wrt_mode,
short *colarray );
void v_contourfill( short handle, short x, short y, short index );
void vr_recfl( short handle, short *pxyarray );
void v_bar( short handle, short *pxyarray );
void v_arc( short handle, short x, short y, short radius,
short begang, short endang );
void v_pieslice( short handle, short x, short y, short radius,
short begang, short endang );
void v_circle( short handle, short x, short y, short radius );
void v_ellarc( short handle, short x, short y, short xradius,
short yradius, short begang, short endang );
void v_ellpie( short handle, short x, short y, short xradius,
short yradius, short begang, short endang );
void v_ellipse( short handle, short x, short y, short xradius,
short yradius );
void v_rbox ( short handle, short *pxyarray );
void v_rfbox ( short handle, short *pxyarray );
void v_justified( short handle,short x, short y, char *string,
short length, short word_space,
short char_space );
/****** Attribute definitions *****************************************/
#define IP_HOLLOW 0
#define IP_1PATT 1
#define IP_2PATT 2
#define IP_3PATT 3
#define IP_4PATT 4
#define IP_5PATT 5
#define IP_6PATT 6
#define IP_SOLID 7
/* gsx modes */
#define MD_REPLACE 1
#define MD_TRANS 2
#define MD_XOR 3
#define MD_ERASE 4
/* gsx styles */
#define FIS_HOLLOW 0
#define FIS_SOLID 1
#define FIS_PATTERN 2
#define FIS_HATCH 3
#define FIS_USER 4
/* bit blt rules */
#define ALL_WHITE 0
#define S_AND_D 1
#define S_AND_NOTD 2
#define S_ONLY 3
#define NOTS_AND_D 4
#define D_ONLY 5
#define S_XOR_D 6
#define S_OR_D 7
#define NOT_SORD 8
#define NOT_SXORD 9
#define D_INVERT 10
#define NOT_D 11
#define S_OR_NOTD 12
#define NOTS_OR_D 13
#define NOT_SANDD 14
#define ALL_BLACK 15
/* linetypes */
#define SOLID 1
#define LONGDASH 2
#define DOT 3
#define DASHDOT 4
#define DASH 5
#define DASH2DOT 6
#define USERLINE 7
#define SQUARE 0
#define ARROWED 1
#define ROUND 2
/* Lattice C should better use the TF_xxx-constants anyway... */
#define THICKENED 0x01
#define SHADED 0x02
#define SKEWED 0x04
#define UNDERLINED 0x08
#define OUTLINE 0x10
#define SHADOW 0x20
short vswr_mode( short handle, short mo );
void vs_color( short handle, short index, short *rgb_in );
short vsl_type( short handle, short style );
void vsl_udsty( short handle, short pattern );
short vsl_width( short handle, short width );
short vsl_color( short handle, short color_index );
void vsl_ends( short handle, short beg_style, short end_style );
short vsm_type( short handle, short symbol );
short vsm_height( short handle, short height );
short vsm_color( short handle, short color_index );
void vst_height( short handle, short height, short *char_width,
short *char_height, short *cell_width,
short *cell_height );
short vst_point( short handle, short point, short *char_width,
short *char_height, short *cell_width,
short *cell_height );
short vst_rotation( short handle, short angle );
short vst_font( short handle, short font );
short vst_color( short handle, short color_index );
short vst_effects( short handle, short effect );
void vst_alignment( short handle, short hor_in, short vert_in,
short *hor_out, short *vert_out );
short vsf_interior( short handle, short style );
short vsf_style( short handle, short style_index );
short vsf_color( short handle, short color_index );
short vsf_perimeter( short handle, short per_vis );
void vsf_udpat( short handle, short *pfill_pat, short planes );
/****** Raster definitions *********************************************/
typedef struct
{
void *fd_addr;
short fd_w;
short fd_h;
short fd_wdwidth;
short fd_stand;
short fd_nplanes;
short fd_r1;
short fd_r2;
short fd_r3;
} MFDB;
void vro_cpyfm( short handle, short vr_mode, short *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB );
void vrt_cpyfm( short handle, short vr_mode, short *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB,
short *color_index );
void vr_trnfm( short handle, MFDB *psrcMFDB, MFDB *pdesMFDB );
void v_get_pixel( short handle, short x, short y, short *pel,
short *index );
/****** Input definitions **********************************************/
void vsin_mode( short handle, short dev_type, short mo );
void vrq_locator( short handle, short x, short y, short *xout,
short *yout, short *term );
short vsm_locator( short handle, short x, short y, short *xout,
short *yout, short *term );
void vrq_valuator( short handle, short valuator_in,
short *valuator_out, short *terminator );
void vsm_valuator( short handle, short val_in, short *val_out,
short *term, short *status );
void vrq_choice( short handle, short ch_in, short *ch_out );
short vsm_choice( short handle, short *choice );
void vrq_string( short handle, short max_length, short echo_mode,
short *echo_xy, char *string );
short vsm_string( short handle, short max_length, short echo_mode,
short *echo_xy, char *string );
void vsc_form( short handle, short *pcur_form );
void vex_timv( short handle, short (*tim_addr)(), short (**otim_addr)(),
short *tim_conv );
void v_show_c( short handle, short reset );
void v_hide_c( short handle );
void vq_mouse( short handle, short *pstatus, short *x, short *y );
void vex_butv( short handle, short (*pusrcode)(), short (**psavcode)() );
void vex_motv( short handle, short (*pusrcode)(), short (**psavcode)() );
void vex_curv( short handle, short (*pusrcode)(), short (**psavcode)() );
void vex_whlv( short handle, short (*pusrcode)(), short (**psavcode)() ); /* HR 111002: wheel support */
void vq_key_s( short handle, short *pstatus );
/****** Inquire definitions *******************************************/
void vq_extnd( short handle, short owflag, short *work_out );
short vq_color( short handle, short color_index,
short set_flag, short *rgb );
void vql_attributes( short handle, short *attrib );
void vqm_attributes( short handle, short *attrib );
void vqf_attributes( short handle, short *attrib );
void vqt_attributes( short handle, short *attrib );
void vqt_extent( short handle, char *string, short *extent );
short vqt_width( short handle, short character,
short *cell_width, short *left_delta,
short *right_delta );
short vqt_name( short handle, short element_num, char *name );
void vq_cellarray( short handle, short *pxyarray,
short row_length, short num_rows,
short *el_used, short *rows_used,
short *status, short *colarray );
void vqin_mode( short handle, short dew_type, short *input_mode );
void vqt_fontinfo( short handle, short *minADE, short *maxADE,
short *distances, short *maxwidth,
short *effects );
/****** Escape definitions *********************************************/
void vq_chcells( short handle, short *rows, short *columns );
void v_exit_cur( short handle );
void v_enter_cur( short handle );
void v_curup( short handle );
void v_curdown( short handle );
void v_curright( short handle );
void v_curleft( short handle );
void v_curhome( short handle );
void v_eeos( short handle );
void v_eeol( short handle );
void vs_curaddress( short handle, short Row, short Column );
void v_curaddress( short handle, short Row, short Column );
void v_curtext( short handle, char *string );
void v_rvon( short handle );
void v_rvoff( short handle );
void vq_curaddress( short handle, short *Row, short *Column );
short vq_tabstatus( short handle );
void v_hardcopy( short handle );
void v_dspcur( short handle, short x, short y );
void v_rmcur( short handle );
void v_form_adv( short handle );
void v_output_window( short handle, short *xyarray );
void v_clear_disp_list( short handle );
void v_bit_image( short handle, const char *filename,
short aspect, short x_scale, short y_scale,
short h_align, short v_align, short *xyarray );
void vq_scan( short handle, short *g_slice, short *g_page,
short *a_slice, short *a_page, short *div_fac);
void v_alpha_text( short handle, char *string );
void vs_palette( short handle, short palette );
void v_sound( short handle, short frequency, short duration );
short vs_mute( short handle, short action );
void vqp_films( short handle, char *film_names );
void vqp_state( short handle, short *port, char *film_name,
short *lightness, short *interlace,
short *planes, short *indexes );
void vsp_state( short handle, short port, short film_num,
short lightness, short interlace, short planes,
short *indexes );
void vsp_save( short handle );
void vsp_message( short handle );
short vqp_error( short handle );
void v_meta_extents( short handle, short min_x, short min_y,
short max_x, short max_y );
void v_write_meta( short handle,
short num_intin, short *intin,
short num_ptsin, short *ptsin );
void vm_coords( short handle, short llx, short lly, short urx, short ury );
void vm_filename( short handle, const char *filename );
void vm_pagesize( short handle, short pgwidth, short pdheight );
void v_offset( short handle, short offset );
void v_fontinit( short handle, short fh_high, short fh_low );
void v_escape2000( short handle, short times );
void vt_resolution( short handle, short xres, short yres,
short *xset, short *yset );
void vt_axis( short handle, short xres, short yres,
short *xset, short *yset );
void vt_origin( short handle, short xorigin, short yorigin );
void vq_tdimensions( short handle, short *xdimension, short *ydimension );
void vt_alignment( short handle, short dx, short dy );
void vsp_film( short handle, short index, short lightness );
void vsc_expose( short handle, short state );
#define GDOS_NONE -2L /* no GDOS installed */
#define GDOS_FSM 0x5F46534DL /* '_FSM' - FSMGDOS installed */
#define GDOS_FNT 0x5F464E54L /* '_FNT' - FONTGDOS installed */
short vq_gdos( void );
long vq_vgdos( void );
short v_bez_on( short handle );
void v_bez_off( short handle );
void v_set_app_buff( short handle, void *address, short nparagraphs );
void v_bez( short handle, short count, short *xyarr,
char *bezarr, short *extent, short *totpts, short *totmoves );
void v_bez_fill( short handle, short count, short *xyarr,
char *bezarr, short *extent, short *totpts,
short *totmoves );
short v_bez_qual( short handle, short prcnt, short *actual );
/****** SpeedoGDOS definitions ********************************************/
typedef long fix31;
void vqt_f_extent( short handle, char *string, short *extent );
void v_ftext( short handle, short x, short y, char *string );
void v_ftext_offset( short handle, short x, short y, char *string, short *offset );
void v_killoutline( short handle, void *component );
void v_getoutline( short handle, short ch, short *xyarray,
char *bezarray, short maxverts, short *numverts );
void vst_scratch( short handle, short mo );
void vst_error( short handle, short mo, short *errorvar );
void vqt_advance( short handle, short ch, short *advx, short *advy,
short *remx, short *remy );
void vqt_advance32( short handle, short ch, fix31 *advx, fix31 *advy );
short vst_arbpt( short handle, short point, short *chwd, short *chht,
short *cellwd, short *cellht );
fix31 vst_arbpt32( short handle, fix31 point, short *chwd, short *chht,
short *cellwd, short *cellht );
void vst_charmap( short handle, short mo );
void v_getbitmap_info( short handle, short ch, fix31 *advx, fix31 *advy,
fix31 *xoff, fix31 *yoff, fix31 *width,
fix31 *height );
void vqt_pairkern( short handle, short ch1, short ch2, fix31 *x, fix31 *y );
void vqt_trackkern( short handle, fix31 *x, fix31 *y );
void vqt_fontheader( short handle, char *buffer, char *pathname );
void vst_kern( short handle, short tmode, short pmode, short *tracks,
short *pairs );
fix31 vst_setsize32( short handle, fix31 point, short *chwd, short *chht,
short *cellwd, short *cellht );
void vqt_devinfo( short handle, short devnum, short *devexits,
char *devstr );
short v_flushcache( short handle );
void vqt_cachesize( short handle, short which_cache, long *size );
void vqt_get_table( short handle, short **map );
short v_loadcache( short handle, char *filename, short mo );
short v_savecache( short handle, char *filename );
short vst_setsize( short handle, short point, short *chwd, short *chht,
short *cellwd, short *cellht );
short vst_skew( short handle, short skew );
#endif
/***********************************************************************/