This is ref.h in view mode; [Download] [Up]
/* ref.h
*/
/*
* Copyright (c) 1991 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/* for each reference type (ie, book, manual, etc. ) defined,
* there is a RefEnt structure. Each RefEnt struct is linked
* to each other. Each RefEnt struct also points to an
* execution tree (made up of ExecEnt's) which define the
* actions to be implemented for ea. style.
*/
typedef struct exec_ent {
int (*ex_func)(); /* what function to execute */
char *ex_arg; /* pass an arg */
struct exec_ent *ex_true; /* do this next if e_func() returns true */
struct exec_ent *ex_false; /* else do this nex */
struct exec_ent *ex_next; /* links to next top level field */
} ExecEnt;
/* this structure defines a list of bitfields which define
* both the mandatory and optional fields for a particular RefEnt/style.
* Since there are possible alternative fields for, this needs to be
* a list. For example the style may define either 'author|editor|editors'
* as mandatory. The first bitfield in the list is the unique choices.
* All subsequent bitfields in the list, if any, define choices from which
* only one can be present.
*/
typedef struct reffldlst {
long fl_flds;
struct reffldlst *fl_next;
} RefFldList;
typedef struct ref_ent {
RefType re_type; /* ie, book, manual, proceedings, etc. */
RefFldList *re_mandatory; /* bitfield defining mandatory fields */
RefFldList *re_optional; /* bitfield defining optional fields */
ExecEnt *re_exec; /* -> execution tree. */
struct ref_ent *re_next; /* next referenct type. */
} RefEnt;
RefEnt *new_refent();
RefEnt *find_refent();
ExecEnt *new_execent();
RefFldList *new_fldlist();
RefFldList *get_altflds();
#define ADDFLD(bitfield, fldnum) ((bitfield) |= (1<<(fldnum)))
#define TESTFLD(bitfield, fldnum) ((bitfield) & (1<<(fldnum)))
#define REMFLD( bitfield, fldnum) ((bitfield) &= ~(1<<(fldnum)))
/* test whether a bib field exists in BibEnt */
#define FLDPRESENT( rollcall, fld ) (((rollcall) & (1<<fld)) != 0)
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.