Reformat .h files.
I did my best to exempt some of the bigger aligned blocks from the reformatting using the /* clang-format off */ and /* clang-format on */ tags. Probably some that shouldn't have been formatted were anyway; if you encounter them, please fix. The clang-format tags were left in on the basis that it's much easier to prune those out later than to put them back in, and it means that, modulo my custom version of clang-format, I should be able to run clang-format on the source tree again without changing anything, now that Pat has fixed the VA_DECL issues.
This commit is contained in:
128
include/dlb.h
128
include/dlb.h
@@ -12,59 +12,58 @@
|
||||
|
||||
/* implementations */
|
||||
#ifdef MAC
|
||||
# define DLBRSRC /* use Mac resources */
|
||||
#define DLBRSRC /* use Mac resources */
|
||||
#else
|
||||
# define DLBLIB /* use a set of external files */
|
||||
#define DLBLIB /* use a set of external files */
|
||||
#endif
|
||||
|
||||
#ifdef DLBLIB
|
||||
/* directory structure in memory */
|
||||
typedef struct dlb_directory {
|
||||
char *fname; /* file name as seen from calling code */
|
||||
long foffset; /* offset in lib file to start of this file */
|
||||
long fsize; /* file size */
|
||||
char handling; /* how to handle the file (compression, etc) */
|
||||
char *fname; /* file name as seen from calling code */
|
||||
long foffset; /* offset in lib file to start of this file */
|
||||
long fsize; /* file size */
|
||||
char handling; /* how to handle the file (compression, etc) */
|
||||
} libdir;
|
||||
|
||||
/* information about each open library */
|
||||
typedef struct dlb_library {
|
||||
FILE *fdata; /* opened data file */
|
||||
long fmark; /* current file mark */
|
||||
libdir *dir; /* directory of library file */
|
||||
char *sspace; /* pointer to string space */
|
||||
long nentries; /* # of files in directory */
|
||||
long rev; /* dlb file revision */
|
||||
long strsize; /* dlb file string size */
|
||||
FILE *fdata; /* opened data file */
|
||||
long fmark; /* current file mark */
|
||||
libdir *dir; /* directory of library file */
|
||||
char *sspace; /* pointer to string space */
|
||||
long nentries; /* # of files in directory */
|
||||
long rev; /* dlb file revision */
|
||||
long strsize; /* dlb file string size */
|
||||
} library;
|
||||
|
||||
/* library definitions */
|
||||
# ifndef DLBFILE
|
||||
# define DLBFILE "nhdat" /* name of library */
|
||||
# endif
|
||||
# ifndef FILENAME_CMP
|
||||
# define FILENAME_CMP strcmp /* case sensitive */
|
||||
# endif
|
||||
#ifndef DLBFILE
|
||||
#define DLBFILE "nhdat" /* name of library */
|
||||
#endif
|
||||
#ifndef FILENAME_CMP
|
||||
#define FILENAME_CMP strcmp /* case sensitive */
|
||||
#endif
|
||||
|
||||
#endif /* DLBLIB */
|
||||
|
||||
|
||||
typedef struct dlb_handle {
|
||||
FILE *fp; /* pointer to an external file, use if non-null */
|
||||
FILE *fp; /* pointer to an external file, use if non-null */
|
||||
#ifdef DLBLIB
|
||||
library *lib; /* pointer to library structure */
|
||||
long start; /* offset of start of file */
|
||||
long size; /* size of file */
|
||||
long mark; /* current file marker */
|
||||
library *lib; /* pointer to library structure */
|
||||
long start; /* offset of start of file */
|
||||
long size; /* size of file */
|
||||
long mark; /* current file marker */
|
||||
#endif
|
||||
#ifdef DLBRSRC
|
||||
int fd; /* HandleFile file descriptor */
|
||||
int fd; /* HandleFile file descriptor */
|
||||
#endif
|
||||
} dlb;
|
||||
|
||||
#if defined(ULTRIX_PROTO) && !defined(__STDC__)
|
||||
/* buggy old Ultrix compiler wants this for the (*dlb_fread_proc)
|
||||
and (*dlb_fgets_proc) prototypes in struct dlb_procs (dlb.c);
|
||||
we'll use it in all the declarations for consistency */
|
||||
/* buggy old Ultrix compiler wants this for the (*dlb_fread_proc)
|
||||
and (*dlb_fgets_proc) prototypes in struct dlb_procs (dlb.c);
|
||||
we'll use it in all the declarations for consistency */
|
||||
#define DLB_P struct dlb_handle *
|
||||
#else
|
||||
#define DLB_P dlb *
|
||||
@@ -73,71 +72,70 @@ typedef struct dlb_handle {
|
||||
boolean NDECL(dlb_init);
|
||||
void NDECL(dlb_cleanup);
|
||||
|
||||
dlb *FDECL(dlb_fopen, (const char *,const char *));
|
||||
dlb *FDECL(dlb_fopen, (const char *, const char *));
|
||||
int FDECL(dlb_fclose, (DLB_P));
|
||||
int FDECL(dlb_fread, (char *,int,int,DLB_P));
|
||||
int FDECL(dlb_fseek, (DLB_P,long,int));
|
||||
char *FDECL(dlb_fgets, (char *,int,DLB_P));
|
||||
int FDECL(dlb_fread, (char *, int, int, DLB_P));
|
||||
int FDECL(dlb_fseek, (DLB_P, long, int));
|
||||
char *FDECL(dlb_fgets, (char *, int, DLB_P));
|
||||
int FDECL(dlb_fgetc, (DLB_P));
|
||||
long FDECL(dlb_ftell, (DLB_P));
|
||||
|
||||
|
||||
/* Resource DLB entry points */
|
||||
#ifdef DLBRSRC
|
||||
boolean rsrc_dlb_init(void);
|
||||
void rsrc_dlb_cleanup(void);
|
||||
boolean rsrc_dlb_fopen(dlb *dp, const char *name, const char *mode);
|
||||
int rsrc_dlb_fclose(dlb *dp);
|
||||
int rsrc_dlb_fread(char *buf, int size, int quan, dlb *dp);
|
||||
int rsrc_dlb_fseek(dlb *dp, long pos, int whence);
|
||||
char *rsrc_dlb_fgets(char *buf, int len, dlb *dp);
|
||||
int rsrc_dlb_fgetc(dlb *dp);
|
||||
long rsrc_dlb_ftell(dlb *dp);
|
||||
boolean rsrc_dlb_init(void);
|
||||
void rsrc_dlb_cleanup(void);
|
||||
boolean rsrc_dlb_fopen(dlb *dp, const char *name, const char *mode);
|
||||
int rsrc_dlb_fclose(dlb *dp);
|
||||
int rsrc_dlb_fread(char *buf, int size, int quan, dlb *dp);
|
||||
int rsrc_dlb_fseek(dlb *dp, long pos, int whence);
|
||||
char *rsrc_dlb_fgets(char *buf, int len, dlb *dp);
|
||||
int rsrc_dlb_fgetc(dlb *dp);
|
||||
long rsrc_dlb_ftell(dlb *dp);
|
||||
#endif
|
||||
|
||||
|
||||
#else /* DLB */
|
||||
|
||||
# define dlb FILE
|
||||
#define dlb FILE
|
||||
|
||||
# define dlb_init()
|
||||
# define dlb_cleanup()
|
||||
#define dlb_init()
|
||||
#define dlb_cleanup()
|
||||
|
||||
# define dlb_fopen fopen
|
||||
# define dlb_fclose fclose
|
||||
# define dlb_fread fread
|
||||
# define dlb_fseek fseek
|
||||
# define dlb_fgets fgets
|
||||
# define dlb_fgetc fgetc
|
||||
# define dlb_ftell ftell
|
||||
#define dlb_fopen fopen
|
||||
#define dlb_fclose fclose
|
||||
#define dlb_fread fread
|
||||
#define dlb_fseek fseek
|
||||
#define dlb_fgets fgets
|
||||
#define dlb_fgetc fgetc
|
||||
#define dlb_ftell ftell
|
||||
|
||||
#endif /* DLB */
|
||||
|
||||
|
||||
/* various other I/O stuff we don't want to replicate everywhere */
|
||||
|
||||
#ifndef SEEK_SET
|
||||
# define SEEK_SET 0
|
||||
#define SEEK_SET 0
|
||||
#endif
|
||||
#ifndef SEEK_CUR
|
||||
# define SEEK_CUR 1
|
||||
#define SEEK_CUR 1
|
||||
#endif
|
||||
#ifndef SEEK_END
|
||||
# define SEEK_END 2
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#define RDTMODE "r"
|
||||
#if (defined(MSDOS) || defined(WIN32) || defined(TOS) || defined(OS2)) && defined(DLB)
|
||||
#if (defined(MSDOS) || defined(WIN32) || defined(TOS) || defined(OS2)) \
|
||||
&& defined(DLB)
|
||||
#define WRTMODE "w+b"
|
||||
#else
|
||||
#define WRTMODE "w+"
|
||||
#endif
|
||||
#if (defined(MICRO) && !defined(AMIGA)) || defined(THINK_C) || defined(__MWERKS__) || defined(WIN32)
|
||||
# define RDBMODE "rb"
|
||||
# define WRBMODE "w+b"
|
||||
#if (defined(MICRO) && !defined(AMIGA)) || defined(THINK_C) \
|
||||
|| defined(__MWERKS__) || defined(WIN32)
|
||||
#define RDBMODE "rb"
|
||||
#define WRBMODE "w+b"
|
||||
#else
|
||||
# define RDBMODE "r"
|
||||
# define WRBMODE "w+"
|
||||
#define RDBMODE "r"
|
||||
#define WRBMODE "w+"
|
||||
#endif
|
||||
|
||||
#endif /* DLB_H */
|
||||
#endif /* DLB_H */
|
||||
|
||||
Reference in New Issue
Block a user