Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up bootlib a bit #290

Merged
merged 5 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions unix/boot/bootProto.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#define import_knames
#include <iraf.h>


void BYTMOV (XCHAR *a, XINT *aoff, XCHAR *b, XINT *boff, XINT *nbytes);

void loadpkgenv (char *pkg);
void _envinit (void);
void loadenv (char *osfn);
Expand All @@ -18,7 +15,6 @@ char *rindex (char *str, int ch);
#endif

int os_access (char *fname, int mode, int type);
void os_amovb (char *a, char *b, int nbytes);
int os_chdir (char *dir);
void os_close (int fd);
int os_cmd (char *cmd);
Expand Down
12 changes: 6 additions & 6 deletions unix/boot/bootlib/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
OBJS = bytmov.o oscmd.o osfdate.o osopen.o osstrpak.o oswrite.o \
envinit.o oscreatedir.o osfiletype.o osputenv.o osstrupk.o tape.o \
osaccess.o oscrfile.o osfn2vfn.o osread.o ossubdir.o vfn2osfn.o \
osamovb.o osdelete.o osfpathname.o ossetfmode.o ossymlink.o \
oschdir.o osdir.o osgetenv.o ossetowner.o ossysfile.o osclose.o \
osfcopy.o osgetowner.o ossettime.o ostime.o
OBJS = oscmd.o osfdate.o osopen.o osstrpak.o oswrite.o envinit.o \
oscreatedir.o osfiletype.o osputenv.o osstrupk.o tape.o osaccess.o \
oscrfile.o osfn2vfn.o osread.o ossubdir.o vfn2osfn.o osdelete.o \
osfpathname.o ossetfmode.o ossymlink.o oschdir.o osdir.o osgetenv.o \
ossetowner.o ossysfile.o osclose.o osfcopy.o osgetowner.o \
ossettime.o ostime.o


libboot.a: $(OBJS)
Expand Down
22 changes: 15 additions & 7 deletions unix/boot/bootlib/bootlib.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
#include <stdio.h>
#ifdef NOVOS
#include <ctype.h>
#endif

#define import_spp
#define NOKNET
#define import_knames
#define import_kproto
#define import_kernel
#ifndef NOVOS
#define NOLIBCNAMES
#define import_libc
#define import_ctype
#define import_vosproto
#endif
#include <iraf.h>

#include "../bootProto.h"

char *_os_getenv (char *envvar, char *outstr, int maxch);

#define SZ_FBUF 512 /* File i/o buffer size */

#include <sys/time.h>


# ifdef FINIT
int bdebug = 0; /* print debug stuff */
int osfiletype; /* type of single output file */
Expand All @@ -21,8 +34,3 @@ extern int osfiletype;
extern XCHAR text[];
extern XCHAR *txop;
# endif

char *vfn2osfn(char *vfn, int new);
char *osfn2vfn(char *osfn);
char *os_strpak(short int *sppstr, char *cstr, int maxch);
XCHAR *os_strupk(char *str, short int *outstr, int maxch);
26 changes: 0 additions & 26 deletions unix/boot/bootlib/bytmov.c

This file was deleted.

22 changes: 2 additions & 20 deletions unix/boot/bootlib/envinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,16 @@

#include <stdio.h>
#include <string.h>
#define import_spp
#define import_xnames
#include <iraf.h>

#define isspace(c) ((c)==' '||(c)=='\t'||(c)=='\n')
#include "bootlib.h"

#define SETENV "zzsetenv.def"
#define SZ_VALUE SZ_COMMAND
#define MAXLEV 8
#define PKGLIBS "pkglibs"
#define IRAFARCH "IRAFARCH"
#define ARCH "arch"

extern char *_os_getenv (char *envvar, char *outstr, int maxch);
extern char *os_getenv (char *envvar);
extern char *os_strpak (XCHAR *sppstr, char *cstr, int maxch);
extern char *vfn2osfn (char *vfn, int new);
extern XCHAR *os_strupk (char *str, XCHAR *outstr, int maxch);
extern void os_putenv (char *name, char *value);
extern int bdebug;

void _envinit (void);
void loadenv (char *osfn);



/* LOADPKGENV -- Load the environment definitions for the named package.
* [e.g., loadpkgenv ("noao")]. This assumes that the root directory of
Expand Down Expand Up @@ -112,8 +98,6 @@ _envinit (void)
char osfn[SZ_PATHNAME+1], *hlib;
char irafarch[SZ_PATHNAME+1];

extern void ENVINIT(void), ENVRESET(XCHAR *key, XCHAR *value);


if (initialized++)
return;
Expand Down Expand Up @@ -161,8 +145,6 @@ loadenv (char *osfn)
FILE *fp, *sv_fp[MAXLEV];
int lev=0;

extern void ENVRESET(XCHAR *key, XCHAR *value);


if ((fp = fopen (osfn, "r")) == NULL) {
printf ("envinit: cannot open `%s'\n", osfn);
Expand Down
80 changes: 0 additions & 80 deletions unix/boot/bootlib/kproto32.h

This file was deleted.

80 changes: 0 additions & 80 deletions unix/boot/bootlib/kproto64.h

This file was deleted.

3 changes: 0 additions & 3 deletions unix/boot/bootlib/mkpkg
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ $exit

libboot.a:
$set XFLAGS = "-c $(HSI_XF)"
bytmov.c
osamovb.c

envinit.c

osaccess.c bootlib.h
Expand Down
3 changes: 0 additions & 3 deletions unix/boot/bootlib/osaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ os_access (
PKCHAR osfn[SZ_PATHNAME+1];
XINT status, xmode=mode, xtype=type;

extern int ZFACSS(PKCHAR *fname, XINT *mode, XINT *type, XINT *status);


strcpy ((char *)osfn, vfn2osfn(fname,0));
ZFACSS (osfn, &xmode, &xtype, &status);

Expand Down
36 changes: 0 additions & 36 deletions unix/boot/bootlib/osamovb.c

This file was deleted.

9 changes: 0 additions & 9 deletions unix/boot/bootlib/oschdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#include "bootlib.h"


extern int os_fpathname (char *vfn, char *osfn, int maxch);



/* OS_CHDIR -- Change the current default directory. Note that the kernel
* procedure ZFCHDR should only be called with the full pathname of a
* directory.
Expand All @@ -19,11 +15,6 @@ os_chdir (char *dir)
XCHAR osdir[SZ_PATHNAME+1];
XINT sz_osdir, status, x_maxch=SZ_PATHNAME;

extern int ZFXDIR(XCHAR *osfn, XCHAR *osdir, XINT *maxch, XINT *nchars);
extern int ZFGCWD(PKCHAR *outstr, XINT *maxch, XINT *status);
extern int ZFSUBD(XCHAR *osdir, XINT *maxch, XCHAR *subdir, XINT *nchars);
extern int ZFCHDR(PKCHAR *newdir, XINT *status);


os_fpathname (dir, (char *)dpath, SZ_PATHNAME);
os_strupk ((char *)dpath, osdir, SZ_PATHNAME);
Expand Down
Loading