home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
WINSFILE.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-03
|
3KB
|
88 lines
/*
winsfile.h
% window sfile header (public stuff)
OWL 1.2
Copyright (c) 1986-1990 by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
---------------------
8/11/89 jdc split from sfile.h
3/28/90 jmd ansi-fied
4/15/90 jdc added sfile_ReadOnly, preened
6/06/90 jdc changed SFILE_COMMENT to CSVER 3.2
8/10/90 jdc added sfile_Contains()
8/12/90 jdc added opendata arg to sf_loadobj
8/13/90 jdc added loaddefault_classfunc
9/26/90 jmd added load/save text functions
10/28/90 jdc added bfile_GetID macro
12/03/90 jdc changed readonly's to onlyread's
*/
#include "bfdecl.h"
#define FSYM_NULLSTR ""
#define fsym_NullCheck(name) (((name) == NULL) ? FSYM_NULLSTR : (name))
#define ID_LNFWIN 801
#define SFILE_BSIZE 500
#define SFILE_BUFLEN 1000
#define SFILE_COMMENT "CSVER 3.2"
typedef struct sfile_struct {
bfile_type bfile;
oslist_type oslist_array[TOT_FSYM_COUNT];
unsigned int oslist_owner:1;
unsigned int alloc:1; /* for sed data allocation */
char buf[SFILE_BUFLEN + 1];
} *sfile_type;
/* -------------------------------------------------------------------------- */
/* function prototypes */
/* OBJLOAD.C (in the c-scape library) */
OEXTERN class_fptr loaddefault_classfunc;
extern obj_type sfile_LoadObj(sfile_type sfile, char *name, VOID *opendata);
extern obj_type sf_loadobj(sfile_type sfile, char *name, VOID *opendata);
extern boolean sfile_SaveObj(sfile_type sfile, obj_type obj, char *name);
extern boolean sf_saveobj(sfile_type sfile, obj_type obj);
/* SFILE.C (in the c-scape library) */
extern sfile_type sf_open(char *name, fsyminit_struct *fsyminit_list, oslist_type *oslist_array, char *comment, boolean onlyread);
extern void sfile_Close(sfile_type sfile);
/* WINSAVE.C */
extern boolean sfile_SaveComment(sfile_type sfile, char *comment);
extern char *strnewlclip(char *s);
/* SFILTEXT.C */
extern char *sfile_LoadText(sfile_type sfile, char *name);
extern boolean sfile_SaveText(sfile_type sfile, char *name, char *text);
/* -------------------------------------------------------------------------- */
/* macros */
#define sfile_Open(name, fsyminit) sf_open(name, fsyminit, NULL, SFILE_COMMENT, FALSE)
#define sfile_ReadOnly(name, fsyminit) sf_open(name, fsyminit, NULL, SFILE_COMMENT, TRUE)
#define sfile_LoadComment(sf, b, blen) bf_gets(sf->bfile, b, blen, '\0')
#define sfile_Find(sf, name, type) bfile_Find((sf)->bfile, name, type)
#define sfile_GetDirList(sf) bfile_GetDirList((sf)->bfile)
#define sfile_GetDirSize(sf) bfile_GetDirSize((sf)->bfile)
#define sfile_GetDirAlpha(sf, a) bfile_GetDirAlpha((sf)->bfile, a)
#define sfile_GetID(sf, h) bfile_GetID((sf)->bfile, h)
#define sfile_Contains(sf, name) \
((bfile_FindDirHandle((sf)->bfile, name) != OSLIST_BADNAME) ? TRUE:FALSE)