home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Press 1997 July
/
Sezamfile97_1.iso
/
msdos
/
c
/
cbase11.a03
/
CBASE11.ZIP
/
LSEQ
/
LSEQ_.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-01
|
3KB
|
102 lines
/*
* Copyright (c) 1989-1992 Citadel Software, Inc.
* All Rights Reserved
*/
/*man---------------------------------------------------------------------------
NAME
lseq_.h - private header file for lseq library
SYNOPSIS
#include "lseq_.h"
DESCRIPTION
This is a private header file included by the lseq library
modules.
------------------------------------------------------------------------------*/
#ifndef H_LSEQ_ /* prevent multiple includes */
#define H_LSEQ_
/* #ident "@(#)lseq_.h 1.7 - 93/01/01" */
#include <port.h>
/*#define DEBUG /* switch to enable debugging for lseq library */
#include <bool.h>
/* local headers */
#include "lseq.h"
/* tables */
extern lseq_t lsb[LSOPEN_MAX]; /* lseq control structure table declaration */
/* lshdr_t bit flags */
#define LSHMOD (01) /* lseq file being modified */
/* lseq_t bit flags */
#define LSOPEN (03) /* open status bits */
#define LSREAD (01) /* lseq is open for reading */
#define LSWRITE (02) /* lseq is open for writing */
#define LSMOD (04) /* LSHMOD flag set in file header */
#define LSLOCKS (030) /* lock status bits */
#define LSRDLCK (010) /* lseq is read locked */
#define LSWRLCK (020) /* lseq is write locked */
#define LSERR (0100) /* error has occurred on this lseq */
/* function declarations */
#ifdef AC_PROTO
int ls_alloc(lseq_t *lsp);
void ls_free(lseq_t *lsp);
bool ls_valid(lseq_t *lsp);
lsrec_t * ls_rcalloc(lseq_t *lsp);
int ls_rccopy(lseq_t *lsp, lsrec_t *tlsrp, const lsrec_t *slsrp);
void ls_rcfree(lsrec_t *lsrp);
int ls_rcget(lseq_t *lsp, lspos_t lspos, lsrec_t *lsrp);
void ls_rcinit(lseq_t *lsp, lsrec_t *lsrp);
int ls_rcput(lseq_t *lsp, lspos_t lspos, const lsrec_t *lsrp);
int ls_rcputf(lseq_t *lsp, lspos_t lspos, size_t offset,
const void *buf, size_t bufsize);
#else
int ls_alloc();
void ls_free();
bool ls_valid();
lsrec_t * ls_rcalloc();
int ls_rccopy();
void ls_rcfree();
int ls_rcget();
void ls_rcinit();
int ls_rcput();
int ls_rcputf();
#endif /* #ifdef AC_PROTO */
/* macros */
#define ls_blksize(LSP) (offsetof(lsrec_t, recbuf) + (LSP)->lshdr.recsize)
/* lseq open types */
#define LS_READ ("r")
#define LS_RDWR ("r+")
/* error log */
#ifdef DEBUG
#include <errno.h>
#if WINSYS == WS_NONE
#include <stdio.h>
#define LSERRLOG { \
fprintf(stderr, "*** lseq error line %d of %s. errno = %d.\n", \
__LINE__, __FILE__, errno); \
}
#else
#include <xtend.h>
#define BERRLOG { \
errlog(__FILE__, __LINE__, "lseq error."); \
}
#endif
#else
#define LSERRLOG
#endif
#endif /* #ifndef H_LSEQ_ */