mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-26 11:52:25 +00:00
Reformat all C source files with Clang-format in Google style w/ 100 col width.
This commit is contained in:
207
src/common.c
Executable file → Normal file
207
src/common.c
Executable file → Normal file
@@ -1,4 +1,5 @@
|
||||
/* $Id: common.c,v 1.2 1999/01/03 02:06:52 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
|
||||
/* $Id: common.c,v 1.2 1999/01/03 02:06:52 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
|
||||
*/
|
||||
static char *id = "$Id: common.c,v 1.2 1999/01/03 02:06:52 sybalsky Exp $ Copyright (C) Venue";
|
||||
|
||||
/************************************************************************/
|
||||
@@ -14,13 +15,11 @@ static char *id = "$Id: common.c,v 1.2 1999/01/03 02:06:52 sybalsky Exp $ Copyri
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <setjmp.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <setjmp.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h> /* for memset */
|
||||
#include "lispemul.h"
|
||||
#include "lispmap.h"
|
||||
@@ -34,49 +33,41 @@ static char *id = "$Id: common.c,v 1.2 1999/01/03 02:06:52 sybalsky Exp $ Copyri
|
||||
#include <pixrect/pixrect_hs.h>
|
||||
#endif
|
||||
|
||||
void stab()
|
||||
{
|
||||
DBPRINT(("Now in stab\n"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void stab() { DBPRINT(("Now in stab\n")); }
|
||||
|
||||
/***************************************************************
|
||||
error
|
||||
common sub-routine.
|
||||
common sub-routine.
|
||||
|
||||
Printout error message.
|
||||
Enter URAID.
|
||||
And exit.(takeshi)
|
||||
Printout error message.
|
||||
Enter URAID.
|
||||
And exit.(takeshi)
|
||||
|
||||
******************************************************************/
|
||||
#define URMAXFXNUM 100
|
||||
#define URMAXFXNUM 100
|
||||
|
||||
extern unsigned int LispReadFds,LispWindowFd,LispKbdFd;
|
||||
extern unsigned int LispReadFds, LispWindowFd, LispKbdFd;
|
||||
extern struct screen LispScreen;
|
||||
extern int displaywidth,displayheight;
|
||||
extern int displaywidth, displayheight;
|
||||
extern DLword *DisplayRegion68k;
|
||||
extern int FrameBufferFd;
|
||||
extern char URaid_inputstring[];
|
||||
extern char URaid_comm;
|
||||
extern char URaid_arg1[256];
|
||||
extern char URaid_arg2[10];
|
||||
extern int URaid_argnum;
|
||||
extern char *URaid_errmess;
|
||||
extern int URaid_currentFX;
|
||||
extern FX *URaid_FXarray[];
|
||||
extern jmp_buf BT_jumpbuf;
|
||||
extern jmp_buf SD_jumpbuf;
|
||||
extern int BT_temp; /* holds the continue-character the user typed */
|
||||
extern char URaid_inputstring[];
|
||||
extern char URaid_comm;
|
||||
extern char URaid_arg1[256];
|
||||
extern char URaid_arg2[10];
|
||||
extern int URaid_argnum;
|
||||
extern char *URaid_errmess;
|
||||
extern int URaid_currentFX;
|
||||
extern FX *URaid_FXarray[];
|
||||
extern jmp_buf BT_jumpbuf;
|
||||
extern jmp_buf SD_jumpbuf;
|
||||
extern int BT_temp; /* holds the continue-character the user typed */
|
||||
|
||||
LispPTR Uraid_mess=NIL;
|
||||
LispPTR Uraid_mess = NIL;
|
||||
|
||||
/* Currentry Don't care Ether re-initial */
|
||||
/* Medley only */
|
||||
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* e r r o r */
|
||||
@@ -85,65 +76,59 @@ extern int FrameBufferFd;
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
#define URMAXCOMM 512
|
||||
int error(char *cp)
|
||||
{
|
||||
char *ptr;
|
||||
if(device_before_raid()<0)
|
||||
{
|
||||
printf("Can't Enter URAID.\n");
|
||||
exit(-1);
|
||||
}
|
||||
/* comm read */
|
||||
URaid_errmess=cp;
|
||||
printf("\n*Error* %s\n",cp);
|
||||
fflush(stdin);
|
||||
printf("Enter the URaid\n");
|
||||
print(Uraid_mess); putchar('\n');
|
||||
URaid_currentFX=URMAXFXNUM +1;
|
||||
memset(URaid_FXarray, 0, URMAXFXNUM *4);
|
||||
#define URMAXCOMM 512
|
||||
int error(char *cp) {
|
||||
char *ptr;
|
||||
if (device_before_raid() < 0) {
|
||||
printf("Can't Enter URAID.\n");
|
||||
exit(-1);
|
||||
}
|
||||
/* comm read */
|
||||
URaid_errmess = cp;
|
||||
printf("\n*Error* %s\n", cp);
|
||||
fflush(stdin);
|
||||
printf("Enter the URaid\n");
|
||||
print(Uraid_mess);
|
||||
putchar('\n');
|
||||
URaid_currentFX = URMAXFXNUM + 1;
|
||||
memset(URaid_FXarray, 0, URMAXFXNUM * 4);
|
||||
#ifndef DOS
|
||||
{
|
||||
int stat = fcntl(fileno(stdin), F_GETFL, 0);
|
||||
if (stat != O_RDONLY && stat != O_RDWR)
|
||||
if (freopen("/dev/tty", "r", stdin) == NULL)
|
||||
{
|
||||
perror("Reopen of stdin failed.");
|
||||
exit(0);
|
||||
}
|
||||
{
|
||||
int stat = fcntl(fileno(stdin), F_GETFL, 0);
|
||||
if (stat != O_RDONLY && stat != O_RDWR)
|
||||
if (freopen("/dev/tty", "r", stdin) == NULL) {
|
||||
perror("Reopen of stdin failed.");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
#endif /* DOS */
|
||||
uraidloop:
|
||||
if(setjmp(BT_jumpbuf) == 1) goto uraidloop;
|
||||
if(setjmp(SD_jumpbuf) == 1) goto uraidloop;
|
||||
for(;;)
|
||||
{ /* URAID LOOP */
|
||||
if (setjmp(BT_jumpbuf) == 1) goto uraidloop;
|
||||
if (setjmp(SD_jumpbuf) == 1) goto uraidloop;
|
||||
for (;;) { /* URAID LOOP */
|
||||
|
||||
uraid_commclear();
|
||||
BT_temp = 0; /* So we get the "more" option on screen-full */
|
||||
printf("\n< ");
|
||||
for( ptr=URaid_inputstring;( *ptr= getchar() ) != '\n' ; ptr++) {}
|
||||
URaid_argnum = sscanf(URaid_inputstring,
|
||||
"%1s%s%s",&URaid_comm, URaid_arg1, URaid_arg2);
|
||||
uraid_commclear();
|
||||
BT_temp = 0; /* So we get the "more" option on screen-full */
|
||||
printf("\n< ");
|
||||
for (ptr = URaid_inputstring; (*ptr = getchar()) != '\n'; ptr++) {}
|
||||
URaid_argnum = sscanf(URaid_inputstring, "%1s%s%s", &URaid_comm, URaid_arg1, URaid_arg2);
|
||||
|
||||
if(uraid_commands()==NIL) break;
|
||||
} /* for end */
|
||||
if (uraid_commands() == NIL) break;
|
||||
} /* for end */
|
||||
|
||||
/**TopOfStack = NIL;if error is called from subr TOS will be set NIL**/
|
||||
if(device_after_raid() <0)
|
||||
{
|
||||
printf("Can't return to Lisp. Return to UNIX?");
|
||||
{ int c;
|
||||
c= getchar();
|
||||
if((c=='Y')||(c=='y')) exit(-1);
|
||||
}
|
||||
fflush(stdin);
|
||||
goto uraidloop;
|
||||
}
|
||||
return (0);
|
||||
/**TopOfStack = NIL;if error is called from subr TOS will be set NIL**/
|
||||
if (device_after_raid() < 0) {
|
||||
printf("Can't return to Lisp. Return to UNIX?");
|
||||
{
|
||||
int c;
|
||||
c = getchar();
|
||||
if ((c == 'Y') || (c == 'y')) exit(-1);
|
||||
}
|
||||
fflush(stdin);
|
||||
goto uraidloop;
|
||||
}
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
@@ -153,51 +138,41 @@ uraidloop:
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
void warn(s)
|
||||
char *s;
|
||||
{ printf("\nWARN: %s \n",s); }
|
||||
|
||||
|
||||
|
||||
void warn(s) char *s;
|
||||
{ printf("\nWARN: %s \n", s); }
|
||||
|
||||
/*****************************************************************
|
||||
stackcheck
|
||||
|
||||
common sub-routine.
|
||||
common sub-routine.
|
||||
|
||||
Not Implemented.
|
||||
Not Implemented.
|
||||
|
||||
1.check Stack overflow.
|
||||
(check CurrentStackPTR)
|
||||
2.if overflow, return T (not 0).
|
||||
Otherwise, return F (0).
|
||||
1.check Stack overflow.
|
||||
(check CurrentStackPTR)
|
||||
2.if overflow, return T (not 0).
|
||||
Otherwise, return F (0).
|
||||
******************************************************************/
|
||||
int stackcheck()
|
||||
{
|
||||
#ifdef TRACE2
|
||||
printf("TRACE:stackcheck()\n");
|
||||
int stackcheck() {
|
||||
#ifdef TRACE2
|
||||
printf("TRACE:stackcheck()\n");
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
stackoverflow
|
||||
|
||||
common sub-routine.
|
||||
common sub-routine.
|
||||
|
||||
Not Implemented.
|
||||
Not Implemented.
|
||||
|
||||
1.error handling of stack overflow.
|
||||
1.error handling of stack overflow.
|
||||
******************************************************************/
|
||||
|
||||
void stackoverflow()
|
||||
{
|
||||
#ifdef TRACE2
|
||||
printf("TRACE:stackoverflow()\n");
|
||||
void stackoverflow() {
|
||||
#ifdef TRACE2
|
||||
printf("TRACE:stackoverflow()\n");
|
||||
#endif
|
||||
printf("stackoverflow \n");
|
||||
}
|
||||
|
||||
printf("stackoverflow \n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user