1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-28 12:39:28 +00:00

Reformat all C source files with Clang-format in Google style w/ 100 col width.

This commit is contained in:
Nick Briggs
2017-05-28 18:08:18 -07:00
parent 691645d048
commit 156c3292f8
167 changed files with 40520 additions and 48069 deletions

119
src/setsout.c Executable file → Normal file
View File

@@ -1,7 +1,7 @@
/* $Id: setsout.c,v 1.3 1999/05/31 23:35:41 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
/* $Id: setsout.c,v 1.3 1999/05/31 23:35:41 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
*/
static char *id = "$Id: setsout.c,v 1.3 1999/05/31 23:35:41 sybalsky Exp $ Copyright (C) Venue";
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
@@ -16,7 +16,6 @@ static char *id = "$Id: setsout.c,v 1.3 1999/05/31 23:35:41 sybalsky Exp $ Copyr
#include "version.h"
/*
* setsout.c
*/
@@ -42,77 +41,71 @@ static char *id = "$Id: setsout.c,v 1.3 1999/05/31 23:35:41 sybalsky Exp $ Copyr
#include "ifpage.h"
#include "dbprint.h"
#define IFPAGE_ADDRESS 512
#define MBYTE 0x100000 /* 1 Mbyte */
extern int errno;
#define IFPAGE_ADDRESS 512
#define MBYTE 0x100000 /* 1 Mbyte */
extern int errno;
/* JDS protoize char *valloc(size_t); */
void set_sysout(int version, char *sysout_file_name)
{
int sysout; /* SysoutFile descriptor */
IFPAGE ifpage; /* IFPAGE */
char errmsg [ 255 ];
void set_sysout(int version, char *sysout_file_name) {
int sysout; /* SysoutFile descriptor */
IFPAGE ifpage; /* IFPAGE */
char errmsg[255];
/*
* first read the IFPAGE(InterfacePage)
*/
/*
* first read the IFPAGE(InterfacePage)
*/
/* open SysoutFile */
sysout = open(sysout_file_name, O_RDWR, NULL);
if (sysout == -1) {
sprintf( errmsg,
"sysout_loader: can't open sysout file: %s",
sysout_file_name);
perror( errmsg );
exit(-1);
}
/* seek to IFPAGE */
if (lseek(sysout, IFPAGE_ADDRESS, 0) == -1) {
perror("sysout_loader: can't seek to IFPAGE");
exit(-1);
}
/* reads IFPAGE into scratch_page */
if (read(sysout, &ifpage, sizeof(IFPAGE)) == -1) {
perror("sysout_loader: can't read IFPAGE");
exit(-1);
}
/* open SysoutFile */
sysout = open(sysout_file_name, O_RDWR, NULL);
if (sysout == -1) {
sprintf(errmsg, "sysout_loader: can't open sysout file: %s", sysout_file_name);
perror(errmsg);
exit(-1);
}
/* seek to IFPAGE */
if (lseek(sysout, IFPAGE_ADDRESS, 0) == -1) {
perror("sysout_loader: can't seek to IFPAGE");
exit(-1);
}
/* reads IFPAGE into scratch_page */
if (read(sysout, &ifpage, sizeof(IFPAGE)) == -1) {
perror("sysout_loader: can't read IFPAGE");
exit(-1);
}
#ifdef BYTESWAP
word_swap_page(&ifpage, (3+sizeof(IFPAGE))/4);
word_swap_page(&ifpage, (3 + sizeof(IFPAGE)) / 4);
#endif
ifpage.lversion = version;
ifpage.minbversion = version;
ifpage.lversion = version;
ifpage.minbversion = version;
/* seek to IFPAGE */
if (lseek(sysout, IFPAGE_ADDRESS, 0) == -1) {
perror("sysout_loader: can't seek to IFPAGE");
exit(-1);
}
/* reads IFPAGE into scratch_page */
if (write(sysout, &ifpage, sizeof(IFPAGE)) == -1) {
perror("Can't write IFPAGE");
exit(-1);
}
/* seek to IFPAGE */
if (lseek(sysout, IFPAGE_ADDRESS, 0) == -1) {
perror("sysout_loader: can't seek to IFPAGE");
exit(-1);
}
/* reads IFPAGE into scratch_page */
if (write(sysout, &ifpage, sizeof(IFPAGE)) == -1) {
perror("Can't write IFPAGE");
exit(-1);
}
close(sysout);
printf("%d", ifpage.minbversion);
close(sysout);
printf("%d", ifpage.minbversion);
}
int main(int argc, char **argv)
{
int version, res;
if (argc < 3)
{
printf("setsysout version sysout-name\n");
return(-1);
}
if ((version = atoi(argv[1])) == 0)
{
printf("version must be an integer > 0.\n");
return(-1);
}
set_sysout(version, argv[2]);
exit(0);
int main(int argc, char **argv) {
int version, res;
if (argc < 3) {
printf("setsysout version sysout-name\n");
return (-1);
}
if ((version = atoi(argv[1])) == 0) {
printf("version must be an integer > 0.\n");
return (-1);
}
set_sysout(version, argv[2]);
exit(0);
}