Skip to content

Commit

Permalink
Initial Import
Browse files Browse the repository at this point in the history
Signed-off-by: Graeme Gregory <[email protected]>
  • Loading branch information
xXorAa committed Aug 18, 2021
0 parents commit dca5228
Show file tree
Hide file tree
Showing 895 changed files with 66,290 additions and 0 deletions.
1,429 changes: 1,429 additions & 0 deletions Makefile

Large diffs are not rendered by default.

1,393 changes: 1,393 additions & 0 deletions Makefile.c68

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions ctype/ctype.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#include <ctype.h>

/*
* Definition of the ctype array
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Added a pointer to this table initialised to the
* second element. This allows for locale handling
* and also generates more efficient code for the
* ctype macros which do not have to add 1 any more
* to the supplied value to get the table offset.
*
* 24 Jan 95 DJW - Changed type of table to 'unsigned char'. This stops
* the compiler generating warnings, and may well also
* lead to better code in the ctype macros.
*/

static unsigned char ctype_table[257] = {
/*
* We could theoretically put an array of values at
* this point to allow for programmers forgetting to
* cast char parameters to the macros to unsigned int
* and thus using negative values instead of postive.
* (except for -1 which is always a special case).
*/
0, /* -1 index into array */

/* NUL SCH STX ETX EOT ENQ ACK BEL */
_C, _C, _C, _C, _C, _C, _C, _C,

/* BS HT LF VT FF CR SO SI */
_C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,

/* DLE DC1 DC2 DC3 DC4 NAK SYN ETB */
_C, _C, _C, _C, _C, _C, _C, _C,

/* CAN EM SUB ESC FS GS RS US */
_C, _C, _C, _C, _C, _C, _C, _C,

/* SPACE ! " # $ % & ' */
_B|_S, _P, _P, _P, _P, _P, _P, _P,

/* ( ) * + , - . / */
_P, _P, _P, _P, _P, _P, _P, _P,

/* 0 1 2 3 4 5 6 7 */
_X|_N, _X|_N, _X|_N, _X|_N, _X|_N, _X|_N, _X|_N, _X|_N,

/* 8 9 : ; < = > ? */
_X|_N, _X|_N, _P, _P, _P, _P, _P, _P,

/* @ A B C D E F G */
_P, _X|_U, _X|_U, _X|_U, _X|_U, _X|_U, _X|_U, _U,

/* H I J K L M N O */
_U, _U, _U, _U, _U, _U, _U, _U,

/* P Q R S T U V W */
_U, _U, _U, _U, _U, _U, _U, _U,

/* X Y Z [ \ ] ^ _ */
_U, _U, _U, _P, _P, _P, _P, _P,

/* ` a b c d e f g */
_P, _X|_L, _X|_L, _X|_L, _X|_L, _X|_L, _X|_L, _L,

/* h i j k l m n o */
_L, _L, _L, _L, _L, _L, _L, _L,

/* p q r s t u v w */
_L, _L, _L, _L, _L, _L, _L, _L,

/* x y z { | } ~ DEL */
_L, _L, _L, _P, _P, _P, _P, _C,

/* QL higH character set, 128 - 192 */
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,

/* QL high control char set */
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C
};


unsigned char * _ctype = &ctype_table[1];

int _ctypetemp;

19 changes: 19 additions & 0 deletions ctype/isalnum.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* i s a l n u m
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/

#define __LIBRARY__

#include <ctype.h>

#undef isalnum

int isalnum _LIB_F1_(int, c)
{
return (_ctype[c]&(_U|_L|_N));
}
19 changes: 19 additions & 0 deletions ctype/isalpha.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* i s a l p h a
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/

#define __LIBRARY__

#include <ctype.h>

#undef isalpha

int isalpha _LIB_F1_(int, c)
{
return (_ctype[c]&(_U|_L));
}
10 changes: 10 additions & 0 deletions ctype/isascii.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#define __LIBRARY__

#include <ctype.h>

#undef isascii

int isascii _LIB_F1_( int, c)
{
return ((unsigned)(c)<=127);
}
17 changes: 17 additions & 0 deletions ctype/iscntrl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s c n t r l
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef iscntrl

int iscntrl( c )
int c;
{
return (_ctype[c]&_C);
}
9 changes: 9 additions & 0 deletions ctype/iscsym.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <ctype.h>

#undef iscsym

int iscsym( c )
int c;
{
return (isalnum(c) || (((unsigned int)(c) & 127U) == 0x5f));
}
9 changes: 9 additions & 0 deletions ctype/iscsymf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <ctype.h>

#undef iscsymf

int iscsymf( c )
int c;
{
return (isalpha(c)||(((unsigned int)(c)&127U)==0x5f));
}
17 changes: 17 additions & 0 deletions ctype/isdigit.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s d i g i t
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef isdigit

int isdigit( c )
int c;
{
return (_ctype[c]&_N);
}
17 changes: 17 additions & 0 deletions ctype/isgraph.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s g r a p h
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef isgraph

int isgraph( c )
int c;
{
return (_ctype[c]&(_P|_U|_L|_N));
}
17 changes: 17 additions & 0 deletions ctype/islower.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s l o w e r
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef islower

int islower( c )
int c;
{
return (_ctype[c]&_L);
}
17 changes: 17 additions & 0 deletions ctype/isprint.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s p r i n t
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef isprint

int isprint( c )
int c;
{
return (_ctype[c]&(_P|_U|_L|_N|_B));
}
17 changes: 17 additions & 0 deletions ctype/ispunct.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s p u n c t
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef ispunct

int ispunct( c )
int c;
{
return (_ctype[c]&_P);
}
17 changes: 17 additions & 0 deletions ctype/isspace.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s s p a c e
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef isspace

int isspace( c )
int c;
{
return (_ctype[c]&_S);
}
17 changes: 17 additions & 0 deletions ctype/isupper.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s u p p e r
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef isupper

int isupper( c )
int c;
{
return (_ctype[c]&_U);
}
17 changes: 17 additions & 0 deletions ctype/isxdigit.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* i s x d i g i t
*
* AMENDMENT HISTORY
* ~~~~~~~~~~~~~~~~~
* 28 May 94 DJW - Amended to take account of fact that offset into
* _ctype array no longer needs adjusting by one.
*/
#include <ctype.h>

#undef isxdigit

int isxdigit( c )
int c;
{
return (_ctype[c]&_X);
}
9 changes: 9 additions & 0 deletions ctype/toascii.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <ctype.h>

#undef toascii

int toascii( c )
int c;
{
return ((unsigned int)(c) & 127U);
}
9 changes: 9 additions & 0 deletions ctype/tolower.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <ctype.h>

#undef tolower

int tolower( c )
int c;
{
return (isupper(c)?((c)+('a'-'A')):(c));
}
9 changes: 9 additions & 0 deletions ctype/toupper.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <ctype.h>

#undef toupper

int toupper( c )
int c;
{
return (islower(c)?((c)-('a'-'A')):(c));
}
11 changes: 11 additions & 0 deletions defaults/Cstart.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;
; This is the default vector for program initialisation
;
; It is is set to point to the _Cinit routine.
;

.globl __Cstart

__Cstart:
dc.l __Cinit

Loading

0 comments on commit dca5228

Please sign in to comment.