1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtinfo: Change to ANSI function definitions

This commit is contained in:
Peter Howkins 2018-06-28 04:15:16 +01:00
parent e239c31702
commit 4cf746f177
25 changed files with 203 additions and 660 deletions

View file

@ -84,8 +84,7 @@ static int bt_meta __P((BTREE *));
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__bt_close(dbp) __bt_close(DB *dbp)
DB *dbp;
{ {
BTREE *t; BTREE *t;
int fd; int fd;
@ -134,9 +133,7 @@ __bt_close(dbp)
* RET_SUCCESS, RET_ERROR. * RET_SUCCESS, RET_ERROR.
*/ */
int int
__bt_sync(dbp, flags) __bt_sync(const DB *dbp, u_int flags)
const DB *dbp;
u_int flags;
{ {
BTREE *t; BTREE *t;
int status; int status;
@ -208,8 +205,7 @@ ecrsr: if (ISSET(t, B_DELCRSR)) {
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
static int static int
bt_meta(t) bt_meta(BTREE *t)
BTREE *t;
{ {
BTMETA m; BTMETA m;
void *p; void *p;

View file

@ -81,10 +81,7 @@ static void mswap __P((PAGE *));
* h: page to convert * h: page to convert
*/ */
void void
__bt_pgin(t, pg, pp) __bt_pgin(void *t, pgno_t pg, void *pp)
void *t;
pgno_t pg;
void *pp;
{ {
PAGE *h; PAGE *h;
int i, top; int i, top;
@ -149,10 +146,7 @@ __bt_pgin(t, pg, pp)
} }
void void
__bt_pgout(t, pg, pp) __bt_pgout(void *t, pgno_t pg, void *pp)
void *t;
pgno_t pg;
void *pp;
{ {
PAGE *h; PAGE *h;
int i, top; int i, top;
@ -223,8 +217,7 @@ __bt_pgout(t, pg, pp)
* p: page to convert * p: page to convert
*/ */
static void static void
mswap(pg) mswap(PAGE *pg)
PAGE *pg;
{ {
char *p; char *p;

View file

@ -84,10 +84,7 @@ static int bt_bdelete __P((BTREE *, const DBT *));
* RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found.
*/ */
int int
__bt_delete(dbp, key, flags) __bt_delete(const DB *dbp, const DBT *key, u_int flags)
const DB *dbp;
const DBT *key;
u_int flags;
{ {
BTREE *t; BTREE *t;
int status; int status;
@ -141,9 +138,7 @@ einval: errno = EINVAL;
* RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found.
*/ */
static int static int
bt_bdelete(t, key) bt_bdelete(BTREE *t, const DBT *key)
BTREE *t;
const DBT *key;
{ {
EPG *e, save; EPG *e, save;
PAGE *h; PAGE *h;
@ -299,10 +294,7 @@ done2: mpool_put(t->bt_mp, h, dirty1);
* RET_SUCCESS, RET_ERROR. * RET_SUCCESS, RET_ERROR.
*/ */
int int
__bt_dleaf(t, h, index) __bt_dleaf(BTREE *t, PAGE *h, int index)
BTREE *t;
PAGE *h;
int index;
{ {
register BLEAF *bl; register BLEAF *bl;
register indx_t *ip, offset; register indx_t *ip, offset;

View file

@ -83,11 +83,7 @@ static char sccsid[] = "@(#)bt_get.c 8.2 (Berkeley) 9/7/93";
* RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found.
*/ */
int int
__bt_get(dbp, key, data, flags) __bt_get(const DB *dbp, const DBT *key, DBT *data, u_int flags)
const DB *dbp;
const DBT *key;
DBT *data;
u_int flags;
{ {
BTREE *t; BTREE *t;
EPG *e; EPG *e;
@ -153,10 +149,7 @@ __bt_get(dbp, key, data, flags)
* The first entry in the tree greater than or equal to key. * The first entry in the tree greater than or equal to key.
*/ */
EPG * EPG *
__bt_first(t, key, exactp) __bt_first(BTREE *t, const DBT *key, int *exactp)
BTREE *t;
const DBT *key;
int *exactp;
{ {
register PAGE *h; register PAGE *h;
register EPG *e; register EPG *e;

View file

@ -106,10 +106,7 @@ static int tmp __P((void));
* *
*/ */
DB * DB *
__bt_open(fname, flags, mode, openinfo, dflags) __bt_open(const char *fname, int flags, int mode, const BTREEINFO *openinfo, int dflags)
const char *fname;
int flags, mode, dflags;
const BTREEINFO *openinfo;
{ {
BTMETA m; BTMETA m;
BTREE *t; BTREE *t;
@ -373,8 +370,7 @@ err: if (t) {
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
static int static int
nroot(t) nroot(BTREE *t)
BTREE *t;
{ {
PAGE *meta, *root; PAGE *meta, *root;
pgno_t npg; pgno_t npg;
@ -406,7 +402,7 @@ nroot(t)
} }
static int static int
tmp() tmp(void)
{ {
sigset_t set, oset; sigset_t set, oset;
int fd; int fd;
@ -426,7 +422,7 @@ tmp()
} }
static int static int
byteorder() byteorder(void)
{ {
u_long x; /* XXX: 32-bit assumption. */ u_long x; /* XXX: 32-bit assumption. */
u_char *p; u_char *p;
@ -444,8 +440,7 @@ byteorder()
} }
int int
__bt_fd(dbp) __bt_fd(const DB *dbp)
const DB *dbp;
{ {
BTREE *t; BTREE *t;

View file

@ -100,12 +100,7 @@ static char sccsid[] = "@(#)bt_overflow.c 8.1 (Berkeley) 6/4/93";
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__ovfl_get(t, p, ssz, buf, bufsz) __ovfl_get(BTREE *t, void *p, size_t *ssz, char **buf, size_t *bufsz)
BTREE *t;
void *p;
size_t *ssz;
char **buf;
size_t *bufsz;
{ {
PAGE *h; PAGE *h;
pgno_t pg; pgno_t pg;
@ -157,10 +152,7 @@ __ovfl_get(t, p, ssz, buf, bufsz)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__ovfl_put(t, dbt, pg) __ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg)
BTREE *t;
const DBT *dbt;
pgno_t *pg;
{ {
PAGE *h, *last; PAGE *h, *last;
void *p; void *p;
@ -210,9 +202,7 @@ __ovfl_put(t, dbt, pg)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__ovfl_delete(t, p) __ovfl_delete(BTREE *t, void *p)
BTREE *t;
void *p;
{ {
PAGE *h; PAGE *h;
pgno_t pg; pgno_t pg;

View file

@ -77,9 +77,7 @@ static char sccsid[] = "@(#)bt_page.c 8.1 (Berkeley) 6/4/93";
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__bt_free(t, h) __bt_free(BTREE *t, PAGE *h)
BTREE *t;
PAGE *h;
{ {
/* Insert the page at the start of the free list. */ /* Insert the page at the start of the free list. */
h->prevpg = P_INVALID; h->prevpg = P_INVALID;
@ -101,9 +99,7 @@ __bt_free(t, h)
* Pointer to a page, NULL on error. * Pointer to a page, NULL on error.
*/ */
PAGE * PAGE *
__bt_new(t, npg) __bt_new(BTREE *t, pgno_t *npg)
BTREE *t;
pgno_t *npg;
{ {
PAGE *h; PAGE *h;

View file

@ -87,11 +87,7 @@ static EPG *bt_fast __P((BTREE *, const DBT *, const DBT *, int *));
* tree and R_NOOVERWRITE specified. * tree and R_NOOVERWRITE specified.
*/ */
int int
__bt_put(dbp, key, data, flags) __bt_put(const DB *dbp, DBT *key, const DBT *data, u_int flags)
const DB *dbp;
DBT *key;
const DBT *data;
u_int flags;
{ {
BTREE *t; BTREE *t;
DBT tkey, tdata; DBT tkey, tdata;
@ -285,10 +281,7 @@ u_long bt_cache_hit, bt_cache_miss;
* EPG for new record or NULL if not found. * EPG for new record or NULL if not found.
*/ */
static EPG * static EPG *
bt_fast(t, key, data, exactp) bt_fast(BTREE *t, const DBT *key, const DBT *data, int *exactp)
BTREE *t;
const DBT *key, *data;
int *exactp;
{ {
static EPG e; static EPG e;
PAGE *h; PAGE *h;

View file

@ -85,10 +85,7 @@ static char sccsid[] = "@(#)bt_search.c 8.1 (Berkeley) 6/4/93";
* next search of any kind in any tree. * next search of any kind in any tree.
*/ */
EPG * EPG *
__bt_search(t, key, exactp) __bt_search(BTREE *t, const DBT *key, int *exactp)
BTREE *t;
const DBT *key;
int *exactp;
{ {
register indx_t index; register indx_t index;
register int base, cmp, lim; register int base, cmp, lim;

View file

@ -100,10 +100,7 @@ static int bt_seqset __P((BTREE *, EPG *, DBT *, int));
* RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key.
*/ */
int int
__bt_seq(dbp, key, data, flags) __bt_seq(const DB *dbp, DBT *key, DBT *data, u_int flags)
const DB *dbp;
DBT *key, *data;
u_int flags;
{ {
BTREE *t; BTREE *t;
EPG e; EPG e;
@ -176,11 +173,7 @@ __bt_seq(dbp, key, data, flags)
* RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key.
*/ */
static int static int
bt_seqset(t, ep, key, flags) bt_seqset(BTREE *t, EPG *ep, DBT *key, int flags)
BTREE *t;
EPG *ep;
DBT *key;
int flags;
{ {
EPG *e; EPG *e;
PAGE *h; PAGE *h;
@ -306,10 +299,7 @@ bt_seqset(t, ep, key, flags)
* RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key.
*/ */
static int static int
bt_seqadv(t, e, flags) bt_seqadv(BTREE *t, EPG *e, int flags)
BTREE *t;
EPG *e;
int flags;
{ {
EPGNO *c, delc; EPGNO *c, delc;
PAGE *h; PAGE *h;
@ -387,9 +377,7 @@ bt_seqadv(t, e, flags)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__bt_crsrdel(t, c) __bt_crsrdel(BTREE *t, EPGNO *c)
BTREE *t;
EPGNO *c;
{ {
PAGE *h; PAGE *h;
int status; int status;

View file

@ -103,13 +103,7 @@ u_long bt_rootsplit, bt_split, bt_sortsplit, bt_pfxsaved;
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__bt_split(t, sp, key, data, flags, ilen, skip) __bt_split(BTREE *t, PAGE *sp, const DBT *key, const DBT *data, u_long flags, size_t ilen, u_int skip)
BTREE *t;
PAGE *sp;
const DBT *key, *data;
u_long flags;
size_t ilen;
u_int skip;
{ {
BINTERNAL *bi = NULL; BINTERNAL *bi = NULL;
BLEAF *bl = NULL; BLEAF *bl = NULL;
@ -365,11 +359,7 @@ err2: mpool_put(t->bt_mp, l, 0);
* Pointer to page in which to insert or NULL on error. * Pointer to page in which to insert or NULL on error.
*/ */
static PAGE * static PAGE *
bt_page(t, h, lp, rp, skip, ilen) bt_page(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, u_int *skip, size_t ilen)
BTREE *t;
PAGE *h, **lp, **rp;
u_int *skip;
size_t ilen;
{ {
PAGE *l, *r, *tp; PAGE *l, *r, *tp;
pgno_t npg; pgno_t npg;
@ -467,11 +457,7 @@ bt_page(t, h, lp, rp, skip, ilen)
* Pointer to page in which to insert or NULL on error. * Pointer to page in which to insert or NULL on error.
*/ */
static PAGE * static PAGE *
bt_root(t, h, lp, rp, skip, ilen) bt_root(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, u_int *skip, size_t ilen)
BTREE *t;
PAGE *h, **lp, **rp;
u_int *skip;
size_t ilen;
{ {
PAGE *l, *r, *tp; PAGE *l, *r, *tp;
pgno_t lnpg, rnpg; pgno_t lnpg, rnpg;
@ -514,9 +500,7 @@ bt_root(t, h, lp, rp, skip, ilen)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
static int static int
bt_rroot(t, h, l, r) bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
BTREE *t;
PAGE *h, *l, *r;
{ {
char *dest; char *dest;
@ -554,9 +538,7 @@ bt_rroot(t, h, l, r)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
static int static int
bt_broot(t, h, l, r) bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
BTREE *t;
PAGE *h, *l, *r;
{ {
BINTERNAL *bi; BINTERNAL *bi;
BLEAF *bl; BLEAF *bl;
@ -631,11 +613,7 @@ bt_broot(t, h, l, r)
* Pointer to page in which to insert. * Pointer to page in which to insert.
*/ */
static PAGE * static PAGE *
bt_psplit(t, h, l, r, pskip, ilen) bt_psplit(BTREE *t, PAGE *h, PAGE *l, PAGE *r, u_int *pskip, size_t ilen)
BTREE *t;
PAGE *h, *l, *r;
u_int *pskip;
size_t ilen;
{ {
BINTERNAL *bi; BINTERNAL *bi;
BLEAF *bl; BLEAF *bl;
@ -811,9 +789,7 @@ bt_psplit(t, h, l, r, pskip, ilen)
* RET_SUCCESS, RET_ERROR. * RET_SUCCESS, RET_ERROR.
*/ */
static int static int
bt_preserve(t, pg) bt_preserve(BTREE *t, pgno_t pg)
BTREE *t;
pgno_t pg;
{ {
PAGE *h; PAGE *h;
@ -839,8 +815,7 @@ bt_preserve(t, pg)
* all the way back to bt_split/bt_rroot and it's not very clean. * all the way back to bt_split/bt_rroot and it's not very clean.
*/ */
static recno_t static recno_t
rec_total(h) rec_total(PAGE *h)
PAGE *h;
{ {
recno_t recs; recno_t recs;
indx_t nxt, top; indx_t nxt, top;

View file

@ -94,10 +94,7 @@ static char sccsid[] = "@(#)bt_stack.c 8.1 (Berkeley) 6/4/93";
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
__bt_push(t, pgno, index) __bt_push(BTREE *t, pgno_t pgno, int index)
BTREE *t;
pgno_t pgno;
int index;
{ {
if (t->bt_sp == t->bt_maxstack) { if (t->bt_sp == t->bt_maxstack) {
t->bt_maxstack += 50; t->bt_maxstack += 50;

View file

@ -83,10 +83,7 @@ static char sccsid[] = "@(#)bt_utils.c 8.2 (Berkeley) 9/7/93";
* RET_SUCCESS, RET_ERROR. * RET_SUCCESS, RET_ERROR.
*/ */
int int
__bt_ret(t, e, key, data) __bt_ret(BTREE *t, EPG *e, DBT *key, DBT *data)
BTREE *t;
EPG *e;
DBT *key, *data;
{ {
register BLEAF *bl; register BLEAF *bl;
register void *p; register void *p;
@ -158,10 +155,7 @@ __bt_ret(t, e, key, data)
* > 0 if k1 is > record * > 0 if k1 is > record
*/ */
int int
__bt_cmp(t, k1, e) __bt_cmp(BTREE *t, const DBT *k1, EPG *e)
BTREE *t;
const DBT *k1;
EPG *e;
{ {
BINTERNAL *bi; BINTERNAL *bi;
BLEAF *bl; BLEAF *bl;
@ -221,8 +215,7 @@ __bt_cmp(t, k1, e)
* > 0 if a is > b * > 0 if a is > b
*/ */
int int
__bt_defcmp(a, b) __bt_defcmp(const DBT *a, const DBT *b)
const DBT *a, *b;
{ {
register u_char *p1, *p2; register u_char *p1, *p2;
register int diff, len; register int diff, len;
@ -245,8 +238,7 @@ __bt_defcmp(a, b)
* Number of bytes needed to distinguish b from a. * Number of bytes needed to distinguish b from a.
*/ */
int int
__bt_defpfx(a, b) __bt_defpfx(const DBT *a, const DBT *b)
const DBT *a, *b;
{ {
register u_char *p1, *p2; register u_char *p1, *p2;
register int len; register int len;

View file

@ -69,11 +69,7 @@ static char sccsid[] = "@(#)db.c 8.2 (Berkeley) 9/7/93";
#include <db.h> #include <db.h>
DB * DB *
dbopen(fname, flags, mode, type, openinfo) dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo)
const char *fname;
int flags, mode;
DBTYPE type;
const void *openinfo;
{ {
#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN) #define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
@ -102,7 +98,7 @@ dbopen(fname, flags, mode, type, openinfo)
} }
static int static int
__dberr() __dberr(void)
{ {
return (RET_ERROR); return (RET_ERROR);
} }
@ -114,8 +110,7 @@ __dberr()
* dbp: pointer to the DB structure. * dbp: pointer to the DB structure.
*/ */
void void
__dbpanic(dbp) __dbpanic(DB *dbp)
DB *dbp;
{ {
/* The only thing that can succeed is a close. */ /* The only thing that can succeed is a close. */
dbp->del = (int (*)())__dberr; dbp->del = (int (*)())__dberr;

View file

@ -73,8 +73,7 @@ extern int errno;
static int _gettemp(char*, int*); static int _gettemp(char*, int*);
int mkstemp(path) int mkstemp(char *path)
char *path;
{ {
int fd; int fd;
@ -82,16 +81,13 @@ int mkstemp(path)
} }
char * char *
mktemp(path) mktemp(char *path)
char *path;
{ {
return(_gettemp(path, (int *)NULL) ? path : (char *)NULL); return(_gettemp(path, (int *)NULL) ? path : (char *)NULL);
} }
static int static int
_gettemp(path, doopen) _gettemp(char *path, register int *doopen)
char *path;
register int *doopen;
{ {
register char *start, *trv; register char *start, *trv;
struct stat sbuf; struct stat sbuf;

View file

@ -91,10 +91,7 @@ static void __mpoolerr __P((const char *fmt, ...));
* MPOOL pointer, NULL on error. * MPOOL pointer, NULL on error.
*/ */
MPOOL * MPOOL *
mpool_open(key, fd, pagesize, maxcache) mpool_open(DBT *key, int fd, pgno_t pagesize, pgno_t maxcache)
DBT *key;
int fd;
pgno_t pagesize, maxcache;
{ {
struct stat sb; struct stat sb;
MPOOL *mp; MPOOL *mp;
@ -145,11 +142,10 @@ mpool_open(key, fd, pagesize, maxcache)
* pgcookie: Cookie for page in/out routines. * pgcookie: Cookie for page in/out routines.
*/ */
void void
mpool_filter(mp, pgin, pgout, pgcookie) mpool_filter(MPOOL *mp,
MPOOL *mp; void (*pgin) __P((void *, pgno_t, void *)),
void (*pgin) __P((void *, pgno_t, void *)); void (*pgout) __P((void *, pgno_t, void *)),
void (*pgout) __P((void *, pgno_t, void *)); void *pgcookie)
void *pgcookie;
{ {
mp->pgin = pgin; mp->pgin = pgin;
mp->pgout = pgout; mp->pgout = pgout;
@ -166,9 +162,7 @@ mpool_filter(mp, pgin, pgout, pgcookie)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
void * void *
mpool_new(mp, pgnoaddr) mpool_new(MPOOL *mp, pgno_t *pgnoaddr)
MPOOL *mp;
pgno_t *pgnoaddr;
{ {
BKT *b; BKT *b;
BKTHDR *hp; BKTHDR *hp;
@ -201,10 +195,7 @@ mpool_new(mp, pgnoaddr)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
void * void *
mpool_get(mp, pgno, flags) mpool_get(MPOOL *mp, pgno_t pgno, u_int flags /* XXX not used? */)
MPOOL *mp;
pgno_t pgno;
u_int flags; /* XXX not used? */
{ {
BKT *b; BKT *b;
BKTHDR *hp; BKTHDR *hp;
@ -277,10 +268,7 @@ mpool_get(mp, pgno, flags)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
mpool_put(mp, page, flags) mpool_put(MPOOL *mp, void *page, u_int flags)
MPOOL *mp;
void *page;
u_int flags;
{ {
BKT *baddr; BKT *baddr;
#ifdef DEBUG #ifdef DEBUG
@ -316,8 +304,7 @@ mpool_put(mp, page, flags)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
mpool_close(mp) mpool_close(MPOOL *mp)
MPOOL *mp;
{ {
BKT *b, *next; BKT *b, *next;
@ -340,8 +327,7 @@ mpool_close(mp)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
int int
mpool_sync(mp) mpool_sync(MPOOL *mp)
MPOOL *mp;
{ {
BKT *b; BKT *b;
@ -361,8 +347,7 @@ mpool_sync(mp)
* NULL on failure and a pointer to the BKT on success * NULL on failure and a pointer to the BKT on success
*/ */
static BKT * static BKT *
mpool_bkt(mp) mpool_bkt(MPOOL *mp)
MPOOL *mp;
{ {
BKT *b; BKT *b;
@ -424,9 +409,7 @@ new: if ((b = malloc(sizeof(BKT) + mp->pagesize)) == NULL)
* RET_ERROR, RET_SUCCESS * RET_ERROR, RET_SUCCESS
*/ */
static int static int
mpool_write(mp, b) mpool_write(MPOOL *mp, BKT *b)
MPOOL *mp;
BKT *b;
{ {
off_t off; off_t off;
@ -456,9 +439,7 @@ mpool_write(mp, b)
* NULL on failure and a pointer to the BKT on success * NULL on failure and a pointer to the BKT on success
*/ */
static BKT * static BKT *
mpool_look(mp, pgno) mpool_look(MPOOL *mp, pgno_t pgno)
MPOOL *mp;
pgno_t pgno;
{ {
register BKT *b; register BKT *b;
register BKTHDR *tb; register BKTHDR *tb;
@ -489,8 +470,7 @@ mpool_look(mp, pgno)
* mp: mpool cookie * mp: mpool cookie
*/ */
void void
mpool_stat(mp) mpool_stat(MPOOL *mp)
MPOOL *mp;
{ {
BKT *b; BKT *b;
int cnt; int cnt;

View file

@ -26,9 +26,7 @@
#include <stdlib.h> #include <stdlib.h>
void * void *
__fix_realloc(p, n) __fix_realloc(void *p, size_t n)
void *p;
size_t n;
{ {
return (p == 0 ? malloc(n) : realloc(p, n)); return (p == 0 ? malloc(n) : realloc(p, n));
} }

View file

@ -228,8 +228,7 @@ WidgetClass pannerWidgetClass = (WidgetClass) &pannerClassRec;
* * * *
*****************************************************************************/ *****************************************************************************/
static void reset_shadow_gc (pw) /* used when resources change */ static void reset_shadow_gc (PannerWidget pw) /* used when resources change */
PannerWidget pw;
{ {
XtGCMask valuemask = GCForeground; XtGCMask valuemask = GCForeground;
XGCValues values; XGCValues values;
@ -270,8 +269,7 @@ static void reset_shadow_gc (pw) /* used when resources change */
pw->panner.shadow_gc = XtGetGC ((Widget) pw, valuemask, &values); pw->panner.shadow_gc = XtGetGC ((Widget) pw, valuemask, &values);
} }
static void reset_slider_gc (pw) /* used when resources change */ static void reset_slider_gc (PannerWidget pw) /* used when resources change */
PannerWidget pw;
{ {
XtGCMask valuemask = GCForeground; XtGCMask valuemask = GCForeground;
XGCValues values; XGCValues values;
@ -283,8 +281,7 @@ static void reset_slider_gc (pw) /* used when resources change */
pw->panner.slider_gc = XtGetGC ((Widget) pw, valuemask, &values); pw->panner.slider_gc = XtGetGC ((Widget) pw, valuemask, &values);
} }
static void reset_xor_gc (pw) /* used when resources change */ static void reset_xor_gc (PannerWidget pw) /* used when resources change */
PannerWidget pw;
{ {
if (pw->panner.xor_gc) XtReleaseGC ((Widget) pw, pw->panner.xor_gc); if (pw->panner.xor_gc) XtReleaseGC ((Widget) pw, pw->panner.xor_gc);
@ -308,9 +305,7 @@ static void reset_xor_gc (pw) /* used when resources change */
} }
static void check_knob (pw, knob) static void check_knob (register PannerWidget pw, Boolean knob)
register PannerWidget pw;
Boolean knob;
{ {
Position pad = pw->panner.internal_border * 2; Position pad = pw->panner.internal_border * 2;
Position maxx = (((Position) pw->core.width) - pad - Position maxx = (((Position) pw->core.width) - pad -
@ -340,8 +335,7 @@ static void check_knob (pw, knob)
} }
static void move_shadow (pw) static void move_shadow (register PannerWidget pw)
register PannerWidget pw;
{ {
if (pw->panner.shadow_thickness > 0) { if (pw->panner.shadow_thickness > 0) {
int lw = pw->panner.shadow_thickness + pw->panner.line_width * 2; int lw = pw->panner.shadow_thickness + pw->panner.line_width * 2;
@ -366,9 +360,7 @@ static void move_shadow (pw)
pw->panner.shadow_valid = FALSE; pw->panner.shadow_valid = FALSE;
} }
static void scale_knob (pw, location, size) /* set knob size and/or loc */ static void scale_knob (PannerWidget pw, Boolean location, Boolean size) /* set knob size and/or loc */
PannerWidget pw;
Boolean location, size;
{ {
if (location) { if (location) {
pw->panner.knob_x = (Position) PANNER_HSCALE (pw, pw->panner.slider_x); pw->panner.knob_x = (Position) PANNER_HSCALE (pw, pw->panner.slider_x);
@ -393,8 +385,7 @@ static void scale_knob (pw, location, size) /* set knob size and/or loc */
move_shadow (pw); move_shadow (pw);
} }
static void rescale (pw) static void rescale (PannerWidget pw)
PannerWidget pw;
{ {
int hpad = pw->panner.internal_border * 2; int hpad = pw->panner.internal_border * 2;
int vpad = hpad; int vpad = hpad;
@ -415,19 +406,14 @@ static void rescale (pw)
} }
static void get_default_size (pw, wp, hp) static void get_default_size (PannerWidget pw, Dimension *wp, Dimension *hp)
PannerWidget pw;
Dimension *wp, *hp;
{ {
Dimension pad = pw->panner.internal_border * 2; Dimension pad = pw->panner.internal_border * 2;
*wp = PANNER_DSCALE (pw, pw->panner.canvas_width) + pad; *wp = PANNER_DSCALE (pw, pw->panner.canvas_width) + pad;
*hp = PANNER_DSCALE (pw, pw->panner.canvas_height) + pad; *hp = PANNER_DSCALE (pw, pw->panner.canvas_height) + pad;
} }
static Boolean get_event_xy (pw, event, x, y) static Boolean get_event_xy (PannerWidget pw, XEvent *event, int *x, int *y)
PannerWidget pw;
XEvent *event;
int *x, *y;
{ {
int pad = pw->panner.internal_border; int pad = pw->panner.internal_border;
@ -459,10 +445,7 @@ static Boolean get_event_xy (pw, event, x, y)
return FALSE; return FALSE;
} }
static int parse_page_string (s, pagesize, canvassize, relative) static int parse_page_string (register char *s, int pagesize, int canvassize, Boolean *relative)
register char *s;
int pagesize, canvassize;
Boolean *relative;
{ {
char *cp; char *cp;
double val = 1.0; double val = 1.0;
@ -540,8 +523,7 @@ static int parse_page_string (s, pagesize, canvassize, relative)
*****************************************************************************/ *****************************************************************************/
static void Initialize (greq, gnew) static void Initialize (Widget greq, Widget gnew)
Widget greq, gnew;
{ {
PannerWidget req = (PannerWidget) greq, new = (PannerWidget) gnew; PannerWidget req = (PannerWidget) greq, new = (PannerWidget) gnew;
Dimension defwidth, defheight; Dimension defwidth, defheight;
@ -579,10 +561,7 @@ static void Initialize (greq, gnew)
} }
static void Realize (gw, valuemaskp, attr) static void Realize (Widget gw, XtValueMask *valuemaskp, XSetWindowAttributes *attr)
Widget gw;
XtValueMask *valuemaskp;
XSetWindowAttributes *attr;
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
Pixmap pm = XtUnspecifiedPixmap; Pixmap pm = XtUnspecifiedPixmap;
@ -605,8 +584,7 @@ static void Realize (gw, valuemaskp, attr)
} }
static void Destroy (gw) static void Destroy (Widget gw)
Widget gw;
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
@ -615,18 +593,14 @@ static void Destroy (gw)
XtReleaseGC (gw, pw->panner.xor_gc); XtReleaseGC (gw, pw->panner.xor_gc);
} }
static void Resize (gw) static void Resize (Widget gw)
Widget gw;
{ {
rescale ((PannerWidget) gw); rescale ((PannerWidget) gw);
} }
/* ARGSUSED */ /* ARGSUSED */
static void Redisplay (gw, event, region) static void Redisplay (Widget gw, XEvent *event, Region region)
Widget gw;
XEvent *event;
Region region;
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
Display *dpy = XtDisplay(gw); Display *dpy = XtDisplay(gw);
@ -710,8 +684,7 @@ static void Redisplay (gw, event, region)
/* ARGSUSED */ /* ARGSUSED */
static Boolean SetValues (gcur, greq, gnew) static Boolean SetValues (Widget gcur, Widget greq, Widget gnew)
Widget gcur, greq, gnew;
{ {
PannerWidget cur = (PannerWidget) gcur; PannerWidget cur = (PannerWidget) gcur;
PannerWidget new = (PannerWidget) gnew; PannerWidget new = (PannerWidget) gnew;
@ -787,9 +760,7 @@ static Boolean SetValues (gcur, greq, gnew)
return redisplay; return redisplay;
} }
static void SetValuesAlmost (gold, gnew, req, reply) static void SetValuesAlmost (Widget gold, Widget gnew, XtWidgetGeometry *req, XtWidgetGeometry *reply)
Widget gold, gnew;
XtWidgetGeometry *req, *reply;
{ {
if (reply->request_mode == 0) { /* got turned down, so cope */ if (reply->request_mode == 0) { /* got turned down, so cope */
Resize (gnew); Resize (gnew);
@ -798,9 +769,7 @@ static void SetValuesAlmost (gold, gnew, req, reply)
(gold, gnew, req, reply); (gold, gnew, req, reply);
} }
static XtGeometryResult QueryGeometry (gw, intended, pref) static XtGeometryResult QueryGeometry (Widget gw, XtWidgetGeometry *intended, XtWidgetGeometry *pref)
Widget gw;
XtWidgetGeometry *intended, *pref;
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
@ -826,11 +795,7 @@ static XtGeometryResult QueryGeometry (gw, intended, pref)
*****************************************************************************/ *****************************************************************************/
/* ARGSUSED */ /* ARGSUSED */
static void ActionStart (gw, event, params, num_params) static void ActionStart (Widget gw, XEvent *event, String *params /* unused */, Cardinal *num_params /* unused */)
Widget gw;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
int x, y; int x, y;
@ -851,11 +816,7 @@ static void ActionStart (gw, event, params, num_params)
} }
/* ARGSUSED */ /* ARGSUSED */
static void ActionStop (gw, event, params, num_params) static void ActionStop (Widget gw, XEvent *event, String *params /* unused */, Cardinal *num_params /* unused */)
Widget gw;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
int x, y; int x, y;
@ -870,11 +831,7 @@ static void ActionStop (gw, event, params, num_params)
} }
/* ARGSUSED */ /* ARGSUSED */
static void ActionAbort (gw, event, params, num_params) static void ActionAbort (Widget gw, XEvent *event, String *params /* unused */, Cardinal *num_params /* unused */)
Widget gw;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
@ -892,11 +849,7 @@ static void ActionAbort (gw, event, params, num_params)
/* ARGSUSED */ /* ARGSUSED */
static void ActionMove (gw, event, params, num_params) static void ActionMove (Widget gw, XEvent *event /* must be a motion event */, String *params /* unused */, Cardinal *num_params /* unused */)
Widget gw;
XEvent *event; /* must be a motion event */
String *params; /* unused */
Cardinal *num_params; /* unused */
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
int x, y; int x, y;
@ -922,11 +875,7 @@ static void ActionMove (gw, event, params, num_params)
/* ARGSUSED */ /* ARGSUSED */
static void ActionPage (gw, event, params, num_params) static void ActionPage (Widget gw, XEvent *event /* unused */, String *params, Cardinal *num_params /* unused */)
Widget gw;
XEvent *event; /* unused */
String *params;
Cardinal *num_params; /* unused */
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
Cardinal zero = 0; Cardinal zero = 0;
@ -965,11 +914,7 @@ static void ActionPage (gw, event, params, num_params)
/* ARGSUSED */ /* ARGSUSED */
static void ActionNotify (gw, event, params, num_params) static void ActionNotify (Widget gw, XEvent *event /* unused */, String *params /* unused */, Cardinal *num_params /* unused */)
Widget gw;
XEvent *event; /* unused */
String *params; /* unused */
Cardinal *num_params; /* unused */
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
@ -1016,11 +961,7 @@ static void ActionNotify (gw, event, params, num_params)
} }
/* ARGSUSED */ /* ARGSUSED */
static void ActionSet (gw, event, params, num_params) static void ActionSet (Widget gw, XEvent *event /* unused */, String *params, Cardinal *num_params)
Widget gw;
XEvent *event; /* unused */
String *params;
Cardinal *num_params;
{ {
PannerWidget pw = (PannerWidget) gw; PannerWidget pw = (PannerWidget) gw;
Boolean rb; Boolean rb;

View file

@ -98,10 +98,7 @@ PixmapClassRec pixmapClassRec = {
WidgetClass pixmapWidgetClass = (WidgetClass)&pixmapClassRec; WidgetClass pixmapWidgetClass = (WidgetClass)&pixmapClassRec;
static void static void
Initialize(req, new, args, nargs ) Initialize(PixmapWidget req, PixmapWidget new, ArgList args, Cardinal *nargs)
PixmapWidget req, new ;
ArgList args ;
Cardinal *nargs ;
{ {
XtGCMask value_mask ; XtGCMask value_mask ;
XGCValues values ; XGCValues values ;
@ -136,16 +133,14 @@ Cardinal *nargs ;
} }
static void static void
Resize(w) Resize(PixmapWidget w)
PixmapWidget w ;
{ {
ON_DEBUG(fprintf(stderr, "PixmapWidget: RESIZE (%d, %d)\n", ON_DEBUG(fprintf(stderr, "PixmapWidget: RESIZE (%d, %d)\n",
w->core.width, w->core.height)); w->core.width, w->core.height));
} }
static void static void
Destroy(w) Destroy(PixmapWidget w)
PixmapWidget w;
{ {
if (w->pixmap.pixmap != 0) if (w->pixmap.pixmap != 0)
{ {
@ -154,10 +149,7 @@ PixmapWidget w;
} }
static Boolean static Boolean
SetValues(current, request, new, args, num_args) SetValues(PixmapWidget current, PixmapWidget request, PixmapWidget new, ArgList args, Cardinal *num_args)
PixmapWidget current, request, new ;
ArgList args ;
Cardinal *num_args ;
{ {
Window root ; Window root ;
int x, y ; int x, y ;
@ -191,9 +183,7 @@ Cardinal *num_args ;
static XtGeometryResult static XtGeometryResult
QueryGeometry(w, proposed, answer) QueryGeometry(PixmapWidget w, XtWidgetGeometry *proposed, XtWidgetGeometry *answer)
PixmapWidget w ;
XtWidgetGeometry *proposed, *answer;
{ {
ON_DEBUG(fprintf(stderr, "PixmapWidget:\tQueryGeometry()\n")); ON_DEBUG(fprintf(stderr, "PixmapWidget:\tQueryGeometry()\n"));
#ifdef DEBUG #ifdef DEBUG
@ -218,9 +208,7 @@ XtWidgetGeometry *proposed, *answer;
#endif #endif
static void static void
ReDisplay(w, event) ReDisplay(PixmapWidget w, XExposeEvent *event)
PixmapWidget w ;
XExposeEvent *event ;
{ {
ON_DEBUG(fprintf(stderr, "PixmapWidget: EXPOSE\n")); ON_DEBUG(fprintf(stderr, "PixmapWidget: EXPOSE\n"));

View file

@ -166,8 +166,7 @@ WidgetClass portholeWidgetClass = (WidgetClass) &portholeClassRec;
* * * *
*****************************************************************************/ *****************************************************************************/
static Widget find_child (pw) static Widget find_child (register PortholeWidget pw)
register PortholeWidget pw;
{ {
register Widget *children; register Widget *children;
register int i; register int i;
@ -184,9 +183,7 @@ static Widget find_child (pw)
return (Widget) NULL; return (Widget) NULL;
} }
static void SendReport (pw, changed) static void SendReport (PortholeWidget pw, unsigned int changed)
PortholeWidget pw;
unsigned int changed;
{ {
Widget child = find_child (pw); Widget child = find_child (pw);
@ -206,12 +203,10 @@ static void SendReport (pw, changed)
} }
static void layout_child (pw, child, geomp, xp, yp, widthp, heightp) static void layout_child (PortholeWidget pw, Widget child,
PortholeWidget pw; XtWidgetGeometry *geomp,
Widget child; Position *xp, Position *yp,
XtWidgetGeometry *geomp; Dimension *widthp, Dimension *heightp)
Position *xp, *yp;
Dimension *widthp, *heightp;
{ {
Position minx, miny; Position minx, miny;
@ -256,10 +251,7 @@ static void layout_child (pw, child, geomp, xp, yp, widthp, heightp)
*****************************************************************************/ *****************************************************************************/
static void Realize (gw, valueMask, attributes) static void Realize (register Widget gw, Mask *valueMask, XSetWindowAttributes *attributes)
register Widget gw;
Mask *valueMask;
XSetWindowAttributes *attributes;
{ {
attributes->bit_gravity = NorthWestGravity; attributes->bit_gravity = NorthWestGravity;
*valueMask |= CWBitGravity; *valueMask |= CWBitGravity;
@ -271,8 +263,7 @@ static void Realize (gw, valueMask, attributes)
} }
static void Resize (gw) static void Resize (Widget gw)
Widget gw;
{ {
PortholeWidget pw = (PortholeWidget) gw; PortholeWidget pw = (PortholeWidget) gw;
Widget child = find_child (pw); Widget child = find_child (pw);
@ -293,9 +284,7 @@ static void Resize (gw)
} }
static XtGeometryResult QueryGeometry (gw, intended, preferred) static XtGeometryResult QueryGeometry (Widget gw, XtWidgetGeometry *intended, XtWidgetGeometry *preferred)
Widget gw;
XtWidgetGeometry *intended, *preferred;
{ {
register PortholeWidget pw = (PortholeWidget) gw; register PortholeWidget pw = (PortholeWidget) gw;
Widget child = find_child (pw); Widget child = find_child (pw);
@ -321,9 +310,7 @@ static XtGeometryResult QueryGeometry (gw, intended, preferred)
} }
static XtGeometryResult GeometryManager (w, req, reply) static XtGeometryResult GeometryManager (Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply)
Widget w;
XtWidgetGeometry *req, *reply;
{ {
PortholeWidget pw = (PortholeWidget) w->core.parent; PortholeWidget pw = (PortholeWidget) w->core.parent;
Widget child = find_child (pw); Widget child = find_child (pw);
@ -385,8 +372,7 @@ static XtGeometryResult GeometryManager (w, req, reply)
} }
static void ChangeManaged (gw) static void ChangeManaged (Widget gw)
Widget gw;
{ {
PortholeWidget pw = (PortholeWidget) gw; PortholeWidget pw = (PortholeWidget) gw;
Widget child = find_child (pw); /* ignore extra children */ Widget child = find_child (pw); /* ignore extra children */
@ -420,7 +406,7 @@ static void ChangeManaged (gw)
#if XmVersion == 1002 #if XmVersion == 1002
static void static void
ClassInitialize () ClassInitialize (void)
{ {
/* set up base class extension quark */ /* set up base class extension quark */
portholeClassExtRec.record_type = XmQmotif; portholeClassExtRec.record_type = XmQmotif;

View file

@ -139,7 +139,7 @@ SimpleClassRec simpleClassRec = {
WidgetClass simpleWidgetClass = (WidgetClass)&simpleClassRec; WidgetClass simpleWidgetClass = (WidgetClass)&simpleClassRec;
static void ClassInitialize() static void ClassInitialize(void)
{ {
static XtConvertArgRec convertArg[] = { static XtConvertArgRec convertArg[] = {
{XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen), {XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
@ -157,8 +157,7 @@ static void ClassInitialize()
XtCacheByDisplay, NULL); XtCacheByDisplay, NULL);
} }
static void ClassPartInitialize(class) static void ClassPartInitialize(WidgetClass class)
WidgetClass class;
{ {
register SimpleWidgetClass c = (SimpleWidgetClass)class; register SimpleWidgetClass c = (SimpleWidgetClass)class;
register SimpleWidgetClass super = (SimpleWidgetClass) register SimpleWidgetClass super = (SimpleWidgetClass)
@ -178,10 +177,7 @@ static void ClassPartInitialize(class)
c->simple_class.change_sensitive = super->simple_class.change_sensitive; c->simple_class.change_sensitive = super->simple_class.change_sensitive;
} }
static void Realize(w, valueMask, attributes) static void Realize(register Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
register Widget w;
Mask *valueMask;
XSetWindowAttributes *attributes;
{ {
Pixmap border_pixmap = 0; Pixmap border_pixmap = 0;
@ -221,8 +217,7 @@ static void Realize(w, valueMask, attributes)
*/ */
static void static void
ConvertCursor(w) ConvertCursor(Widget w)
Widget w;
{ {
SimpleWidget simple = (SimpleWidget) w; SimpleWidget simple = (SimpleWidget) w;
XrmValue from, to; XrmValue from, to;
@ -251,8 +246,7 @@ Widget w;
/* ARGSUSED */ /* ARGSUSED */
static Boolean SetValues(current, request, new) static Boolean SetValues(Widget current, Widget request, Widget new)
Widget current, request, new;
{ {
SimpleWidget s_old = (SimpleWidget) current; SimpleWidget s_old = (SimpleWidget) current;
SimpleWidget s_new = (SimpleWidget) new; SimpleWidget s_new = (SimpleWidget) new;
@ -284,8 +278,7 @@ static Boolean SetValues(current, request, new)
} }
static Boolean ChangeSensitive(w) static Boolean ChangeSensitive(register Widget w)
register Widget w;
{ {
if (XtIsRealized(w)) { if (XtIsRealized(w)) {
if (XtIsSensitive(w)) if (XtIsSensitive(w))

View file

@ -210,10 +210,7 @@ WidgetClass treeWidgetClass = (WidgetClass) &treeClassRec;
* * * *
*****************************************************************************/ *****************************************************************************/
static void initialize_dimensions (listp, sizep, n) static void initialize_dimensions (Dimension **listp, int *sizep, int n)
Dimension **listp;
int *sizep;
int n;
{ {
register int i; register int i;
register Dimension *l; register Dimension *l;
@ -237,8 +234,7 @@ static void initialize_dimensions (listp, sizep, n)
return; return;
} }
static GC get_tree_gc (w) static GC get_tree_gc (TreeWidget w)
TreeWidget w;
{ {
XtGCMask valuemask = GCBackground | GCForeground; XtGCMask valuemask = GCBackground | GCForeground;
XGCValues values; XGCValues values;
@ -253,8 +249,7 @@ static GC get_tree_gc (w)
return XtGetGC ((Widget) w, valuemask, &values); return XtGetGC ((Widget) w, valuemask, &values);
} }
static void insert_node (parent, node) static void insert_node (Widget parent, Widget node)
Widget parent, node;
{ {
TreeConstraints pc; TreeConstraints pc;
TreeConstraints nc = TREE_CONSTRAINT(node); TreeConstraints nc = TREE_CONSTRAINT(node);
@ -287,8 +282,7 @@ static void insert_node (parent, node)
pc->tree.n_children++; pc->tree.n_children++;
} }
static void delete_node (parent, node) static void delete_node (Widget parent, Widget node)
Widget parent, node;
{ {
TreeConstraints pc; TreeConstraints pc;
int pos, i; int pos, i;
@ -323,9 +317,7 @@ static void delete_node (parent, node)
pc->tree.children[pc->tree.n_children]=0; pc->tree.children[pc->tree.n_children]=0;
} }
static void check_gravity (tw, grav) static void check_gravity (TreeWidget tw, XtGravity grav)
TreeWidget tw;
XtGravity grav;
{ {
switch (tw->tree.gravity) { switch (tw->tree.gravity) {
case WestGravity: case NorthGravity: case EastGravity: case SouthGravity: case WestGravity: case NorthGravity: case EastGravity: case SouthGravity:
@ -343,7 +335,7 @@ static void check_gravity (tw, grav)
* * * *
*****************************************************************************/ *****************************************************************************/
static void ClassInitialize () static void ClassInitialize (void)
{ {
XawInitializeWidgetSet(); XawInitializeWidgetSet();
XtAddConverter (XtRString, XtRGravity, XmuCvtStringToGravity, XtAddConverter (XtRString, XtRGravity, XmuCvtStringToGravity,
@ -351,8 +343,7 @@ static void ClassInitialize ()
} }
static void Initialize (grequest, gnew) static void Initialize (Widget grequest, Widget gnew)
Widget grequest, gnew;
{ {
TreeWidget request = (TreeWidget) grequest, new = (TreeWidget) gnew; TreeWidget request = (TreeWidget) grequest, new = (TreeWidget) gnew;
Arg args[2]; Arg args[2];
@ -406,8 +397,7 @@ static void Initialize (grequest, gnew)
/* ARGSUSED */ /* ARGSUSED */
static void ConstraintInitialize (request, new) static void ConstraintInitialize (Widget request, Widget new)
Widget request, new;
{ {
TreeConstraints tc = TREE_CONSTRAINT(new); TreeConstraints tc = TREE_CONSTRAINT(new);
TreeWidget tw = (TreeWidget) new->core.parent; TreeWidget tw = (TreeWidget) new->core.parent;
@ -436,8 +426,7 @@ static void ConstraintInitialize (request, new)
/* ARGSUSED */ /* ARGSUSED */
static Boolean SetValues (gcurrent, grequest, gnew) static Boolean SetValues (Widget gcurrent, Widget grequest, Widget gnew)
Widget gcurrent, grequest, gnew;
{ {
TreeWidget current = (TreeWidget) gcurrent, new = (TreeWidget) gnew; TreeWidget current = (TreeWidget) gcurrent, new = (TreeWidget) gnew;
Boolean redraw = FALSE; Boolean redraw = FALSE;
@ -482,10 +471,7 @@ static Boolean SetValues (gcurrent, grequest, gnew)
/* ARGSUSED */ /* ARGSUSED */
static Boolean ConstraintSetValues (current, request, new, args, num_args) static Boolean ConstraintSetValues (Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args)
Widget current, request, new;
ArgList args;
Cardinal *num_args;
{ {
TreeConstraints newc = TREE_CONSTRAINT(new); TreeConstraints newc = TREE_CONSTRAINT(new);
TreeConstraints curc = TREE_CONSTRAINT(current); TreeConstraints curc = TREE_CONSTRAINT(current);
@ -513,8 +499,7 @@ static Boolean ConstraintSetValues (current, request, new, args, num_args)
} }
static void ConstraintDestroy (w) static void ConstraintDestroy (Widget w)
Widget w;
{ {
TreeConstraints tc = TREE_CONSTRAINT(w); TreeConstraints tc = TREE_CONSTRAINT(w);
TreeWidget tw = (TreeWidget) XtParent(w); TreeWidget tw = (TreeWidget) XtParent(w);
@ -540,10 +525,7 @@ static void ConstraintDestroy (w)
} }
/* ARGSUSED */ /* ARGSUSED */
static XtGeometryResult GeometryManager (w, request, reply) static XtGeometryResult GeometryManager (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply)
Widget w;
XtWidgetGeometry *request;
XtWidgetGeometry *reply;
{ {
TreeWidget tw = (TreeWidget) w->core.parent; TreeWidget tw = (TreeWidget) w->core.parent;
@ -570,15 +552,13 @@ static XtGeometryResult GeometryManager (w, request, reply)
return (XtGeometryYes); return (XtGeometryYes);
} }
static void ChangeManaged (gw) static void ChangeManaged (Widget gw)
Widget gw;
{ {
layout_tree ((TreeWidget) gw, FALSE); layout_tree ((TreeWidget) gw, FALSE);
} }
static void Destroy (gw) static void Destroy (Widget gw)
Widget gw;
{ {
TreeWidget w = (TreeWidget) gw; TreeWidget w = (TreeWidget) gw;
@ -588,10 +568,7 @@ static void Destroy (gw)
/* ARGSUSED */ /* ARGSUSED */
static void Redisplay (tw, event, region) static void Redisplay (TreeWidget tw, XEvent *event, Region region)
TreeWidget tw;
XEvent *event;
Region region;
{ {
/* /*
* If the Tree widget is visible, visit each managed child. * If the Tree widget is visible, visit each managed child.
@ -683,9 +660,7 @@ static void Redisplay (tw, event, region)
} }
} }
static XtGeometryResult QueryGeometry (w, intended, preferred) static XtGeometryResult QueryGeometry (Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *preferred)
Widget w;
XtWidgetGeometry *intended, *preferred;
{ {
register TreeWidget tw = (TreeWidget) w; register TreeWidget tw = (TreeWidget) w;
@ -717,10 +692,7 @@ static XtGeometryResult QueryGeometry (w, intended, preferred)
* * * *
*****************************************************************************/ *****************************************************************************/
static void compute_bounding_box_subtree (tree, w, depth) static void compute_bounding_box_subtree (TreeWidget tree, Widget w, int depth)
TreeWidget tree;
Widget w;
int depth;
{ {
TreeConstraints tc = TREE_CONSTRAINT(w); /* info attached to all kids */ TreeConstraints tc = TREE_CONSTRAINT(w); /* info attached to all kids */
register int i; register int i;
@ -790,10 +762,7 @@ static void compute_bounding_box_subtree (tree, w, depth)
} }
static void set_positions (tw, w, level) static void set_positions (TreeWidget tw, Widget w, int level)
TreeWidget tw;
Widget w;
int level;
{ {
int i; int i;
@ -831,11 +800,7 @@ static void set_positions (tw, w, level)
} }
static void arrange_subtree (tree, w, depth, x, y) static void arrange_subtree (TreeWidget tree, Widget w, int depth, Position x, Position y)
TreeWidget tree;
Widget w;
int depth;
Position x, y;
{ {
TreeConstraints tc = TREE_CONSTRAINT(w); /* info attached to all kids */ TreeConstraints tc = TREE_CONSTRAINT(w); /* info attached to all kids */
TreeConstraints firstcc, lastcc; TreeConstraints firstcc, lastcc;
@ -938,10 +903,7 @@ static void arrange_subtree (tree, w, depth, x, y)
} }
} }
static void set_tree_size (tw, insetvalues, width, height) static void set_tree_size (TreeWidget tw, Boolean insetvalues, Dimension width, Dimension height)
TreeWidget tw;
Boolean insetvalues;
Dimension width, height;
{ {
if (insetvalues) { if (insetvalues) {
tw->core.width = width; tw->core.width = width;

View file

@ -103,9 +103,9 @@ static int b_str(unsigned char **in_ptr, char **out_ptr)
} }
/* now the integers */ /* now the integers */
/* unsigned CGM integer at arbitrary legal precision */ /* unsigned CGM integer at arbitrary legal precision */
static unsigned int b_guint(in_ptr, bits_p) /* in_ptr, pointer to the input data pointer */
unsigned char **in_ptr; /* pointer to the input data pointer */ /* bits_p, no. of bits precision */
int bits_p; /* no. of bits precision */ static unsigned int b_guint(unsigned char **in_ptr, int bits_p)
{ {
int i; int i;
unsigned int val; unsigned int val;
@ -117,9 +117,9 @@ static unsigned int b_guint(in_ptr, bits_p)
return(val); return(val);
} }
/* signed CGM integer at arbitrary legal precision */ /* signed CGM integer at arbitrary legal precision */
static int b_gsint(in_ptr, bits_p) /* in_ptr, pointer to the input data pointer */
unsigned char **in_ptr; /* pointer to the input data pointer */ /* bits_p, no. of bits precision */
int bits_p; /* no. of bits precision */ static int b_gsint(unsigned char **in_ptr, int bits_p)
{ {
int i, val; int i, val;
/* have to worry about sign extension, may not have signed char */ /* have to worry about sign extension, may not have signed char */
@ -132,9 +132,7 @@ static int b_gsint(in_ptr, bits_p)
} }
/* now the reals */ /* now the reals */
/* the fixed point real */ /* the fixed point real */
static double b_fixed(dat_ptr, prec) static double b_fixed(unsigned char **dat_ptr, rp_type *prec)
unsigned char **dat_ptr;
rp_type *prec;
{ {
double ret; double ret;
/* do it in two parts; the big (first) part and fractional (second) part */ /* do it in two parts; the big (first) part and fractional (second) part */
@ -145,9 +143,7 @@ static double b_fixed(dat_ptr, prec)
return(ret); return(ret);
} }
/* the IEEE floating point */ /* the IEEE floating point */
static double b_ieee(dat_ptr, prec) static double b_ieee(unsigned char **dat_ptr, rp_type *prec)
unsigned char **dat_ptr;
rp_type *prec;
{ {
#define TABLESIZE 128 #define TABLESIZE 128
static double shift_table[TABLESIZE]; static double shift_table[TABLESIZE];
@ -227,9 +223,7 @@ static double b_ieee(dat_ptr, prec)
#undef TABLESIZE #undef TABLESIZE
} }
/* the general real */ /* the general real */
static double b_real(dat_ptr, rprec) static double b_real(unsigned char **dat_ptr, rp_type *rprec)
unsigned char **dat_ptr;
rp_type *rprec;
{ {
if (rprec->fixed == 0) { /* floating point */ if (rprec->fixed == 0) { /* floating point */
return(b_ieee(dat_ptr, rprec)); return(b_ieee(dat_ptr, rprec));
@ -566,28 +560,19 @@ static int epic(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr,
} }
/* Metafile Descriptors */ /* Metafile Descriptors */
/* Metafile Version */ /* Metafile Version */
static int mfversion(dat_ptr, cmd_ptr, cgm_s) static int mfversion(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
/* nothing for now */ /* nothing for now */
return 1; return 1;
} }
/* Metafile Descriptor */ /* Metafile Descriptor */
static int mfdescrip(dat_ptr, cmd_ptr, cgm_s) static int mfdescrip(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
/* nothing for now */ /* nothing for now */
return 1; return 1;
} }
/* VDC type */ /* VDC type */
static int vdctype(dat_ptr, cmd_ptr, cgm_s) static int vdctype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
/* 0=>integer, 1=>real */ /* 0=>integer, 1=>real */
@ -596,19 +581,13 @@ static int vdctype(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Integer Precision */ /* Integer Precision */
static int intprec(dat_ptr, cmd_ptr, cgm_s) static int intprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->intprec = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->intprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1; return 1;
} }
/* Real Precision */ /* Real Precision */
static int realprec(dat_ptr, cmd_ptr, cgm_s) static int realprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->realprec.fixed = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->realprec.fixed = b_gsint(&dat_ptr, cgm_s->intprec);
cgm_s->realprec.exp = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->realprec.exp = b_gsint(&dat_ptr, cgm_s->intprec);
@ -617,46 +596,31 @@ static int realprec(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Index Precision */ /* Index Precision */
static int indexprec(dat_ptr, cmd_ptr, cgm_s) static int indexprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->indexprec = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->indexprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1; return 1;
} }
/* Colour Precision */ /* Colour Precision */
static int colprec(dat_ptr, cmd_ptr, cgm_s) static int colprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->colprec = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->colprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1; return 1;
} }
/* Colour Index Precision */ /* Colour Index Precision */
static int cindprec(dat_ptr, cmd_ptr, cgm_s) static int cindprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->cindprec = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->cindprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1; return 1;
} }
/* Maximum Colour Index */ /* Maximum Colour Index */
static int maxcind(dat_ptr, cmd_ptr, cgm_s) static int maxcind(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->maxcind = b_guint(&dat_ptr, cgm_s->cindprec); cgm_s->maxcind = b_guint(&dat_ptr, cgm_s->cindprec);
return 1; return 1;
} }
/* Colour Value Extent */ /* Colour Value Extent */
static int cvextent(dat_ptr, cmd_ptr, cgm_s) static int cvextent(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
for (i=0; i<6; ++i) for (i=0; i<6; ++i)
@ -671,10 +635,7 @@ static int cvextent(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Metafile Element List */ /* Metafile Element List */
static int mfellist(dat_ptr, cmd_ptr, cgm_s) static int mfellist(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
cgm_s->mfellist_s = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->mfellist_s = b_gsint(&dat_ptr, cgm_s->intprec);
@ -688,10 +649,7 @@ static int mfellist(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Metafile Defaults Replacement, a complex element */ /* Metafile Defaults Replacement, a complex element */
static int mfdefrep(dat_ptr, cmd_ptr, cgm_s) static int mfdefrep(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
struct cmd_info_s new_cmd; /* for the new commands */ struct cmd_info_s new_cmd; /* for the new commands */
int i, new_len, b_to_move, data_left; int i, new_len, b_to_move, data_left;
@ -761,10 +719,7 @@ static int mfdefrep(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Font List, store the data, but ignored for now */ /* Font List, store the data, but ignored for now */
static int fontlist(dat_ptr, cmd_ptr, cgm_s) static int fontlist(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
unsigned char *my_ptr = NULL; unsigned char *my_ptr = NULL;
@ -783,10 +738,7 @@ static int fontlist(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Character Set List, stored but ignored */ /* Character Set List, stored but ignored */
static int charlist(dat_ptr, cmd_ptr, cgm_s) static int charlist(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
unsigned char *my_ptr = NULL; unsigned char *my_ptr = NULL;
@ -808,20 +760,14 @@ static int charlist(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Character Announcer */ /* Character Announcer */
static int charannounce(dat_ptr, cmd_ptr, cgm_s) static int charannounce(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->charannounce = b_gsint(&dat_ptr, 16); cgm_s->charannounce = b_gsint(&dat_ptr, 16);
return 1; return 1;
} }
/* Picture Descriptors */ /* Picture Descriptors */
/* Scaling Mode */ /* Scaling Mode */
static int scalmode(dat_ptr, cmd_ptr, cgm_s) static int scalmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->scalmode = b_gsint(&dat_ptr, 16); cgm_s->scalmode = b_gsint(&dat_ptr, 16);
@ -831,47 +777,32 @@ static int scalmode(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Colour Selection Mode */ /* Colour Selection Mode */
static int colselmode(dat_ptr, cmd_ptr, cgm_s) static int colselmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->colselmode = b_gsint(&dat_ptr, 16); cgm_s->colselmode = b_gsint(&dat_ptr, 16);
return 1; return 1;
} }
/* Line Width Specification Mode */ /* Line Width Specification Mode */
static int lwidspecmode(dat_ptr, cmd_ptr, cgm_s) static int lwidspecmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->lwidspecmode = b_gsint(&dat_ptr, 16); cgm_s->lwidspecmode = b_gsint(&dat_ptr, 16);
return 1; return 1;
} }
/* Marker Size Specification Mode */ /* Marker Size Specification Mode */
static int marksizspecmode(dat_ptr, cmd_ptr, cgm_s) static int marksizspecmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->marksizspecmode = b_gsint(&dat_ptr, 16); cgm_s->marksizspecmode = b_gsint(&dat_ptr, 16);
return 1; return 1;
} }
/* Edge Width Specification Mode */ /* Edge Width Specification Mode */
static int edwidspecmode(dat_ptr, cmd_ptr, cgm_s) static int edwidspecmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->edwidspecmode = b_gsint(&dat_ptr, 16); cgm_s->edwidspecmode = b_gsint(&dat_ptr, 16);
return 1; return 1;
} }
/* VDC Extent */ /* VDC Extent */
static int vdcextent(dat_ptr, cmd_ptr, cgm_s) static int vdcextent(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
@ -886,10 +817,7 @@ static int vdcextent(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Background Colour */ /* Background Colour */
static int backcolr(dat_ptr, cmd_ptr, cgm_s) static int backcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
for (i=0; i<3; ++i) for (i=0; i<3; ++i)
@ -899,19 +827,13 @@ static int backcolr(dat_ptr, cmd_ptr, cgm_s)
} }
/* Control Elements */ /* Control Elements */
/* VDC Integer Precision */ /* VDC Integer Precision */
static int vdcintprec(dat_ptr, cmd_ptr, cgm_s) static int vdcintprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->vdcintprec = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->vdcintprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1; return 1;
} }
/* VDC Real Precision */ /* VDC Real Precision */
static int vdcrprec(dat_ptr, cmd_ptr, cgm_s) static int vdcrprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->vdcrprec.fixed = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->vdcrprec.fixed = b_gsint(&dat_ptr, cgm_s->intprec);
cgm_s->vdcrprec.exp = b_gsint(&dat_ptr, cgm_s->intprec); cgm_s->vdcrprec.exp = b_gsint(&dat_ptr, cgm_s->intprec);
@ -920,10 +842,7 @@ static int vdcrprec(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Auxiliary Colour */ /* Auxiliary Colour */
static int auxcolr(dat_ptr, cmd_ptr, cgm_s) static int auxcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
switch(cgm_s->colselmode) { switch(cgm_s->colselmode) {
@ -936,10 +855,7 @@ static int auxcolr(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Transparency */ /* Transparency */
static int transp(dat_ptr, cmd_ptr, cgm_s) static int transp(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->transp = b_gsint(&dat_ptr, 16); cgm_s->transp = b_gsint(&dat_ptr, 16);
return 1; return 1;
@ -1061,10 +977,7 @@ unsigned int getXSegments(unsigned char *dat_ptr,
return noSegments; return noSegments;
} }
/* Polyline */ /* Polyline */
static int polyline(dat_ptr, cmd_ptr, cgm_s) static int polyline(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int noPts; int noPts;
XPoint *myPtr = NULL; XPoint *myPtr = NULL;
@ -1074,10 +987,7 @@ static int polyline(dat_ptr, cmd_ptr, cgm_s)
return(1); return(1);
} }
/* Disjoint Polyline, on/off segments */ /* Disjoint Polyline, on/off segments */
static int dispoly(dat_ptr, cmd_ptr, cgm_s) static int dispoly(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int noSegments; int noSegments;
XSegment *myPtr = NULL; XSegment *myPtr = NULL;
@ -1089,10 +999,7 @@ cgm_s_type *cgm_s;
return(1); return(1);
} }
/* Polymarker */ /* Polymarker */
static int polymarker(dat_ptr, cmd_ptr, cgm_s) static int polymarker(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int noPts, i, x, y, size, asize; int noPts, i, x, y, size, asize;
/* figure out the number of points */ /* figure out the number of points */
@ -1158,10 +1065,7 @@ void doText(cgm_s_type *cgm_s)
textX = textY = textW = textH = 0; textX = textY = textW = textH = 0;
} }
/* Regular Text */ /* Regular Text */
static int text(dat_ptr, cmd_ptr, cgm_s) static int text(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int final_flag; int final_flag;
partialText *newPtr, *myPtr; partialText *newPtr, *myPtr;
@ -1198,10 +1102,7 @@ static int text(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Restricted Text */ /* Restricted Text */
static int restext(dat_ptr, cmd_ptr, cgm_s) static int restext(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int final_flag; int final_flag;
partialText *newPtr, *myPtr; partialText *newPtr, *myPtr;
@ -1238,10 +1139,7 @@ static int restext(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Appended Text */ /* Appended Text */
static int apptext(dat_ptr, cmd_ptr, cgm_s) static int apptext(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
partialText *newPtr, *myPtr; partialText *newPtr, *myPtr;
if (!textPtr) return 0; /* can't append if there's nothing started ! */ if (!textPtr) return 0; /* can't append if there's nothing started ! */
@ -1267,10 +1165,7 @@ static int apptext(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Polygon */ /* Polygon */
static int polygon(dat_ptr, cmd_ptr, cgm_s) static int polygon(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int noPts; int noPts;
XPoint *myPtr = NULL; XPoint *myPtr = NULL;
@ -1288,10 +1183,7 @@ static int polygon(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Polyset */ /* Polyset */
static int polyset(dat_ptr, cmd_ptr, cgm_s) static int polyset(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i, noPts, *vPtr, lastFill; int i, noPts, *vPtr, lastFill;
XPoint *myPtr; XPoint *myPtr;
@ -1491,10 +1383,7 @@ static Pixel *getPixels(unsigned char *dat_ptr, cgm_s_type *cgm_s,
return retPtr; return retPtr;
} }
/* actually get the cellarray command */ /* actually get the cellarray command */
static int cellarray(dat_ptr, cmd_ptr, cgm_s) static int cellarray(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i, x[3], y[3], nx, ny, local_prec, rep_mode, xSize, ySize; int i, x[3], y[3], nx, ny, local_prec, rep_mode, xSize, ySize;
int Qx, Qy, Rx, Ry, det, xMin, xMax, yMin, yMax, newX, newY, ix, iy, int Qx, Qy, Rx, Ry, det, xMin, xMax, yMin, yMax, newX, newY, ix, iy,
@ -1575,10 +1464,7 @@ static int cellarray(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Rectangle */ /* Rectangle */
static int rectangle(dat_ptr, cmd_ptr, cgm_s) static int rectangle(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i, xPts[2], yPts[2], x, y, old_style; int i, xPts[2], yPts[2], x, y, old_style;
unsigned int w, h; unsigned int w, h;
@ -1622,10 +1508,7 @@ static int rectangle(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Circle */ /* Circle */
static int circle(dat_ptr, cmd_ptr, cgm_s) static int circle(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int x, y, r; int x, y, r;
/* get the center position and radius */ /* get the center position and radius */
@ -1705,10 +1588,7 @@ static int getArc(float inX[3], float inY[3], int *outXC, int *outYC,
return r; return r;
} }
/* Circular Arc, set by 3 points */ /* Circular Arc, set by 3 points */
static int circ3(dat_ptr, cmd_ptr, cgm_s) static int circ3(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int xc, yc, r, i; int xc, yc, r, i;
double theta0, dtheta; double theta0, dtheta;
@ -1738,10 +1618,7 @@ static int circ3(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Circular Arc, set by 3 points, close */ /* Circular Arc, set by 3 points, close */
static int circ3close(dat_ptr, cmd_ptr, cgm_s) static int circ3close(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int xc, yc, r, i, close_type, x0, y0, x2, y2; int xc, yc, r, i, close_type, x0, y0, x2, y2;
float det1, x[3], y[3]; /* use floats since we must manipulate them */ float det1, x[3], y[3]; /* use floats since we must manipulate them */
@ -1806,10 +1683,7 @@ static double getAngles(int xc, int yc, float dxy[4], double *outTheta0)
return dtheta; return dtheta;
} }
/* Circular Arc, set by center */ /* Circular Arc, set by center */
static int circcentre(dat_ptr, cmd_ptr, cgm_s) static int circcentre(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i, xc, yc, r; int i, xc, yc, r;
double theta0, dtheta; double theta0, dtheta;
@ -1834,10 +1708,7 @@ static int circcentre(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Circular Arc, set by center, close */ /* Circular Arc, set by center, close */
static int circcclose(dat_ptr, cmd_ptr, cgm_s) static int circcclose(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i, xc, yc, r, close_type, x0, y0, x1, y1; int i, xc, yc, r, close_type, x0, y0, x1, y1;
double theta0, dtheta; double theta0, dtheta;
@ -1994,10 +1865,7 @@ static int getEllipseXPoints(int x1, int y1, int x2, int y2,
return nSteps; return nSteps;
} }
/* Ellipse */ /* Ellipse */
static int ellipse(dat_ptr, cmd_ptr, cgm_s) static int ellipse(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int xc, yc, cdx0, cdy0, cdx1, cdy1, noPts, i; int xc, yc, cdx0, cdy0, cdx1, cdy1, noPts, i;
XPoint *myPtr = NULL; XPoint *myPtr = NULL;
@ -2032,10 +1900,7 @@ static int ellipse(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Elliptical arc */ /* Elliptical arc */
static int elarc(dat_ptr, cmd_ptr, cgm_s) static int elarc(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int xc, yc, cdx0, cdy0, cdx1, cdy1, i, noPts; int xc, yc, cdx0, cdy0, cdx1, cdy1, i, noPts;
float dxy[4]; float dxy[4];
@ -2068,10 +1933,7 @@ static int elarc(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Elliptical arc, close */ /* Elliptical arc, close */
static int elarcclose(dat_ptr, cmd_ptr, cgm_s) static int elarcclose(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int xc, yc, cdx0, cdy0, cdx1, cdy1, i, close_type, noPts; int xc, yc, cdx0, cdy0, cdx1, cdy1, i, close_type, noPts;
float dxy[4]; float dxy[4];
@ -2153,20 +2015,14 @@ static int setLineType(int inType, GC inGC)
return 1; return 1;
} }
/* Line Type */ /* Line Type */
static int ltype(dat_ptr, cmd_ptr, cgm_s) static int ltype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
/* get the line type */ /* get the line type */
cgm_s->ltype = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->ltype = b_gsint(&dat_ptr, cgm_s->indexprec);
return setLineType(cgm_s->ltype, lineGC); return setLineType(cgm_s->ltype, lineGC);
} }
/* Line Width */ /* Line Width */
static int lwidth(dat_ptr, cmd_ptr, cgm_s) static int lwidth(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
switch (cgm_s->lwidspecmode) { switch (cgm_s->lwidspecmode) {
case ABSOLUTE: case ABSOLUTE:
@ -2188,10 +2044,7 @@ static int lwidth(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Line Colour */ /* Line Colour */
static int lcolr(dat_ptr, cmd_ptr, cgm_s) static int lcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
@ -2209,10 +2062,7 @@ static int lcolr(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Marker Type */ /* Marker Type */
static int mtype(dat_ptr, cmd_ptr, cgm_s) static int mtype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
/* get the line type */ /* get the line type */
cgm_s->mtype = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->mtype = b_gsint(&dat_ptr, cgm_s->indexprec);
@ -2220,10 +2070,7 @@ static int mtype(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Marker Size */ /* Marker Size */
static int msize(dat_ptr, cmd_ptr, cgm_s) static int msize(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
switch (cgm_s->marksizspecmode) { switch (cgm_s->marksizspecmode) {
case ABSOLUTE: case ABSOLUTE:
@ -2241,10 +2088,7 @@ static int msize(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Marker Colour */ /* Marker Colour */
static int mcolr(dat_ptr, cmd_ptr, cgm_s) static int mcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
/* may be in direct colour mode or indexed colour mode */ /* may be in direct colour mode or indexed colour mode */
@ -2365,30 +2209,21 @@ static int talign(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr,
return 1; return 1;
} }
/* Character Set Index */ /* Character Set Index */
static int csetindex(dat_ptr, cmd_ptr, cgm_s) static int csetindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->csetindex = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->csetindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1; return 1;
} }
/* Alternate Character Set Index */ /* Alternate Character Set Index */
static int altcsetindex(dat_ptr, cmd_ptr, cgm_s) static int altcsetindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->altcsetindex = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->altcsetindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1; return 1;
} }
/* Interior Style */ /* Interior Style */
static int intstyle(dat_ptr, cmd_ptr, cgm_s) static int intstyle(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->intstyle = b_gsint(&dat_ptr, 16); cgm_s->intstyle = b_gsint(&dat_ptr, 16);
switch (cgm_s->intstyle) { switch (cgm_s->intstyle) {
@ -2409,10 +2244,7 @@ static int intstyle(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Fill Colour */ /* Fill Colour */
static int fillcolr(dat_ptr, cmd_ptr, cgm_s) static int fillcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
@ -2430,39 +2262,27 @@ static int fillcolr(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Hatch Index */ /* Hatch Index */
static int hatchindex(dat_ptr, cmd_ptr, cgm_s) static int hatchindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->hatchindex = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->hatchindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1; return 1;
} }
/* Pattern Index */ /* Pattern Index */
static int patindex(dat_ptr, cmd_ptr, cgm_s) static int patindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->patindex = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->patindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1; return 1;
} }
/* Edge Type */ /* Edge Type */
static int etype(dat_ptr, cmd_ptr, cgm_s) static int etype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->etype = b_gsint(&dat_ptr, cgm_s->indexprec); cgm_s->etype = b_gsint(&dat_ptr, cgm_s->indexprec);
return setLineType(cgm_s->etype, edgeGC); return setLineType(cgm_s->etype, edgeGC);
} }
/* Edge Width */ /* Edge Width */
static int ewidth(dat_ptr, cmd_ptr, cgm_s) static int ewidth(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
switch (cgm_s->edwidspecmode) { switch (cgm_s->edwidspecmode) {
case ABSOLUTE: case ABSOLUTE:
@ -2484,10 +2304,7 @@ static int ewidth(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Edge Colour */ /* Edge Colour */
static int ecolr(dat_ptr, cmd_ptr, cgm_s) static int ecolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i; int i;
@ -2505,10 +2322,7 @@ static int ecolr(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Edge Visibility */ /* Edge Visibility */
static int evis(dat_ptr, cmd_ptr, cgm_s) static int evis(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
cgm_s->evis = b_gsint(&dat_ptr, 16); cgm_s->evis = b_gsint(&dat_ptr, 16);
if (cgm_s->evis) { /* visible edge */ if (cgm_s->evis) { /* visible edge */
@ -2519,10 +2333,7 @@ static int evis(dat_ptr, cmd_ptr, cgm_s)
return 1; return 1;
} }
/* Colour Table */ /* Colour Table */
static int coltab(dat_ptr, cmd_ptr, cgm_s) static int coltab(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
{ {
int i, j, first_index, no_entries, iColrs[3]; int i, j, first_index, no_entries, iColrs[3];

View file

@ -24,9 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
int main(argc, argv) int main(int argc, char **argv)
int argc ;
char **argv;
{ {
/* first parameter d or h */ /* first parameter d or h */
/* second parameter is library name, other params are classnames */ /* second parameter is library name, other params are classnames */

View file

@ -24,9 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
int main(argc, argv) int main(int argc, char **argv)
int argc ;
char **argv ;
{ {
FILE *f ; FILE *f ;
int i; int i;