|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 3316 (0xcf4) Types: TextFile Names: »recs.h«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z« └─⟦d846658bd⟧ └─⟦this⟧ »osimis/h/recs.h«
/* * Copyright (c) 1988 University College London * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the Department of Computer Science, University College London. * The name of the University may not be used to * endorse or promote products derived from this software without * specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* internal record structure for the display in osimon program */ typedef struct { COMPID m_compid; /* component id */ int m_time; /* timestamp */ int m_len; /* length of text */ char *m_text; /* text of record */ char *m_otext; /* text of previous version */ int m_lines; /* no of lines in record */ int m_olines; /* no of lines in previous record * in this slot */ int m_flag; /* set to indicate record status */ } REC, *RECID; #define RECSZ (sizeof(REC)) /*predicates*/ #define atstart(id) (id == recs) /* T if id->first record */ #define pastend(id) (id == endrec) /* T if id has never passed last rec*/ #define before(id1, id2) (id1 < id2) /* T if id->rec in front of id2 * in the defined sort order */ #define equal(id1, id2) (id1 == id2) /* T if they identify the same rec */ #define empty() (recs == endrec) /* T if there are no recs */ #define realrec(id) ((id >= recs) && (id < endrec)) /* T if id identifies a genuine rec */ #define idok(id) ((id >= recs) && (id <= endrec)) /* T if id valid RECID */ /*field selectors*/ #define linecnt(id) (id->m_lines) /* no of lines in text part */ #define olinecnt(id) (id->m_olines) /* as above for old record */ #define text(id) (id->m_text) /* text part */ #define otext(id) (id->m_otext) /* text part of old record */ #define entime(id) (id->m_time) /* entered time */ #define recflag(id) (id->m_flag) /* indicates changes or deletions */ /* return codes from enterrec (recflag values) */ #define R_NEW 1 #define R_CHANGE 2 #define R_NOCHANGE 3 #define R_DEL 4 #define R_ERROR -1 /* sequential operators */ #define incr(id) (RECID)++id /* moves id to next rec */ #define decr(id) (RECID)--id /* moves id to prev rec */ #define next(id) ((RECID)id+1) /* next rec (id unchanged) */ #define prev(id) ((RECID)id-1) /* prev rec (id unchanged) */ /* bisect two records - gets an id for a rec between * two others (useful for screen management) */ #define middle(id1, id2) ((RECID)id1 + ((int)((RECID)id2 - (RECID)id1) + 1)/2) /* find first and last records */ #define first() ((RECID)recs) #define last() ((RECID)(endrec-1)) #define nextslot() ((RECID)endrec) /* empty slot at end */