Skip to content

Commit

Permalink
v0.7.18 / f0039
Browse files Browse the repository at this point in the history
  • Loading branch information
adesutherland committed Aug 28, 2020
1 parent 8bf1af2 commit 8b185c7
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 53 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
GCCLIB Change LOG
=================

0.7.18- 28 August 2020
F0039 - Reoranised header files a bit to *reduce* circular dependancies
- Changed CMSGetPG() to macro - performance


0.7.17- 11 August 2020
F0038 - Add support for being called via a type 5 call
- Assist to turn main() return int into a calltype 5 return EVALBLOK string
Expand Down
1 change: 1 addition & 0 deletions cmsio.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


#include <cmsruntm.h>
#include <cmssys.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
Expand Down
2 changes: 2 additions & 0 deletions cmsrtstb.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
/* Released to the public domain. */
/**************************************************************************************************/
#include <cmsruntm.h>
#include <cmssys.h>
#include <stdio.h>
#include <cmssys.h>
#include <signal.h>
#include <stdlib.h>

Expand Down
2 changes: 1 addition & 1 deletion cmsruntm.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**************************************************************************************************/
/* TODO Paramter Overruns */
#include <cmsruntm.h>

#include <cmssys.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
Expand Down
35 changes: 5 additions & 30 deletions cmsruntm.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#ifndef CMSRUNTM_INCLUDED
#define CMSRUNTM_INCLUDED
#include <stdio.h>

