?? cff.txt
字號:
int cfappundef(
char *keyptr // the key to a defined string
)
Deletes a definition string from the permanent application dictionary.
Returns OK or ERROR
int cftrn(
char *input_string,
char **output_string
)
Translates the input string to the output string using the dictionaries.
The programmer must free the output string.
Returns OK or ERROR
int cfpathtrn(
char *input_string,
char **output_string
)
Translates the input string to a fully qualified path, using the dictionaries
and the current working directory.
The programmer must free the output string.
Returns 0 if internal object, 1 if external file, 2 if filesys, 3 if rawdevice
Returns ERROR if trouble.
int cfchdir(
char *newpath
)
Change the current working directory.
Returns OK or ERROR
NOTE: to get the current working directory:
{
char *cwd;
cfpathtrn(".", &cwd);
...
free(cwd);
}
NOTE: CFF does not include disk drive prefixes in the cwd, the programmer
may include them when opening a file or filesystem.
NOTE: The translator works mostly on the left hand side of a path;
it first tries to translate the whole input string, then it expands
the left hand side up to 10 times, then it tries to translate the
whole result string. Would a macro facility be helpful?
STREAM I/O
The standard flavors of opening stream files are supported.
There are several new modes for opening and reopening files.
Mode Meaning
"x" Open a string, (put the string in place of the filename)
"U" Create a unique file, (supply a directory path as the filename)
"T" Open a temporary file, deleted on close.
"M" Open a file in memory.
"s" Open a file in 'stat' mode, i.e. parents are also readonly.
"t" Open file in 'text' mode, default is binary.
"b" Open file in binary mode, default (to be msdos compatible).
As with cfopen, the stream handlers can open chunks and values for reading.
/* STDIO STUFF */
#define __BUFSIZ_ 512
extern struct cf_iobuf {
int _cnt;
char* _ptr;
char* _base;
int _bufsiz;
int _flag;
void * _file; // cff handle
char _sbuf;
} cf_iob[];
typedef struct cf_iobuf cfFILE;
#define cf_IOFBF 00000
#define cf_IOREAD 00001
#define cf_IOWRT 00002
#define cf_IONBF 00004
#define cf_IOMYBUF 00010
#define cf_IOEOF 00020
#define cf_IOERR 00040
#define cf_IOSTRG 00100
#define cf_IOLBF 00200
#define cf_IORW 00400
#define cf_IOAPPEND 01000
#define cf_IOTEXT 02000 /* for MSDOS cr/lf style files */
#define cfstdin (&cf_iob[0])
#define cfstdout (&cf_iob[1])
#define cfstderr (&cf_iob[2])
#define cfstdaux (&cf_iob[3])
#define cfstdprn (&cf_iob[4])
#define cfgetc(p) (--(p)->_cnt>=0 ? \
(int)(*(unsigned char*)(p)->_ptr++) : \
cf_filbuf(p))
#define cfputc(x,p) (--(p)->_cnt>=0? \
((int)((unsigned char)((*(p)->_ptr++=(unsigned)(x))))): \
cf_flsbuf((unsigned)(x),p))
#define cfclearerr(p) ((p)->_flag &= ~(cf_IOERR|cf_IOEOF))
#define cfgetchar() cfgetc(cfstdin)
#define cfputchar(x) cfputc(x,cfstdout)
#define cffeof(p) (((p)->_flag&cf_IOEOF)!=0)
#define cfferror(p) (((p)->_flag&cf_IOERR)!=0)
#define cffileno(p) (cf_filelist[(p)->_file])
cfFILE* cffopen(char *something, char *mode);
cfFILE* cffreopen(char *something, char *mode, cfFILE *iop);
cfFILE* cffdopen(void *handle, char *mode);
int cf_filbuf(cfFILE*);
int cf_flsbuf(unsigned, cfFILE*);
int cffclose(cfFILE*);
int cffflush(cfFILE*);
int cffgetc(cfFILE*);
char* cffgets(char*, int, cfFILE *);
int cffputc(int, cfFILE*);
int cffputs(char*, cfFILE*);
int cffread(void*, int, int, cfFILE*);
int cffseek(cfFILE*, long, int);
long cfftell(cfFILE *);
int cfsetpos(cfFILE *, long *);
int cfgetpos(cfFILE *, long *);
cfFILE *cftmpfile(void);
char *cftmpnam(char *buf);
char *cftempnam(char *dir, char *pref);
int cffwrite(void*, int, int, cfFILE*);
char* cfgets(char*);
int cfgetw(cfFILE*);
int cfputs(char*);
int cfputw(int, cfFILE*);
void cfrewind(cfFILE*);
int cfsetbuf(cfFILE*, char*);
int cfsetbuffer(cfFILE*, char*, int);
int cfsetlinebuf(cfFILE*);
int cfsetvbuf(cfFILE*, char*, int, int);
int cfungetc(int, cfFILE*);
int cfprintf(const char *fmt, ...);
int cfeprintf(const char *fmt, ...);
int cffprintf(cfFILE *iop, const char *fmt, ...);
int cfsprintf(char *str, const char *fmt, ...);
int cfvprintf(void *fmt, ...);
int cfvfprintf(cfFILE *iop, const char *fmt, ...);
int cfvsprintf(char *str, const char *fmt, ...);
int cfsscanf(char *str, const char *fmt, ...);
int cffscanf(cfFILE *iop, const char *fmt, ...);
int cfscanf(const char *fmt, ...);
DATA COMPRESSION
int cfzip(
void *something_dst, // path, handle or memory address
int dstsize, // if non zero the size of destination MEMORY buf
void *something_src, // path, handle or memory address
int srcsize, // if non zero the size of the source MEMORY buf
)
If something_dst is NULL, then no output is generated. Use to get final size.
Returns compressed size or ERROR.
NOTE: If nonzero, srcsize and dstsize imply that a memory address is in
the something_dst or something_src arg.
int cfunzip(
void *something_dst, // path, handle or memory address
int dstsize, // if non zero the size of destination MEMORY buf
void *something_src, // path, handle or memory address
int srcsize // if non zero the size of the source MEMORY buf
)
If something_dst is NULL, then no output is generated. Use to get final size.
Returns uncompressed size or ERROR.
NOTE: If nonzero, srcsize and dstsize imply that a memory address is in
the something_dst or something_src arg.
INFORMATIONAL FUNCTIONS
int cflastdupname(
void *handle,
void *keyptr,
int keylen,
DupName *dupname // filled if successful
)
If DupNames exist for the key, 'dupname' is filled with the last one.
Returns OK or ERROR
long cfcountdups(
void *handle,
void *keyptr,
int keylen
)
Returns the actual duplicate count for a key. If DupNames are being used
then the actual count is the last DupName minus the number of prior deletions.
Each DupName key has a deletion counter which is incremented for every
successful delete except cfdelete_lastdupname().
Normal duplicates are just overtly scanned and counted.
int cfstat(
void *something, // a handle or a path
void *stbuf // pointer to a CFSTAT struct
)
returns OK or ERROR
int cfsubstat(
void *handle, // only a handle
char *name, // name of element, a chunk or node
void *stbuf // pointer to a CFSTAT struct
)
returns OK or ERROR
If element is a chunk then OB_CHUNK and M_CHUNK are set and
st_filesize = st_filealloc = size of the chunk. The rest of the stat
info refers to the parent of the element.
typedef struct cffstat {
unsigned long st_smhead;
unsigned long st_smtail;
unsigned short st_id;
unsigned short st_keysize;
STOR st_dups;
unsigned long st_bmhead;
unsigned long st_bmtail;
unsigned long st_mode;
short st_uid;
short st_gid;
long st_mtime;
long st_ctime;
unsigned long st_highleaf;
unsigned long st_size;
unsigned long st_alloc;
unsigned long st_entrycnt;
short st_mapsize;
unsigned short st_dupids;
long st_atime;
long st_filesize;
long st_filealloc;
long st_obtype;
unsigned int st_filedups;
long st_ino;
short st_blksize;
short st_dev;
short st_nlink;
short st_rdev;
} CFSTAT;
/* MODE BITS in st_mode */
#define M_ROOTDIR 0x80000000
#define M_FILEONLY 0x40000000
#define M_HASHDIR 0x20000000
#define M_TREEDIR 0x10000000
#define M_UNTAGGED 0x08000000
#define M_BITMAP 0x04000000
#define M_EXTRNFILE 0x02000000
#define M_PREALLOC 0x01000000
#define M_ZIPFILE 0x00800000
#define M_ZIPDATA 0x00400000
#define M_CHUNK 0x00200000
#define M_IFMT 0x000F0000
#define M_IFDIR 0x00004000
#define M_IFIFO 0x00002000
#define M_IFCHR 0x00001000
#define M_IFBLK 0x00003000
#define M_IFREG 0x00008000
#define M_IREAD 0x00000100
#define M_IWRITE 0x00000080
#define M_IEXEC 0x00000040
long cfentrycnt(
void *something
)
returns the entrycount of a handle or a path, or ERROR
long cfdepth(
void *handle
)
returns treedepth or ERROR
long cfbytesused(
void *handle
)
returns the bytes used in the object or ERROR
long cfbytesalloc(
void *handle
)
returns the bytes allocated to the object or ERROR
long cftotalloc(
void *something,
unsigned long *used,
unsigned long *alloc
)
returns OK if something exists, sets used and alloc to the total space
allocated to the object and all of it's subobjects in 1000's of bytes.
long cfstackdepth(
void *handle
)
returns the current stackdepth of the object or ERROR
long cfcurbufs(
void
)
returns the current allowed localizer buffer space in K bytes.
long cfisnew(
void *handle
)
returns 1 if object is newly created, 0 if not, ERROR if invalid handle
long cffilesize(
void *handle
)
returns the size of the file property of the object or ERROR
long cffilealloc(
void *handle
)
returns the space allocated to the file property or ERROR
long cfprealloc(
void *handle
)
returns the size of each preallocated chunk or 0 or ERROR
long cfmapsize(
void *handle
)
returns the node size of the object or ERROR
long cfalignment(
void *handle
)
returns the alignment for the object (32 is hardwired in version 5.9)
long cfissorted(
void *handle
)
returns 1 if the object is sorted, 0 if not or ERROR
void cfprintbitmaps(
void *something // a path or handle
)
Prints the bitmaps for the target object and it's parents.
void cfprintentries(
void *something // a path or handle
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -