|
|
1.1 ! root 1: /* pe_cmp.c - compare two presentation elements */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/psap/RCS/pe_cmp.c,v 7.0 89/11/23 22:13:01 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/psap/RCS/pe_cmp.c,v 7.0 89/11/23 22:13:01 mrose Rel $ ! 9: * ! 10: * ! 11: * $Log: pe_cmp.c,v $ ! 12: * Revision 7.0 89/11/23 22:13:01 mrose ! 13: * Release 6.0 ! 14: * ! 15: */ ! 16: ! 17: /* ! 18: * NOTICE ! 19: * ! 20: * Acquisition, use, and distribution of this module and related ! 21: * materials are subject to the restrictions of a license agreement. ! 22: * Consult the Preface in the User's Manual for the full terms of ! 23: * this agreement. ! 24: * ! 25: */ ! 26: ! 27: ! 28: /* LINTLIBRARY */ ! 29: ! 30: #include <stdio.h> ! 31: #include "psap.h" ! 32: ! 33: /* */ ! 34: ! 35: int pe_cmp (p, q) ! 36: register PE p, ! 37: q; ! 38: { ! 39: register int i; ! 40: ! 41: if (p == NULLPE) ! 42: return (q ? 1 : 0); ! 43: if (q == NULLPE ! 44: || p -> pe_class != q -> pe_class ! 45: || p -> pe_form != q -> pe_form ! 46: || p -> pe_id != q -> pe_id) ! 47: return 1; ! 48: ! 49: /* XXX: perhaps compare pe_context ??? */ ! 50: ! 51: switch (p -> pe_form) { ! 52: case PE_FORM_ICONS: ! 53: if (p -> pe_ilen != q -> pe_ilen) ! 54: return 1; ! 55: /* else fall */ ! 56: case PE_FORM_PRIM: ! 57: if (i = p -> pe_len) { ! 58: if (i != q -> pe_len || PEDcmp (p -> pe_prim, q -> pe_prim, i)) ! 59: return 1; ! 60: } ! 61: else ! 62: if (q -> pe_len) ! 63: return 1; ! 64: return 0; ! 65: ! 66: case PE_FORM_CONS: ! 67: for (p = p -> pe_cons, q = q -> pe_cons; ! 68: p; ! 69: p = p -> pe_next, q = q -> pe_next) ! 70: if (pe_cmp (p, q)) ! 71: return 1; ! 72: return (q ? 1 : 0); ! 73: ! 74: default: /* XXX */ ! 75: return 1; ! 76: } ! 77: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.