#ifndef __SIZE_T_DEFINED
#define __SIZE_T_DEFINED
Expand Down Expand Up @@ -38,7 +37,7 @@ struct CMSCRAB {
CMSCRAB *backchain; /* backchain to previous save area +04 */
CMSCRAB *forward; /* forward chain to next save area +08 */
void *regsavearea[15]; /* register save area and save area chaining +12 */
GCCCRAB *gcccrab; /* GCC C Runtime Anchor Block (GCCCRAB) +72 */
struct GCCCRAB *gcccrab; /* GCC C Runtime Anchor Block (GCCCRAB) +72 */
void *stackNext; /* next available byte in the stack +76 */
void *numconv; /* numeric conversion buffer +80 */
void *funcrslt; /* function result buffer +84 */
Expand Down Expand Up @@ -74,7 +73,6 @@ struct CMSCRAB {
#define ARGBUFFERLEN 300

/* Startup Functions */
int __cstub(PLIST *plist , EPLIST *eplist);
int __cstart(MAINFUNC* mainfunc);

/*
Expand Down Expand Up @@ -139,30 +137,7 @@ typedef struct CMSDRIVER CMSDRIVER;
typedef struct CMSDRIVERS CMSDRIVERS;
typedef struct CMSFILECACHE CMSFILECACHE;
typedef struct CMSCACHEENTRY CMSCACHEENTRY;

struct FILE {
char validator1; /* Marks a valid FILE structure */
char name[21]; /* File name used for messages */
char fileid[19]; /* Null terminated FILEID */
FILE* next; /* Next file in the file list */
FILE* prev; /* Previous file in the file list */
int access; /* type of access mode flags (read, write, etc.) */
int status; /* status flags (error, eof, dirty record buffer, read/write mode, etc.) */
int error; /* error code from last I/O operation against this file */
int ungetchar; /* Unget Character */
int recpos; /* char position in record buffer, next unread byte, next byte position to write */
int recnum; /* Record number (1 base) of the record in the buffer, -1 nonblock device,
0 no record loaded */
int reclen; /* Current Record length excluding any trailing \n and null */
int maxreclen; /* Max Record length for curren record excluding any trailing \n and null */
int filemaxreclen; /* Max Record length / Buffer Length excluding any trailing \n and null */
int records; /* Number of records or -1 for non-block file */
CMSDRIVER *device; /* device driver (console, disk, etc.) */
char *buffer; /* record buffer */
CMSFILECACHE *cache; /* File cache */
CMSFILE fscb; /* the CMS File System Control Block (if it is a disk file) */
char validator2; /* Marks a valid FILE structure */
};
/* FILE Structure Specified in cmssys.h */

/* Status flags */
#define STATUS_EOF 1
Expand Down Expand Up @@ -206,9 +181,9 @@ struct CMSCACHEENTRY {
};

/* IO Drivers */
typedef int (CONTROL_FUNC)(FILE *stream);
typedef int (OPEN_FUNC)(char filespecwords[][10], FILE* file);
typedef int (SETPOS_FUNC)(FILE *stream, int recpos);
typedef int (CONTROL_FUNC)(struct FILE *stream);
typedef int (OPEN_FUNC)(char filespecwords[][10], struct FILE* file);
typedef int (SETPOS_FUNC)(struct FILE *stream, int recpos);

struct CMSDRIVER {
OPEN_FUNC *open_func;
Expand Down
1 change: 1 addition & 0 deletions cmsstdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/**************************************************************************************************/

#include <cmsruntm.h>
#include <cmssys.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
Expand Down
1 change: 1 addition & 0 deletions cmsstdlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/**************************************************************************************************/

#include <cmsruntm.h>
#include <cmssys.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
Expand Down
29 changes: 27 additions & 2 deletions cmssys.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef CMSSYS_INCLUDED
#define CMSSYS_INCLUDED

#define GCCLIB_VERSION "0.7.17"
#define GCCLIB_VERSION "0.7.18"

#include <stddef.h>
#include <stdarg.h>
Expand Down Expand Up @@ -58,6 +58,30 @@ typedef struct {
int bytesRead; /* number of bytes actually read */
} CMSFILE;

struct FILE {
char validator1; /* Marks a valid FILE structure */
char name[21]; /* File name used for messages */
char fileid[19]; /* Null terminated FILEID */
struct FILE* next; /* Next file in the file list */
struct FILE* prev; /* Previous file in the file list */
int access; /* type of access mode flags (read, write, etc.) */
int status; /* status flags (error, eof, dirty record buffer, read/write mode, etc.) */
int error; /* error code from last I/O operation against this file */
int ungetchar; /* Unget Character */
int recpos; /* char position in record buffer, next unread byte, next byte position to write */
int recnum; /* Record number (1 base) of the record in the buffer, -1 nonblock device,
0 no record loaded */
int reclen; /* Current Record length excluding any trailing \n and null */
int maxreclen; /* Max Record length for curren record excluding any trailing \n and null */
int filemaxreclen; /* Max Record length / Buffer Length excluding any trailing \n and null */
int records; /* Number of records or -1 for non-block file */
struct CMSDRIVER *device; /* device driver (console, disk, etc.) */
char *buffer; /* record buffer */
struct CMSFILECACHE *cache; /* File cache */
CMSFILE fscb; /* the CMS File System Control Block (if it is a disk file) */
char validator2; /* Marks a valid FILE structure */
};

/**************************************************************************************************/
/* CMSFILEINFO maps the CMS FST (File Status Table). */
/**************************************************************************************************/
Expand Down Expand Up @@ -100,7 +124,8 @@ typedef struct {
/* */
/**************************************************************************************************/
void* CMSPGAll(size_t size);
void* CMSGetPG(void);
#include <gcccrab.h>
#define CMSGetPG() (GETGCCCRAB()->process_global)

/**************************************************************************************************/
/* int CMSGetFlag(int flag) */
Expand Down
8 changes: 1 addition & 7 deletions cmssysc.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int __CMSCMD(char *command, int calltype)
/* I have coined this memory - Process Global Memory. */
/* */
/* void* CMSPGAll(size_t size) - Allocate / Reallocate Process Global Memory Block */
/* void* CMSGetPG(void) - Get the address of the Process Global Memory Block */
/* void* CMSGetPG(void) - Get the address of the Process Global Memory *** MACRO in cmssys.h *** */
/* */
/* Note: that this area is freed automatically on normal program termination. */
/* */
Expand All @@ -164,12 +164,6 @@ void* CMSPGAll(size_t size) {
return crab->process_global;
}

void* CMSGetPG(void) {
GCCCRAB *crab;
crab = GETGCCCRAB();
return crab->process_global;
}

/**************************************************************************************************/
/* Call Type 5 (function) call */
/* __CMSFNA() */
Expand Down
16 changes: 7 additions & 9 deletions gcccrab.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#ifndef GCCCRAB_INCLUDED
#define GCCCRAB_INCLUDED
#include <stdio.h>
#include <cmssys.h>

#ifndef __SIZE_T_DEFINED
#define __SIZE_T_DEFINED
Expand All @@ -36,21 +34,21 @@ struct GCCCRAB {
EXITFUNC *exitfunc;
void* dlmspace; /* For DLMALLOC */
size_t startmemoryusage;
FILE *gstdin;
FILE *gstdout;
FILE *gstderr;
struct FILE *gstdin;
struct FILE *gstdout;
struct FILE *gstderr;
int gerrno;
SIGHANDLER **handlers;
USEREXIT **userexits;
FILE* filehandles;
struct FILE* filehandles;
char *strtok_old;
void *process_global;
char **argv;
char *argbuffer;
PLIST *plist;
EPLIST *eplist;
char (*plist)[8];
struct EPLIST *eplist;
int calltype;
EVALBLOK *evalblok;
struct EVALBLOK *evalblok;
int isproc;
int argc;
};
Expand Down
1 change: 0 additions & 1 deletion members.parm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
***********************************************************************
@@DEBUG
CMSPGALL
CMSGETPG
CMSSETFL
CMSSETNU
@@ATTN
Expand Down
1 change: 1 addition & 0 deletions signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/*********************************************************************/

#include <cmsruntm.h>
#include <cmssys.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down
3 changes: 1 addition & 2 deletions stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#ifndef STDIO_INCLUDED
#define STDIO_INCLUDED

#include <cmssys.h>
#include <stdarg.h>
#include <string.h>

Expand All @@ -38,9 +37,9 @@ typedef struct FPOS_T fpos_t;

/**************************************************************************************************/
/* FILE - open stream file block */
/* Specified in cmsruntm.h */
/**************************************************************************************************/
typedef struct FILE FILE;
/* FILE Structure Specified in cmssys.h */

/* Stdlib Public Global Variables */
#include <gcccrab.h>
Expand Down
1 change: 1 addition & 0 deletions tsts.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <cmssys.h>

#include "tsts.h"

Expand Down
1 change: 0 additions & 1 deletion vtable.macro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
***********************************************************************
@@DEBUG VTENTRY
CMSPGALL VTENTRY
CMSGETPG VTENTRY
CMSSETFL VTENTRY
CMSSETNU VTENTRY
@@ATTN VTENTRY
Expand Down

0 comments on commit 8b185c7

Please sign in to comment.