From 63cafe41a93427118959a74201b3e331169a71d9 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Fri, 29 Sep 1995 17:11:52 +0000 Subject: [PATCH] Smallish --- asn/diagbib1.c | 7 +- asn/proto.c | 41 ++- asn/prt-acc.c | 7 +- asn/prt-dia.c | 7 +- asn/prt-exd.c | 9 +- asn/prt-exp.c | 9 +- asn/prt-ext.c | 7 +- asn/prt-grs.c | 7 +- asn/prt-rsc.c | 9 +- asn/zget.c | 35 +- ccl/cclerrms.c | 7 +- ccl/cclfind.c | 11 +- ccl/cclptree.c | 7 +- ccl/cclqual.c | 15 +- ccl/ccltoken.c | 7 +- comstack/tcpip.c | 1003 ++++++++++++++++++++++++++-------------------------- comstack/xmosi.c | 9 +- include/backend.h | 20 +- include/ccl.h | 27 +- include/comstack.h | 7 +- include/diagbib1.h | 7 +- include/dmalloc.h | 11 +- include/log.h | 13 +- include/marcdisp.h | 7 +- include/odr.h | 29 +- include/odr_use.h | 13 +- include/oid.h | 19 +- include/options.h | 7 +- include/pquery.h | 9 +- include/proto.h | 73 ++-- include/prt-acc.h | 7 +- include/prt-dia.h | 2 +- include/prt-exd.h | 4 +- include/prt-exp.h | 2 +- include/prt-ext.h | 2 +- include/prt-grs.h | 2 +- include/prt-rsc.h | 9 +- include/prt.h | 86 ++--- include/statserv.h | 11 +- include/tcpip.h | 9 +- include/xmosi.h | 9 +- include/yaz-ccl.h | 9 +- odr/ber_any.c | 9 +- odr/ber_bit.c | 7 +- odr/ber_bool.c | 7 +- odr/ber_int.c | 15 +- odr/ber_len.c | 9 +- odr/ber_null.c | 7 +- odr/ber_oct.c | 7 +- odr/ber_oid.c | 7 +- odr/ber_tag.c | 11 +- odr/dumpber.c | 7 +- odr/odr.c | 21 +- odr/odr_any.c | 7 +- odr/odr_bit.c | 7 +- odr/odr_bool.c | 7 +- odr/odr_choice.c | 9 +- odr/odr_cons.c | 11 +- odr/odr_int.c | 7 +- odr/odr_mem.c | 19 +- odr/odr_null.c | 7 +- odr/odr_oct.c | 9 +- odr/odr_oid.c | 7 +- odr/odr_seq.c | 11 +- odr/odr_tag.c | 7 +- odr/odr_use.c | 15 +- odr/odr_util.c | 6 +- server/statserv.c | 11 +- util/dmalloc.c | 11 +- util/log.c | 13 +- util/marcdisp.c | 7 +- util/oid.c | 19 +- util/options.c | 7 +- util/pquery.c | 9 +- util/yaz-ccl.c | 4 +- 75 files changed, 1053 insertions(+), 855 deletions(-) diff --git a/asn/diagbib1.c b/asn/diagbib1.c index 3e02d93..e914600 100644 --- a/asn/diagbib1.c +++ b/asn/diagbib1.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: diagbib1.c,v $ - * Revision 1.3 1995-09-27 15:02:39 quinn + * Revision 1.4 1995-09-29 17:11:52 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:39 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:50:21 quinn @@ -94,7 +97,7 @@ struct { { 0, NULL} }; -const char MDF *diagbib1_str (int code) +const char *diagbib1_str (int code) { int i; for (i=0; msg_tab[i].msg; i++) diff --git a/asn/proto.c b/asn/proto.c index c309e7b..d5910ea 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.38 1995-09-27 15:02:40 quinn + * Revision 1.39 1995-09-29 17:11:53 quinn + * Smallish + * + * Revision 1.38 1995/09/27 15:02:40 quinn * Modified function heads & prototypes. * * Revision 1.37 1995/08/21 09:10:15 quinn @@ -130,7 +133,7 @@ * We'll use a general octetstring here, since string operations are * clumsy on long strings. */ -int MDF z_SUTRS(ODR o, Odr_oct **p, int opt) +int z_SUTRS(ODR o, Odr_oct **p, int opt) { return odr_implicit(o, odr_octetstring, p, ODR_UNIVERSAL, ODR_GENERALSTRING, opt); @@ -141,7 +144,7 @@ int z_ReferenceId(ODR o, Z_ReferenceId **p, int opt) return odr_implicit(o, odr_octetstring, (Odr_oct**) p, ODR_CONTEXT, 2, opt); } -int MDF z_DatabaseName(ODR o, Z_DatabaseName **p, int opt) +int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt) { return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 105, opt); @@ -153,7 +156,7 @@ int z_ResultSetId(ODR o, char **p, int opt) opt); } -int MDF z_ElementSetName(ODR o, char **p, int opt) +int z_ElementSetName(ODR o, char **p, int opt) { return odr_implicit(o, odr_visiblestring, p, ODR_CONTEXT, 103, opt); } @@ -164,7 +167,7 @@ int z_UserInformationField(ODR o, Z_External **p, int opt) 11, opt); } -int MDF z_InternationalString(ODR o, char **p, int opt) +int z_InternationalString(ODR o, char **p, int opt) { return odr_generalstring(o, p, opt); } @@ -179,7 +182,7 @@ int z_InfoCategory(ODR o, Z_InfoCategory **p, int opt) odr_sequence_end(o); } -int MDF z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt) +int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt) { static Odr_arm arm[] = { @@ -201,7 +204,7 @@ int MDF z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt) odr_sequence_end(o); } -int MDF z_OtherInformation(ODR o, Z_OtherInformation **p, int opt) +int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt) { if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); @@ -215,7 +218,7 @@ int MDF z_OtherInformation(ODR o, Z_OtherInformation **p, int opt) return opt && odr_ok(o); } -int MDF z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt) +int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt) { static Odr_arm arm[] = { @@ -239,7 +242,7 @@ int MDF z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt) /* * check tagging!! */ -int MDF z_Unit(ODR o, Z_Unit **p, int opt) +int z_Unit(ODR o, Z_Unit **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -253,7 +256,7 @@ int MDF z_Unit(ODR o, Z_Unit **p, int opt) odr_sequence_end(o); } -int MDF z_IntUnit(ODR o, Z_IntUnit **p, int opt) +int z_IntUnit(ODR o, Z_IntUnit **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -266,7 +269,7 @@ int MDF z_IntUnit(ODR o, Z_IntUnit **p, int opt) /* ---------------------- INITIALIZE SERVICE ------------------- */ #if 0 -int MDF z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt) +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -290,7 +293,7 @@ int z_IdPass(ODR o, Z_IdPass **p, int opt) odr_sequence_end(o); } -int MDF z_StrAuthentication(ODR o, char **p, int opt) +int z_StrAuthentication(ODR o, char **p, int opt) { return odr_visiblestring(o, p, opt); } @@ -530,7 +533,7 @@ int z_AttributeElement(ODR o, Z_AttributeElement **p, int opt) odr_sequence_end(o); } -int MDF z_Term(ODR o, Z_Term **p, int opt) +int z_Term(ODR o, Z_Term **p, int opt) { static Odr_arm arm[] = { @@ -758,7 +761,7 @@ int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt) #ifdef Z_95 -int MDF z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt) +int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt) { static Odr_arm arm[] = { @@ -783,7 +786,7 @@ int MDF z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt) odr_sequence_end(o); } -int MDF z_DiagRec(ODR o, Z_DiagRec **p, int opt) +int z_DiagRec(ODR o, Z_DiagRec **p, int opt) { static Odr_arm arm[] = { @@ -942,7 +945,7 @@ int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt) /* ------------------------ SCAN SERVICE -------------------- */ -int MDF z_AttributeList(ODR o, Z_AttributeList **p, int opt) +int z_AttributeList(ODR o, Z_AttributeList **p, int opt) { if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); @@ -1198,7 +1201,7 @@ int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt) return opt && odr_ok(o); } -int MDF z_Specification(ODR o, Z_Specification **p, int opt) +int z_Specification(ODR o, Z_Specification **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -1423,7 +1426,7 @@ int z_Close(ODR o, Z_Close **p, int opt) /* ------------------------ APDU ------------------------- */ -int MDF z_Permissions(ODR o, Z_Permissions **p, int opt) +int z_Permissions(ODR o, Z_Permissions **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -1473,7 +1476,7 @@ int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt) /* ------------------------ APDU ------------------------- */ -int MDF z_APDU(ODR o, Z_APDU **p, int opt) +int z_APDU(ODR o, Z_APDU **p, int opt) { static Odr_arm arm[] = { diff --git a/asn/prt-acc.c b/asn/prt-acc.c index ab9bd55..f3b8600 100644 --- a/asn/prt-acc.c +++ b/asn/prt-acc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-acc.c,v $ - * Revision 1.4 1995-09-27 15:02:41 quinn + * Revision 1.5 1995-09-29 17:11:53 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:41 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/08/15 11:59:41 quinn @@ -156,7 +159,7 @@ int z_Response1(ODR o, Z_Response1 **p, int opt) return opt && odr_ok(o); } -int MDF z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt) +int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt) { static Odr_arm arm[] = { diff --git a/asn/prt-dia.c b/asn/prt-dia.c index f42f81f..f31a0de 100644 --- a/asn/prt-dia.c +++ b/asn/prt-dia.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-dia.c,v $ - * Revision 1.2 1995-09-27 15:02:41 quinn + * Revision 1.3 1995-09-29 17:11:54 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:41 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/08/29 11:19:31 quinn @@ -353,7 +356,7 @@ int z_DiagnosticUnit(ODR o, Z_DiagnosticUnit **p, int opt) odr_sequence_end(o); } -int MDF z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt) +int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt) { if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); diff --git a/asn/prt-exd.c b/asn/prt-exd.c index 0508f17..b8c94c3 100644 --- a/asn/prt-exd.c +++ b/asn/prt-exd.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-exd.c,v $ - * Revision 1.2 1995-09-27 15:02:41 quinn + * Revision 1.3 1995-09-29 17:11:54 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:41 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/08/21 09:16:32 quinn @@ -15,7 +18,7 @@ #include -int MDF z_TaskPackage(ODR o, Z_TaskPackage **p, int opt) +int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -175,7 +178,7 @@ int z_IOTaskPackage(ODR o, Z_IOTaskPackage **p, int opt) odr_sequence_end(o); } -int MDF z_ItemOrder(ODR o, Z_ItemOrder **p, int opt) +int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt) { static Odr_arm arm[] = { diff --git a/asn/prt-exp.c b/asn/prt-exp.c index f5ce37e..3fd16e1 100644 --- a/asn/prt-exp.c +++ b/asn/prt-exp.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-exp.c,v $ - * Revision 1.3 1995-09-27 15:02:42 quinn + * Revision 1.4 1995-09-29 17:11:54 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:42 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/08/15 11:59:43 quinn @@ -95,7 +98,7 @@ int z_UnitType(ODR o, Z_UnitType **p, int opt); int z_Units(ODR o, Z_Units **p, int opt); int z_CategoryList(ODR o, Z_CategoryList **p, int opt); int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt); -int MDF z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); +int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); int z_LanguageCode(ODR o, char **p, int opt) { @@ -1345,7 +1348,7 @@ int z_CategoryInfo(ODR o, Z_CategoryInfo **p, int opt) odr_sequence_end(o); } -int MDF z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt) +int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt) { static Odr_arm arm[] = { diff --git a/asn/prt-ext.c b/asn/prt-ext.c index 34e9d42..688ef28 100644 --- a/asn/prt-ext.c +++ b/asn/prt-ext.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-ext.c,v $ - * Revision 1.5 1995-09-27 15:02:42 quinn + * Revision 1.6 1995-09-29 17:11:55 quinn + * Smallish + * + * Revision 1.5 1995/09/27 15:02:42 quinn * Modified function heads & prototypes. * * Revision 1.4 1995/08/29 11:17:16 quinn @@ -24,7 +27,7 @@ #include -int MDF z_External(ODR o, Z_External **p, int opt) +int z_External(ODR o, Z_External **p, int opt) { oident *oid; diff --git a/asn/prt-grs.c b/asn/prt-grs.c index a81bafa..72c595c 100644 --- a/asn/prt-grs.c +++ b/asn/prt-grs.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-grs.c,v $ - * Revision 1.3 1995-09-27 15:02:43 quinn + * Revision 1.4 1995-09-29 17:11:55 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:43 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/08/28 10:58:58 quinn @@ -29,7 +32,7 @@ int z_HitVector(ODR o, Z_HitVector **p, int opt); int z_Triple(ODR o, Z_Triple **p, int opt); int z_Variant(ODR o, Z_Variant **p, int opt); -int MDF z_GenericRecord(ODR o, Z_GenericRecord **p, int opt) +int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt) { if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); diff --git a/asn/prt-rsc.c b/asn/prt-rsc.c index efec5e4..a7466f8 100644 --- a/asn/prt-rsc.c +++ b/asn/prt-rsc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-rsc.c,v $ - * Revision 1.4 1995-09-27 15:02:43 quinn + * Revision 1.5 1995-09-29 17:11:55 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:43 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/06/02 09:49:15 quinn @@ -34,7 +37,7 @@ int z_Estimate1(ODR o, Z_Estimate1 **p, int opt) odr_sequence_end(o); } -int MDF z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt) +int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); @@ -61,7 +64,7 @@ int z_Estimate2(ODR o, Z_Estimate2 **p, int opt) odr_sequence_end(o); } -int MDF z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt) +int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt) { if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); diff --git a/asn/zget.c b/asn/zget.c index 6dd9673..aeed16d 100644 --- a/asn/zget.c +++ b/asn/zget.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zget.c,v $ - * Revision 1.8 1995-09-27 15:02:43 quinn + * Revision 1.9 1995-09-29 17:11:55 quinn + * Smallish + * + * Revision 1.8 1995/09/27 15:02:43 quinn * Modified function heads & prototypes. * * Revision 1.7 1995/06/15 07:44:52 quinn @@ -33,7 +36,7 @@ #include -Z_InitRequest MDF *zget_InitRequest(ODR o) +Z_InitRequest *zget_InitRequest(ODR o) { Z_InitRequest *r = odr_malloc(o, sizeof(*r)); @@ -57,7 +60,7 @@ Z_InitRequest MDF *zget_InitRequest(ODR o) return r; } -Z_InitResponse MDF *zget_InitResponse(ODR o) +Z_InitResponse *zget_InitResponse(ODR o) { Z_InitResponse *r = odr_malloc(o, sizeof(*r)); @@ -82,7 +85,7 @@ Z_InitResponse MDF *zget_InitResponse(ODR o) return r; } -Z_SearchRequest MDF *zget_SearchRequest(ODR o) +Z_SearchRequest *zget_SearchRequest(ODR o) { Z_SearchRequest *r = odr_malloc(o, sizeof(*r)); @@ -109,7 +112,7 @@ Z_SearchRequest MDF *zget_SearchRequest(ODR o) return r; } -Z_SearchResponse MDF *zget_SearchResponse(ODR o) +Z_SearchResponse *zget_SearchResponse(ODR o) { Z_SearchResponse *r = odr_malloc(o, sizeof(*r)); @@ -132,7 +135,7 @@ Z_SearchResponse MDF *zget_SearchResponse(ODR o) return r; } -Z_PresentRequest MDF *zget_PresentRequest(ODR o) +Z_PresentRequest *zget_PresentRequest(ODR o) { Z_PresentRequest *r = odr_malloc(o, sizeof(*r)); @@ -159,7 +162,7 @@ Z_PresentRequest MDF *zget_PresentRequest(ODR o) return r; } -Z_PresentResponse MDF *zget_PresentResponse(ODR o) +Z_PresentResponse *zget_PresentResponse(ODR o) { Z_PresentResponse *r = odr_malloc(o, sizeof(*r)); @@ -177,7 +180,7 @@ Z_PresentResponse MDF *zget_PresentResponse(ODR o) return r; } -Z_DeleteResultSetRequest MDF *zget_DeleteResultSetRequest(ODR o) +Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o) { Z_DeleteResultSetRequest *r = odr_malloc(o, sizeof(*r)); @@ -192,7 +195,7 @@ Z_DeleteResultSetRequest MDF *zget_DeleteResultSetRequest(ODR o) return r; } -Z_DeleteResultSetResponse MDF *zget_DeleteResultSetResponse(ODR o) +Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o) { Z_DeleteResultSetResponse *r = odr_malloc(o, sizeof(*r)); @@ -211,7 +214,7 @@ Z_DeleteResultSetResponse MDF *zget_DeleteResultSetResponse(ODR o) return r; } -Z_ScanRequest MDF *zget_ScanRequest(ODR o) +Z_ScanRequest *zget_ScanRequest(ODR o) { Z_ScanRequest *r = odr_malloc(o, sizeof(*r)); @@ -230,7 +233,7 @@ Z_ScanRequest MDF *zget_ScanRequest(ODR o) return r; } -Z_ScanResponse MDF *zget_ScanResponse(ODR o) +Z_ScanResponse *zget_ScanResponse(ODR o) { Z_ScanResponse *r = odr_malloc(o, sizeof(*r)); @@ -249,7 +252,7 @@ Z_ScanResponse MDF *zget_ScanResponse(ODR o) return r; } -Z_TriggerResourceControlRequest MDF *zget_TriggerResourceControlRequest(ODR o) +Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o) { Z_TriggerResourceControlRequest *r = odr_malloc(o, sizeof(*r)); @@ -264,7 +267,7 @@ Z_TriggerResourceControlRequest MDF *zget_TriggerResourceControlRequest(ODR o) return r; } -Z_ResourceControlRequest MDF *zget_ResourceControlRequest(ODR o) +Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o) { Z_ResourceControlRequest *r = odr_malloc(o, sizeof(*r)); @@ -281,7 +284,7 @@ Z_ResourceControlRequest MDF *zget_ResourceControlRequest(ODR o) return r; } -Z_ResourceControlResponse MDF *zget_ResourceControlResponse(ODR o) +Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o) { Z_ResourceControlResponse *r = odr_malloc(o, sizeof(*r)); @@ -335,7 +338,7 @@ Z_Segment *zget_Segment(ODR o) return r; } -Z_Close MDF *zget_Close(ODR o) +Z_Close *zget_Close(ODR o) { Z_Close *r = odr_malloc(o, sizeof(*r)); @@ -351,7 +354,7 @@ Z_Close MDF *zget_Close(ODR o) return r; } -Z_APDU MDF *zget_APDU(ODR o, enum Z_APDU_which which) +Z_APDU *zget_APDU(ODR o, enum Z_APDU_which which) { Z_APDU *r = odr_malloc(o, sizeof(*r)); diff --git a/ccl/cclerrms.c b/ccl/cclerrms.c index bcdb4be..86a53be 100644 --- a/ccl/cclerrms.c +++ b/ccl/cclerrms.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: cclerrms.c,v $ - * Revision 1.2 1995-09-27 15:02:43 quinn + * Revision 1.3 1995-09-29 17:11:59 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:43 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/04/10 10:28:18 quinn @@ -43,7 +46,7 @@ char *err_msg_array[] = { "Right truncation not supported" }; -const char MDF *ccl_err_msg (int ccl_errno) +const char *ccl_err_msg (int ccl_errno) { return err_msg_array[ccl_errno]; } diff --git a/ccl/cclfind.c b/ccl/cclfind.c index 4305df4..6c08770 100644 --- a/ccl/cclfind.c +++ b/ccl/cclfind.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: cclfind.c,v $ - * Revision 1.2 1995-09-27 15:02:44 quinn + * Revision 1.3 1995-09-29 17:11:59 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:44 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/04/10 10:28:19 quinn @@ -109,7 +112,7 @@ static struct ccl_rpn_node *mk_node (enum rpn_node_kind kind) return p; } -void MDF ccl_rpn_delete (struct ccl_rpn_node *rpn) +void ccl_rpn_delete (struct ccl_rpn_node *rpn) { struct ccl_rpn_attr *attr, *attr1; if (!rpn) @@ -554,7 +557,7 @@ static struct ccl_rpn_node *find_spec (struct ccl_rpn_attr **qa) return p1; } -struct ccl_rpn_node MDF *ccl_find (CCL_bibset abibset, struct ccl_token *list, +struct ccl_rpn_node *ccl_find (CCL_bibset abibset, struct ccl_token *list, int *error, const char **pos) { struct ccl_rpn_node *p; @@ -579,7 +582,7 @@ struct ccl_rpn_node MDF *ccl_find (CCL_bibset abibset, struct ccl_token *list, return p; } -struct ccl_rpn_node MDF *ccl_find_str (CCL_bibset bibset, const char *str, +struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, int *error, int *pos) { struct ccl_token *list; diff --git a/ccl/cclptree.c b/ccl/cclptree.c index f91d270..2b2cb9a 100644 --- a/ccl/cclptree.c +++ b/ccl/cclptree.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: cclptree.c,v $ - * Revision 1.2 1995-09-27 15:02:44 quinn + * Revision 1.3 1995-09-29 17:11:59 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:44 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/04/10 10:28:20 quinn @@ -31,7 +34,7 @@ #include -void MDF ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out) +void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out) { switch (rpn->kind) diff --git a/ccl/cclqual.c b/ccl/cclqual.c index 3fb76c7..3c0a6de 100644 --- a/ccl/cclqual.c +++ b/ccl/cclqual.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: cclqual.c,v $ - * Revision 1.2 1995-09-27 15:02:44 quinn + * Revision 1.3 1995-09-29 17:12:00 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:44 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/04/10 10:28:20 quinn @@ -38,7 +41,7 @@ struct ccl_qualifiers { struct ccl_qualifier *list; }; -void MDF ccl_qual_add (CCL_bibset b, const char *name, int no, int *pairs) +void ccl_qual_add (CCL_bibset b, const char *name, int no, int *pairs) { struct ccl_qualifier *q; struct ccl_rpn_attr **attrp; @@ -80,7 +83,7 @@ void MDF ccl_qual_add (CCL_bibset b, const char *name, int no, int *pairs) *attrp = NULL; } -CCL_bibset MDF ccl_qual_mk (void) +CCL_bibset ccl_qual_mk (void) { CCL_bibset b = malloc (sizeof(*b)); assert (b); @@ -88,13 +91,13 @@ CCL_bibset MDF ccl_qual_mk (void) return b; } -void MDF ccl_qual_rm (CCL_bibset *b) +void ccl_qual_rm (CCL_bibset *b) { assert (*b); *b = NULL; } -struct ccl_rpn_attr MDF *ccl_qual_search (CCL_bibset b, const char *name, int len) +struct ccl_rpn_attr *ccl_qual_search (CCL_bibset b, const char *name, int len) { struct ccl_qualifier *q; @@ -105,7 +108,7 @@ struct ccl_rpn_attr MDF *ccl_qual_search (CCL_bibset b, const char *name, int le return NULL; } -void MDF ccl_qual_file (CCL_bibset bibset, FILE *inf) +void ccl_qual_file (CCL_bibset bibset, FILE *inf) { char line[256]; char *cp; diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c index edd2974..db6edd6 100644 --- a/ccl/ccltoken.c +++ b/ccl/ccltoken.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: ccltoken.c,v $ - * Revision 1.2 1995-09-27 15:02:44 quinn + * Revision 1.3 1995-09-29 17:12:00 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:44 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/04/10 10:28:22 quinn @@ -47,7 +50,7 @@ const char *ccl_token_or = "or"; const char *ccl_token_not = "not"; const char *ccl_token_set = "set"; -struct ccl_token MDF *ccl_tokenize (const char *command) +struct ccl_token *ccl_tokenize (const char *command) { const char *cp = command; struct ccl_token *first = NULL; diff --git a/comstack/tcpip.c b/comstack/tcpip.c index 0c49f28..3fdb3e2 100644 --- a/comstack/tcpip.c +++ b/comstack/tcpip.c @@ -1,502 +1,505 @@ -/* - * Copyright (c) 1995, Index Data - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * +/* + * Copyright (c) 1995, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * * $Log: tcpip.c,v $ - * Revision 1.5 1995-09-29 17:01:48 quinn + * Revision 1.6 1995-09-29 17:12:00 quinn + * Smallish + * + * Revision 1.5 1995/09/29 17:01:48 quinn * More Windows work - * - * Revision 1.4 1995/09/28 10:12:26 quinn - * Windows-support changes - * - * Revision 1.3 1995/09/27 15:02:45 quinn - * Modified function heads & prototypes. - * - * Revision 1.2 1995/06/15 12:30:06 quinn - * Added @ as hostname alias for INADDR ANY. - * - * Revision 1.1 1995/06/14 09:58:20 quinn - * Renamed yazlib to comstack. - * - * Revision 1.20 1995/05/16 08:51:16 quinn - * License, documentation, and memory fixes - * - * Revision 1.19 1995/04/10 10:24:08 quinn - * Some bug-fixes. - * - * Revision 1.18 1995/03/30 13:29:27 quinn - * Added REUSEADDR in tcpip_bind - * - * Revision 1.17 1995/03/27 08:36:10 quinn - * Some work on nonblocking operation in xmosi.c and rfct.c. - * Added protocol parameter to cs_create() - * - * Revision 1.16 1995/03/21 15:53:41 quinn - * Added rcvconnect - * - * Revision 1.15 1995/03/21 12:31:27 quinn - * Added check for EINPROGRESS on connect. - * - * Revision 1.14 1995/03/20 09:47:21 quinn - * Added server-side support to xmosi.c - * Fixed possible problems in rfct - * Other little mods - * - * Revision 1.13 1995/03/15 16:15:13 adam - * Removed p_write. - * - * Revision 1.12 1995/03/15 15:36:27 quinn - * Mods to support nonblocking I/O - * - * Revision 1.11 1995/03/15 08:37:57 quinn - * Now we're pretty much set for nonblocking I/O. - * - * Revision 1.10 1995/03/14 17:00:07 quinn - * Bug-fixes - added tracing info to tcpip.c - * - * Revision 1.9 1995/03/14 10:28:42 quinn - * Adding server-side support to tcpip.c and fixing bugs in nonblocking I/O - * - * Revision 1.8 1995/03/10 14:22:50 quinn - * Removed debug output. - * - * Revision 1.7 1995/03/10 11:44:59 quinn - * Fixes and debugging - * - * Revision 1.6 1995/03/07 10:26:55 quinn - * Initialized type field in the comstacks. - * - * Revision 1.5 1995/02/14 20:40:07 quinn - * Various stuff. - * - * Revision 1.4 1995/02/14 11:54:49 quinn - * Beginning to add full CCL. - * - * Revision 1.3 1995/02/10 18:58:10 quinn - * Fixed tcpip_get (formerly tcpip_read). - * Turned tst (cli) into a proper, event-driven thingy. - * - * Revision 1.2 1995/02/10 15:55:47 quinn - * Small things. - * - * Revision 1.1 1995/02/09 15:51:52 quinn - * Works better now. - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -#ifndef WINDOWS -#include -#endif - -int tcpip_close(COMSTACK h); -int tcpip_put(COMSTACK h, char *buf, int size); -int tcpip_get(COMSTACK h, char **buf, int *bufsize); -int tcpip_connect(COMSTACK h, void *address); -int tcpip_more(COMSTACK h); -int tcpip_rcvconnect(COMSTACK h); -int tcpip_bind(COMSTACK h, void *address, int mode); -int tcpip_listen(COMSTACK h, char *addrp, int *addrlen); -COMSTACK tcpip_accept(COMSTACK h); - -int completeBER(unsigned char *buf, int len); - -#ifdef TRACE_TCPIP -#define TRC(x) x -#else -#define TRC(X) -#endif - -static int initialized = 0; - -typedef struct tcpip_state -{ - char *altbuf; /* alternate buffer for surplus data */ - int altsize; /* size as malloced */ - int altlen; /* length of data or 0 if none */ - - int written; /* -1 if we aren't writing */ - int towrite; /* to verify against user input */ -} tcpip_state; - -COMSTACK MDF tcpip_type(int blocking, int protocol) -{ - COMSTACK p; - tcpip_state *state; - int s; -#ifdef WINDOWS - unsigned long tru = 1; -#else - struct protoent *proto; -#endif - - if (!initialized) - { -#ifdef WINDOWS - WORD requested; - WSADATA wd; - - requested = MAKEWORD(1, 1); - if (WSAStartup(requested, &wd)) - return 0; -#endif - initialized = 1; - } - -#ifndef WINDOWS - if (!(proto = getprotobyname("tcp"))) - return 0; - if ((s = socket(AF_INET, SOCK_STREAM, proto->p_proto)) < 0) -#else - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) -#endif - return 0; - if (!(p = malloc(sizeof(struct comstack)))) - return 0; - if (!(state = p->private = malloc(sizeof(tcpip_state)))) - return 0; -#ifdef WINDOWS - if (!(p->blocking = blocking) && ioctlsocket(s, FIONBIO, &tru) < 0) -#else - if (!(p->blocking = blocking) && fcntl(s, F_SETFL, O_NONBLOCK) < 0) -#endif - return 0; - p->iofile = s; - p->type = tcpip_type; - p->protocol = protocol; - - p->f_connect = tcpip_connect; - p->f_rcvconnect = tcpip_rcvconnect; - p->f_get = tcpip_get; - p->f_put = tcpip_put; - p->f_close = tcpip_close; - p->f_more = tcpip_more; - p->f_bind = tcpip_bind; - p->f_listen = tcpip_listen; - p->f_accept = tcpip_accept; - - p->state = CS_UNBND; - p->event = CS_NONE; - p->cerrno = 0; - p->stackerr = 0; - - state->altbuf = 0; - state->altsize = state->altlen = 0; - state->towrite = state->written = -1; - - p->timeout = COMSTACK_DEFAULT_TIMEOUT; - TRC(fprintf(stderr, "Created new TCPIP comstack\n")); - - return p; -} - -struct sockaddr_in MDF *tcpip_strtoaddr(const char *str) -{ - static struct sockaddr_in add; - struct hostent *hp; - char *p, buf[512]; - short int port = 210; - unsigned tmpadd; - - TRC(fprintf(stderr, "tcpip_strtoaddress: %s\n", str ? str : "NULL")); - add.sin_family = AF_INET; - strcpy(buf, str); - if ((p = strchr(buf, ':'))) - { - *p = 0; - port = atoi(p + 1); - } - add.sin_port = htons(port); - if (!strcmp("@", buf)) - add.sin_addr.s_addr = INADDR_ANY; - else if ((hp = gethostbyname(buf))) - memcpy(&add.sin_addr.s_addr, *hp->h_addr_list, sizeof(struct in_addr)); - else if ((tmpadd = (unsigned) inet_addr(buf)) != 0) - memcpy(&add.sin_addr.s_addr, &tmpadd, sizeof(struct in_addr)); - else - return 0; - return &add; -} - -int tcpip_more(COMSTACK h) -{ - tcpip_state *sp = h->private; - - return sp->altlen && completeBER((unsigned char *) sp->altbuf, sp->altlen); -} - -/* - * connect(2) will block (sometimes) - nothing we can do short of doing - * weird things like spawning subprocesses or threading or some weird junk - * like that. - */ -int tcpip_connect(COMSTACK h, void *address) -{ - struct sockaddr_in *add = address; - - TRC(fprintf(stderr, "tcpip_connect\n")); - if (connect(h->iofile, (struct sockaddr *) add, sizeof(*add)) < 0) - { -#ifdef WINDOWS - if (WSAGetLastError() == WSAEWOULDBLOCK) -#else - if (errno == EINPROGRESS) -#endif - return 1; - return -1; - } - h->state = CS_DATAXFER; - return 0; -} - -/* - * nop - */ -int tcpip_rcvconnect(COMSTACK h) -{ - TRC(fprintf(stderr, "tcpip_rcvconnect\n")); - return 0; -} - -int tcpip_bind(COMSTACK h, void *address, int mode) -{ - struct sockaddr *addr = address; - unsigned long one = 1; - - TRC(fprintf(stderr, "tcpip_bind\n")); - if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) - { - h->cerrno = CSYSERR; - return -1; - } - if (bind(h->iofile, addr, sizeof(struct sockaddr_in)) < 0) - { - h->cerrno = CSYSERR; - return -1; - } - if (mode == CS_SERVER && listen(h->iofile, 3) < 0) - { - h->cerrno = CSYSERR; - return -1; - } - h->state = CS_IDLE; - return 0; -} - -int tcpip_listen(COMSTACK h, char *raddr, int *addrlen) -{ - struct sockaddr_in addr; - int len = sizeof(addr); - - TRC(fprintf(stderr, "tcpip_listen\n")); - if (h->state != CS_IDLE) - { - h->cerrno = CSOUTSTATE; - return -1; - } - if ((h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len)) < 0) - { -#ifdef WINDOWS - if (WSAGetLastError() == WSAEWOULDBLOCK) -#else - if (errno == EWOULDBLOCK) -#endif - - h->cerrno = CSNODATA; - else - h->cerrno = CSYSERR; - return -1; - } - if (addrlen && *addrlen > sizeof(struct sockaddr_in)) - memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_in)); - else if (addrlen) - *addrlen = 0; - h->state = CS_INCON; - return 0; -} - -COMSTACK tcpip_accept(COMSTACK h) -{ - COMSTACK new; - tcpip_state *state; -#ifdef WINDOWS - unsigned long tru = 1; -#endif - - TRC(fprintf(stderr, "tcpip_accept\n")); - if (h->state != CS_INCON) - { - h->cerrno = CSOUTSTATE; - return 0; - } - if (!(new = malloc(sizeof(*new)))) - { - h->cerrno = CSYSERR; - return 0; - } - memcpy(new, h, sizeof(*h)); - new->iofile = h->newfd; - if (!(state = new->private = malloc(sizeof(tcpip_state)))) - { - h->cerrno = CSYSERR; - return 0; - } -#ifdef WINDOWS - if (!new->blocking && ioctlsocket(new->iofile, FIONBIO, &tru) < 0) -#else - if (!new->blocking && fcntl(new->iofile, F_SETFL, O_NONBLOCK) < 0) -#endif - return 0; - state->altbuf = 0; - state->altsize = state->altlen = 0; - state->towrite = state->written = -1; - new->state = CS_DATAXFER; - h->state = CS_IDLE; - return new; -} - -#define CS_TCPIP_BUFCHUNK 4096 - -/* - * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, - * 0=connection closed. - */ -int tcpip_get(COMSTACK h, char **buf, int *bufsize) -{ - tcpip_state *sp = h->private; - char *tmpc; - int tmpi, berlen, rest, req, tomove; - int hasread = 0, res; - - TRC(fprintf(stderr, "tcpip_get: bufsize=%d\n", *bufsize)); - if (sp->altlen) /* switch buffers */ - { - TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, - (unsigned) sp->altbuf)); - tmpc = *buf; - tmpi = *bufsize; - *buf = sp->altbuf; - *bufsize = sp->altsize; - hasread = sp->altlen; - sp->altlen = 0; - sp->altbuf = tmpc; - sp->altsize = tmpi; - } - while (!(berlen = completeBER((unsigned char *)*buf, hasread))) - { - if (!*bufsize) - { - if (!(*buf = malloc(*bufsize = CS_TCPIP_BUFCHUNK))) - return -1; - } - else if (*bufsize - hasread < CS_TCPIP_BUFCHUNK) - if (!(*buf = realloc(*buf, *bufsize *= 2))) - return -1; - if ((res = recv(h->iofile, *buf + hasread, CS_TCPIP_BUFCHUNK, 0)) < 0) -#ifdef WINDOWS - if (WSAGetLastError() == WSAEWOULDBLOCK) -#else - if (errno == EWOULDBLOCK) -#endif - break; - else - return -1; - if (!res) - return 0; - hasread += res; - TRC(fprintf(stderr, " res=%d, hasread=%d\n", res, hasread)); - } - TRC(fprintf(stderr, " Out of read loop with hasread=%d, berlen=%d\n", - hasread, berlen)); - /* move surplus buffer (or everything if we didn't get a BER rec.) */ - if (hasread > berlen) - { - tomove = req = hasread - berlen; - rest = tomove % CS_TCPIP_BUFCHUNK; - if (rest) - req += CS_TCPIP_BUFCHUNK - rest; - if (!sp->altbuf) - { - if (!(sp->altbuf = malloc(sp->altsize = req))) - return -1; - } else if (sp->altsize < req) - if (!(sp->altbuf = realloc(sp->altbuf, sp->altsize = req))) - return -1; - TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, - (unsigned) sp->altbuf)); - memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); - } - if (berlen < CS_TCPIP_BUFCHUNK - 1) - *(*buf + berlen) = '\0'; - return berlen ? berlen : 1; -} - -/* - * Returns 1, 0 or -1 - * In nonblocking mode, you must call again with same buffer while - * return value is 1. - */ -int tcpip_put(COMSTACK h, char *buf, int size) -{ - int res; - struct tcpip_state *state = h->private; - - TRC(fprintf(stderr, "tcpip_put: size=%d\n", size)); - if (state->towrite < 0) - { - state->towrite = size; - state->written = 0; - } - else if (state->towrite != size) - { - h->cerrno = CSWRONGBUF; - return -1; - } - while (state->towrite > state->written) - { - if ((res = send(h->iofile, buf + state->written, size - - state->written, 0)) < 0) - { -#ifdef WINDOWS - if (WSAGetLastError() == WSAEWOULDBLOCK) -#else - if (errno == EAGAIN) -#endif - { - TRC(fprintf(stderr, " Flow control stop\n")); - return 1; - } - h->cerrno = CSYSERR; - return -1; - } - state->written += res; - TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", - res, state->written, size)); - } - state->towrite = state->written = -1; - TRC(fprintf(stderr, " Ok\n")); - return 0; -} - -int tcpip_close(COMSTACK h) -{ - tcpip_state *sp = h->private; - - TRC(fprintf(stderr, "tcpip_close\n")); - close(h->iofile); - if (sp->altbuf) - free(sp->altbuf); - free(sp); - free(h); - return 0; -} + * + * Revision 1.4 1995/09/28 10:12:26 quinn + * Windows-support changes + * + * Revision 1.3 1995/09/27 15:02:45 quinn + * Modified function heads & prototypes. + * + * Revision 1.2 1995/06/15 12:30:06 quinn + * Added @ as hostname alias for INADDR ANY. + * + * Revision 1.1 1995/06/14 09:58:20 quinn + * Renamed yazlib to comstack. + * + * Revision 1.20 1995/05/16 08:51:16 quinn + * License, documentation, and memory fixes + * + * Revision 1.19 1995/04/10 10:24:08 quinn + * Some bug-fixes. + * + * Revision 1.18 1995/03/30 13:29:27 quinn + * Added REUSEADDR in tcpip_bind + * + * Revision 1.17 1995/03/27 08:36:10 quinn + * Some work on nonblocking operation in xmosi.c and rfct.c. + * Added protocol parameter to cs_create() + * + * Revision 1.16 1995/03/21 15:53:41 quinn + * Added rcvconnect + * + * Revision 1.15 1995/03/21 12:31:27 quinn + * Added check for EINPROGRESS on connect. + * + * Revision 1.14 1995/03/20 09:47:21 quinn + * Added server-side support to xmosi.c + * Fixed possible problems in rfct + * Other little mods + * + * Revision 1.13 1995/03/15 16:15:13 adam + * Removed p_write. + * + * Revision 1.12 1995/03/15 15:36:27 quinn + * Mods to support nonblocking I/O + * + * Revision 1.11 1995/03/15 08:37:57 quinn + * Now we're pretty much set for nonblocking I/O. + * + * Revision 1.10 1995/03/14 17:00:07 quinn + * Bug-fixes - added tracing info to tcpip.c + * + * Revision 1.9 1995/03/14 10:28:42 quinn + * Adding server-side support to tcpip.c and fixing bugs in nonblocking I/O + * + * Revision 1.8 1995/03/10 14:22:50 quinn + * Removed debug output. + * + * Revision 1.7 1995/03/10 11:44:59 quinn + * Fixes and debugging + * + * Revision 1.6 1995/03/07 10:26:55 quinn + * Initialized type field in the comstacks. + * + * Revision 1.5 1995/02/14 20:40:07 quinn + * Various stuff. + * + * Revision 1.4 1995/02/14 11:54:49 quinn + * Beginning to add full CCL. + * + * Revision 1.3 1995/02/10 18:58:10 quinn + * Fixed tcpip_get (formerly tcpip_read). + * Turned tst (cli) into a proper, event-driven thingy. + * + * Revision 1.2 1995/02/10 15:55:47 quinn + * Small things. + * + * Revision 1.1 1995/02/09 15:51:52 quinn + * Works better now. + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifndef WINDOWS +#include +#endif + +int tcpip_close(COMSTACK h); +int tcpip_put(COMSTACK h, char *buf, int size); +int tcpip_get(COMSTACK h, char **buf, int *bufsize); +int tcpip_connect(COMSTACK h, void *address); +int tcpip_more(COMSTACK h); +int tcpip_rcvconnect(COMSTACK h); +int tcpip_bind(COMSTACK h, void *address, int mode); +int tcpip_listen(COMSTACK h, char *addrp, int *addrlen); +COMSTACK tcpip_accept(COMSTACK h); + +int completeBER(unsigned char *buf, int len); + +#ifdef TRACE_TCPIP +#define TRC(x) x +#else +#define TRC(X) +#endif + +static int initialized = 0; + +typedef struct tcpip_state +{ + char *altbuf; /* alternate buffer for surplus data */ + int altsize; /* size as malloced */ + int altlen; /* length of data or 0 if none */ + + int written; /* -1 if we aren't writing */ + int towrite; /* to verify against user input */ +} tcpip_state; + +COMSTACK tcpip_type(int blocking, int protocol) +{ + COMSTACK p; + tcpip_state *state; + int s; +#ifdef WINDOWS + unsigned long tru = 1; +#else + struct protoent *proto; +#endif + + if (!initialized) + { +#ifdef WINDOWS + WORD requested; + WSADATA wd; + + requested = MAKEWORD(1, 1); + if (WSAStartup(requested, &wd)) + return 0; +#endif + initialized = 1; + } + +#ifndef WINDOWS + if (!(proto = getprotobyname("tcp"))) + return 0; + if ((s = socket(AF_INET, SOCK_STREAM, proto->p_proto)) < 0) +#else + if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) +#endif + return 0; + if (!(p = malloc(sizeof(struct comstack)))) + return 0; + if (!(state = p->private = malloc(sizeof(tcpip_state)))) + return 0; +#ifdef WINDOWS + if (!(p->blocking = blocking) && ioctlsocket(s, FIONBIO, &tru) < 0) +#else + if (!(p->blocking = blocking) && fcntl(s, F_SETFL, O_NONBLOCK) < 0) +#endif + return 0; + p->iofile = s; + p->type = tcpip_type; + p->protocol = protocol; + + p->f_connect = tcpip_connect; + p->f_rcvconnect = tcpip_rcvconnect; + p->f_get = tcpip_get; + p->f_put = tcpip_put; + p->f_close = tcpip_close; + p->f_more = tcpip_more; + p->f_bind = tcpip_bind; + p->f_listen = tcpip_listen; + p->f_accept = tcpip_accept; + + p->state = CS_UNBND; + p->event = CS_NONE; + p->cerrno = 0; + p->stackerr = 0; + + state->altbuf = 0; + state->altsize = state->altlen = 0; + state->towrite = state->written = -1; + + p->timeout = COMSTACK_DEFAULT_TIMEOUT; + TRC(fprintf(stderr, "Created new TCPIP comstack\n")); + + return p; +} + +struct sockaddr_in *tcpip_strtoaddr(const char *str) +{ + static struct sockaddr_in add; + struct hostent *hp; + char *p, buf[512]; + short int port = 210; + unsigned tmpadd; + + TRC(fprintf(stderr, "tcpip_strtoaddress: %s\n", str ? str : "NULL")); + add.sin_family = AF_INET; + strcpy(buf, str); + if ((p = strchr(buf, ':'))) + { + *p = 0; + port = atoi(p + 1); + } + add.sin_port = htons(port); + if (!strcmp("@", buf)) + add.sin_addr.s_addr = INADDR_ANY; + else if ((hp = gethostbyname(buf))) + memcpy(&add.sin_addr.s_addr, *hp->h_addr_list, sizeof(struct in_addr)); + else if ((tmpadd = (unsigned) inet_addr(buf)) != 0) + memcpy(&add.sin_addr.s_addr, &tmpadd, sizeof(struct in_addr)); + else + return 0; + return &add; +} + +int tcpip_more(COMSTACK h) +{ + tcpip_state *sp = h->private; + + return sp->altlen && completeBER((unsigned char *) sp->altbuf, sp->altlen); +} + +/* + * connect(2) will block (sometimes) - nothing we can do short of doing + * weird things like spawning subprocesses or threading or some weird junk + * like that. + */ +int tcpip_connect(COMSTACK h, void *address) +{ + struct sockaddr_in *add = address; + + TRC(fprintf(stderr, "tcpip_connect\n")); + if (connect(h->iofile, (struct sockaddr *) add, sizeof(*add)) < 0) + { +#ifdef WINDOWS + if (WSAGetLastError() == WSAEWOULDBLOCK) +#else + if (errno == EINPROGRESS) +#endif + return 1; + return -1; + } + h->state = CS_DATAXFER; + return 0; +} + +/* + * nop + */ +int tcpip_rcvconnect(COMSTACK h) +{ + TRC(fprintf(stderr, "tcpip_rcvconnect\n")); + return 0; +} + +int tcpip_bind(COMSTACK h, void *address, int mode) +{ + struct sockaddr *addr = address; + unsigned long one = 1; + + TRC(fprintf(stderr, "tcpip_bind\n")); + if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) + { + h->cerrno = CSYSERR; + return -1; + } + if (bind(h->iofile, addr, sizeof(struct sockaddr_in)) < 0) + { + h->cerrno = CSYSERR; + return -1; + } + if (mode == CS_SERVER && listen(h->iofile, 3) < 0) + { + h->cerrno = CSYSERR; + return -1; + } + h->state = CS_IDLE; + return 0; +} + +int tcpip_listen(COMSTACK h, char *raddr, int *addrlen) +{ + struct sockaddr_in addr; + int len = sizeof(addr); + + TRC(fprintf(stderr, "tcpip_listen\n")); + if (h->state != CS_IDLE) + { + h->cerrno = CSOUTSTATE; + return -1; + } + if ((h->newfd = accept(h->iofile, (struct sockaddr*)&addr, &len)) < 0) + { +#ifdef WINDOWS + if (WSAGetLastError() == WSAEWOULDBLOCK) +#else + if (errno == EWOULDBLOCK) +#endif + + h->cerrno = CSNODATA; + else + h->cerrno = CSYSERR; + return -1; + } + if (addrlen && *addrlen > sizeof(struct sockaddr_in)) + memcpy(raddr, &addr, *addrlen = sizeof(struct sockaddr_in)); + else if (addrlen) + *addrlen = 0; + h->state = CS_INCON; + return 0; +} + +COMSTACK tcpip_accept(COMSTACK h) +{ + COMSTACK new; + tcpip_state *state; +#ifdef WINDOWS + unsigned long tru = 1; +#endif + + TRC(fprintf(stderr, "tcpip_accept\n")); + if (h->state != CS_INCON) + { + h->cerrno = CSOUTSTATE; + return 0; + } + if (!(new = malloc(sizeof(*new)))) + { + h->cerrno = CSYSERR; + return 0; + } + memcpy(new, h, sizeof(*h)); + new->iofile = h->newfd; + if (!(state = new->private = malloc(sizeof(tcpip_state)))) + { + h->cerrno = CSYSERR; + return 0; + } +#ifdef WINDOWS + if (!new->blocking && ioctlsocket(new->iofile, FIONBIO, &tru) < 0) +#else + if (!new->blocking && fcntl(new->iofile, F_SETFL, O_NONBLOCK) < 0) +#endif + return 0; + state->altbuf = 0; + state->altsize = state->altlen = 0; + state->towrite = state->written = -1; + new->state = CS_DATAXFER; + h->state = CS_IDLE; + return new; +} + +#define CS_TCPIP_BUFCHUNK 4096 + +/* + * Return: -1 error, >1 good, len of buffer, ==1 incomplete buffer, + * 0=connection closed. + */ +int tcpip_get(COMSTACK h, char **buf, int *bufsize) +{ + tcpip_state *sp = h->private; + char *tmpc; + int tmpi, berlen, rest, req, tomove; + int hasread = 0, res; + + TRC(fprintf(stderr, "tcpip_get: bufsize=%d\n", *bufsize)); + if (sp->altlen) /* switch buffers */ + { + TRC(fprintf(stderr, " %d bytes in altbuf (0x%x)\n", sp->altlen, + (unsigned) sp->altbuf)); + tmpc = *buf; + tmpi = *bufsize; + *buf = sp->altbuf; + *bufsize = sp->altsize; + hasread = sp->altlen; + sp->altlen = 0; + sp->altbuf = tmpc; + sp->altsize = tmpi; + } + while (!(berlen = completeBER((unsigned char *)*buf, hasread))) + { + if (!*bufsize) + { + if (!(*buf = malloc(*bufsize = CS_TCPIP_BUFCHUNK))) + return -1; + } + else if (*bufsize - hasread < CS_TCPIP_BUFCHUNK) + if (!(*buf = realloc(*buf, *bufsize *= 2))) + return -1; + if ((res = recv(h->iofile, *buf + hasread, CS_TCPIP_BUFCHUNK, 0)) < 0) +#ifdef WINDOWS + if (WSAGetLastError() == WSAEWOULDBLOCK) +#else + if (errno == EWOULDBLOCK) +#endif + break; + else + return -1; + if (!res) + return 0; + hasread += res; + TRC(fprintf(stderr, " res=%d, hasread=%d\n", res, hasread)); + } + TRC(fprintf(stderr, " Out of read loop with hasread=%d, berlen=%d\n", + hasread, berlen)); + /* move surplus buffer (or everything if we didn't get a BER rec.) */ + if (hasread > berlen) + { + tomove = req = hasread - berlen; + rest = tomove % CS_TCPIP_BUFCHUNK; + if (rest) + req += CS_TCPIP_BUFCHUNK - rest; + if (!sp->altbuf) + { + if (!(sp->altbuf = malloc(sp->altsize = req))) + return -1; + } else if (sp->altsize < req) + if (!(sp->altbuf = realloc(sp->altbuf, sp->altsize = req))) + return -1; + TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove, + (unsigned) sp->altbuf)); + memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove); + } + if (berlen < CS_TCPIP_BUFCHUNK - 1) + *(*buf + berlen) = '\0'; + return berlen ? berlen : 1; +} + +/* + * Returns 1, 0 or -1 + * In nonblocking mode, you must call again with same buffer while + * return value is 1. + */ +int tcpip_put(COMSTACK h, char *buf, int size) +{ + int res; + struct tcpip_state *state = h->private; + + TRC(fprintf(stderr, "tcpip_put: size=%d\n", size)); + if (state->towrite < 0) + { + state->towrite = size; + state->written = 0; + } + else if (state->towrite != size) + { + h->cerrno = CSWRONGBUF; + return -1; + } + while (state->towrite > state->written) + { + if ((res = send(h->iofile, buf + state->written, size - + state->written, 0)) < 0) + { +#ifdef WINDOWS + if (WSAGetLastError() == WSAEWOULDBLOCK) +#else + if (errno == EAGAIN) +#endif + { + TRC(fprintf(stderr, " Flow control stop\n")); + return 1; + } + h->cerrno = CSYSERR; + return -1; + } + state->written += res; + TRC(fprintf(stderr, " Wrote %d, written=%d, nbytes=%d\n", + res, state->written, size)); + } + state->towrite = state->written = -1; + TRC(fprintf(stderr, " Ok\n")); + return 0; +} + +int tcpip_close(COMSTACK h) +{ + tcpip_state *sp = h->private; + + TRC(fprintf(stderr, "tcpip_close\n")); + close(h->iofile); + if (sp->altbuf) + free(sp->altbuf); + free(sp); + free(h); + return 0; +} diff --git a/comstack/xmosi.c b/comstack/xmosi.c index adb9d35..bed1dd1 100644 --- a/comstack/xmosi.c +++ b/comstack/xmosi.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: xmosi.c,v $ - * Revision 1.5 1995-09-28 10:24:32 quinn + * Revision 1.6 1995-09-29 17:12:00 quinn + * Smallish + * + * Revision 1.5 1995/09/28 10:24:32 quinn * Windows changes * * Revision 1.4 1995/09/27 15:02:45 quinn @@ -141,7 +144,7 @@ static int addopt(struct netbuf *optbuf, unsigned long level, unsigned long return 0; } -COMSTACK MDF mosi_type(int blocking, int protocol) +COMSTACK mosi_type(int blocking, int protocol) { COMSTACK r; mosi_state *state; @@ -199,7 +202,7 @@ int hex2oct(char *hex, char *oct) * addressing specific to our hack of OSI transport. A sockaddr_in wrapped * up in a t_mosiaddr in a netbuf (on a stick). */ -struct MDF netbuf MDF *mosi_strtoaddr(const char *str) +struct netbuf MDF *mosi_strtoaddr(const char *str) { struct netbuf *ret = malloc(sizeof(struct netbuf)); struct sockaddr_in *add = malloc(sizeof(struct sockaddr_in)); diff --git a/include/backend.h b/include/backend.h index 75f9914..e7ef944 100644 --- a/include/backend.h +++ b/include/backend.h @@ -45,7 +45,7 @@ typedef struct bend_initresult void *handle; /* private handle to the backend module */ } bend_initresult; -bend_initresult MDF MDF *bend_init(bend_initrequest *r); +bend_initresult MDF *bend_init(bend_initrequest *r); typedef struct bend_searchrequest { @@ -63,8 +63,8 @@ typedef struct bend_searchresult char *errstring; /* system error string or NULL */ } bend_searchresult; -bend_searchresult MDF *bend_search(void *handle, bend_searchrequest *r, int *fd); -bend_searchresult MDF *bend_searchresponse(void *handle); +bend_searchresult *bend_search(void *handle, bend_searchrequest *r, int *fd); +bend_searchresult *bend_searchresponse(void *handle); typedef struct bend_fetchrequest { @@ -85,8 +85,8 @@ typedef struct bend_fetchresult char *errstring; /* system error string or NULL */ } bend_fetchresult; -bend_fetchresult MDF *bend_fetch(void *handle, bend_fetchrequest *r, int *fd); -bend_fetchresult MDF *bend_fetchresponse(void *handle); +bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r, int *fd); +bend_fetchresult *bend_fetchresponse(void *handle); typedef struct bend_scanrequest { @@ -115,8 +115,8 @@ typedef struct bend_scanresult char *errstring; } bend_scanresult; -bend_scanresult MDF *bend_scan(void *handle, bend_scanrequest *r, int *fd); -bend_scanresult MDF *bend_scanresponse(void *handle); +bend_scanresult *bend_scan(void *handle, bend_scanrequest *r, int *fd); +bend_scanresult *bend_scanresponse(void *handle); typedef struct bend_deleterequest { @@ -129,9 +129,9 @@ typedef struct bend_deleteresult char *errstring; /* system error string or NULL */ } bend_deleteresult; -bend_deleteresult MDF *bend_delete(void *handle, bend_deleterequest *r, int *fd); -bend_deleteresult MDF *bend_deleteresponse(void *handle); +bend_deleteresult *bend_delete(void *handle, bend_deleterequest *r, int *fd); +bend_deleteresult *bend_deleteresponse(void *handle); -void MDF bend_close(void *handle); +void bend_close(void *handle); #endif diff --git a/include/ccl.h b/include/ccl.h index 4483d90..39fa54c 100644 --- a/include/ccl.h +++ b/include/ccl.h @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: ccl.h,v $ - * Revision 1.2 1995-09-27 15:02:46 quinn + * Revision 1.3 1995-09-29 17:12:01 quinn + * Smallish + * + * Revision 1.2 1995/09/27 15:02:46 quinn * Modified function heads & prototypes. * * Revision 1.1 1995/04/10 10:28:27 quinn @@ -141,21 +144,21 @@ struct ccl_qualifier { struct ccl_qualifier *next; }; -struct ccl_token MDF *ccl_tokenize (const char *command); +struct ccl_token *ccl_tokenize (const char *command); -struct ccl_rpn_node MDF *ccl_find_str (CCL_bibset bibset, +struct ccl_rpn_node *ccl_find_str (CCL_bibset bibset, const char *str, int *error, int *pos); -struct ccl_rpn_node MDF *ccl_find (CCL_bibset abibset, struct ccl_token *list, +struct ccl_rpn_node *ccl_find (CCL_bibset abibset, struct ccl_token *list, int *error, const char **pos); -char MDF *ccl_err_msg (int ccl_errno); -void MDF ccl_rpn_delete (struct ccl_rpn_node *rpn); -void MDF ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out); +char *ccl_err_msg (int ccl_errno); +void ccl_rpn_delete (struct ccl_rpn_node *rpn); +void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out); -void MDF ccl_qual_add (CCL_bibset b, const char *name, int no, int *attr); -void MDF ccl_qual_file (CCL_bibset bibset, FILE *inf); -CCL_bibset MDF ccl_qual_mk (void); -void MDF ccl_qual_rm (CCL_bibset *b); +void ccl_qual_add (CCL_bibset b, const char *name, int no, int *attr); +void ccl_qual_file (CCL_bibset bibset, FILE *inf); +CCL_bibset ccl_qual_mk (void); +void ccl_qual_rm (CCL_bibset *b); extern const char *ccl_token_and; extern const char *ccl_token_or; @@ -163,6 +166,6 @@ extern const char *ccl_token_not; extern const char *ccl_token_set; -struct ccl_rpn_attr MDF *ccl_qual_search (CCL_bibset b, const char *name, int len); +struct ccl_rpn_attr *ccl_qual_search (CCL_bibset b, const char *name, int len); #endif diff --git a/include/comstack.h b/include/comstack.h index b5e5389..e14b8ea 100644 --- a/include/comstack.h +++ b/include/comstack.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: comstack.h,v $ - * Revision 1.10 1995-09-29 17:01:48 quinn + * Revision 1.11 1995-09-29 17:12:01 quinn + * Smallish + * + * Revision 1.10 1995/09/29 17:01:48 quinn * More Windows work * * Revision 1.9 1995/09/28 10:12:36 quinn @@ -161,7 +164,7 @@ struct comstack #define cs_errno(handle) ((handle)->cerrno) #define cs_getproto(handle) ((handle)->protocol) -const char MDF *cs_strerror(COMSTACK h); +const char *cs_strerror(COMSTACK h); const char *cs_errmsg(int n); /* diff --git a/include/diagbib1.h b/include/diagbib1.h index 55eb568..67433b1 100644 --- a/include/diagbib1.h +++ b/include/diagbib1.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: diagbib1.h,v $ - * Revision 1.3 1995-09-27 15:02:47 quinn + * Revision 1.4 1995-09-29 17:12:02 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:47 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:50:30 quinn @@ -40,4 +43,4 @@ #include -const char MDF *diagbib1_str (int code); +const char *diagbib1_str (int code); diff --git a/include/dmalloc.h b/include/dmalloc.h index bf8e5d7..59b1ffb 100644 --- a/include/dmalloc.h +++ b/include/dmalloc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: dmalloc.h,v $ - * Revision 1.3 1995-09-27 15:02:47 quinn + * Revision 1.4 1995-09-29 17:12:02 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:47 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:50:30 quinn @@ -60,9 +63,9 @@ #define free(p) d_free(__FILE__, __LINE__, (p)) #define realloc(p, n) d_realloc(__FILE__, __LINE__, (p), (n)) -void MDF *d_malloc(char *file, int line, int nbytes); -void MDF d_free(char *file, int line, char *ptr); -void MDF *d_realloc(char *file, int line, char *ptr, int nbytes); +void *d_malloc(char *file, int line, int nbytes); +void d_free(char *file, int line, char *ptr); +void *d_realloc(char *file, int line, char *ptr, int nbytes); #endif diff --git a/include/log.h b/include/log.h index 80cc07e..7476f0b 100644 --- a/include/log.h +++ b/include/log.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: log.h,v $ - * Revision 1.4 1995-09-27 15:02:47 quinn + * Revision 1.5 1995-09-29 17:12:03 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:47 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/06/19 12:38:25 quinn @@ -65,9 +68,9 @@ #define LOG_DEFAULT_LEVEL (LOG_FATAL | LOG_ERRNO | LOG_LOG | LOG_WARN) -void MDF log_init(int level, const char *prefix, const char *name); -void MDF logf(int level, const char *fmt, ...); -int MDF log_mask_str (const char *str); -FILE MDF *log_file(void); +void log_init(int level, const char *prefix, const char *name); +void logf(int level, const char *fmt, ...); +int log_mask_str (const char *str); +FILE *log_file(void); #endif diff --git a/include/marcdisp.h b/include/marcdisp.h index 810629a..759403c 100644 --- a/include/marcdisp.h +++ b/include/marcdisp.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: marcdisp.h,v $ - * Revision 1.3 1995-09-27 15:02:47 quinn + * Revision 1.4 1995-09-29 17:12:03 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:47 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:50:32 quinn @@ -36,5 +39,5 @@ */ #include -int MDF marc_display (const char *buf, FILE *outf); +int marc_display (const char *buf, FILE *outf); diff --git a/include/odr.h b/include/odr.h index 55e0f08..2c88189 100644 --- a/include/odr.h +++ b/include/odr.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: odr.h,v $ - * Revision 1.13 1995-09-29 17:01:49 quinn + * Revision 1.14 1995-09-29 17:12:04 quinn + * Smallish + * + * Revision 1.13 1995/09/29 17:01:49 quinn * More Windows work * * Revision 1.12 1995/09/27 15:02:48 quinn @@ -244,7 +247,7 @@ typedef struct odr odr_constack stack[ODR_MAX_STACK]; } *ODR; -typedef int MDF (*Odr_fun)(); +typedef int (*Odr_fun)(); typedef struct odr_arm { @@ -272,17 +275,17 @@ typedef struct odr_arm extern char *odr_errlist[]; -int MDF odr_geterror(ODR o); -void MDF odr_perror(ODR o, char *message); -void MDF odr_setprint(ODR o, FILE *file); -ODR MDF odr_createmem(int direction); -void MDF odr_reset(ODR o); -void MDF odr_destroy(ODR o); -void MDF odr_setbuf(ODR o, char *buf, int len, int can_grow); -char MDF *odr_getbuf(ODR o, int *len, int *size); -void MDF *odr_malloc(ODR o, int size); -ODR_MEM MDF odr_extract_mem(ODR o); -void MDF odr_release_mem(ODR_MEM p); +int odr_geterror(ODR o); +void odr_perror(ODR o, char *message); +void odr_setprint(ODR o, FILE *file); +ODR odr_createmem(int direction); +void odr_reset(ODR o); +void odr_destroy(ODR o); +void odr_setbuf(ODR o, char *buf, int len, int can_grow); +char *odr_getbuf(ODR o, int *len, int *size); +void *odr_malloc(ODR o, int size); +ODR_MEM odr_extract_mem(ODR o); +void odr_release_mem(ODR_MEM p); #define odr_implicit(o, t, p, cl, tg, opt)\ (odr_implicit_settag((o), cl, tg), t ((o), (p), opt) ) diff --git a/include/odr_use.h b/include/odr_use.h index e03d9fb..615f3e1 100644 --- a/include/odr_use.h +++ b/include/odr_use.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: odr_use.h,v $ - * Revision 1.5 1995-09-27 15:02:48 quinn + * Revision 1.6 1995-09-29 17:12:04 quinn + * Smallish + * + * Revision 1.5 1995/09/27 15:02:48 quinn * Modified function heads & prototypes. * * Revision 1.4 1995/08/10 08:54:34 quinn @@ -69,10 +72,10 @@ typedef struct Odr_external } u; } Odr_external; -int MDF odr_external(ODR o, Odr_external **p, int opt); +int odr_external(ODR o, Odr_external **p, int opt); -int MDF odr_visiblestring(ODR o, char **p, int opt); -int MDF odr_graphicstring(ODR o, char **p, int opt); -int MDF odr_generalizedtime(ODR o, char **p, int opt); +int odr_visiblestring(ODR o, char **p, int opt); +int odr_graphicstring(ODR o, char **p, int opt); +int odr_generalizedtime(ODR o, char **p, int opt); #endif diff --git a/include/oid.h b/include/oid.h index 35ec8a1..1d90a46 100644 --- a/include/oid.h +++ b/include/oid.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: oid.h,v $ - * Revision 1.6 1995-09-27 15:02:48 quinn + * Revision 1.7 1995-09-29 17:12:05 quinn + * Smallish + * + * Revision 1.6 1995/09/27 15:02:48 quinn * Modified function heads & prototypes. * * Revision 1.5 1995/09/12 11:31:46 quinn @@ -139,12 +142,12 @@ typedef enum oid_proto oid_proto; typedef enum oid_class oid_class; typedef enum oid_value oid_value; -int MDF *oid_getoidbyent(struct oident *ent); -struct oident MDF *oid_getentbyoid(int *o); -void MDF oid_oidcpy(int *t, int *s); -void MDF oid_oidcat(int *t, int *s); -int MDF oid_oidcmp(int *o1, int *o2); -int MDF oid_oidlen(int *o); -oid_value MDF oid_getvalbyname(char *name); +int *oid_getoidbyent(struct oident *ent); +struct oident *oid_getentbyoid(int *o); +void oid_oidcpy(int *t, int *s); +void oid_oidcat(int *t, int *s); +int oid_oidcmp(int *o1, int *o2); +int oid_oidlen(int *o); +oid_value oid_getvalbyname(char *name); #endif diff --git a/include/options.h b/include/options.h index cb579d0..51bdf8b 100644 --- a/include/options.h +++ b/include/options.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: options.h,v $ - * Revision 1.3 1995-09-27 15:02:48 quinn + * Revision 1.4 1995-09-29 17:12:05 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:48 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:50:36 quinn @@ -48,6 +51,6 @@ #ifndef OPTIONS_H #define OPTIONS_H #include -int MDF options (const char *desc, char **argv, int argc, char **arg); +int options (const char *desc, char **argv, int argc, char **arg); #endif diff --git a/include/pquery.h b/include/pquery.h index e4ea30a..afd415c 100644 --- a/include/pquery.h +++ b/include/pquery.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: pquery.h,v $ - * Revision 1.3 1995-09-27 15:02:49 quinn + * Revision 1.4 1995-09-29 17:12:05 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:49 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/26 08:56:05 adam @@ -41,6 +44,6 @@ #include #include -Z_RPNQuery MDF *p_query_rpn (ODR o, const char *qbuf); -Z_AttributesPlusTerm MDF *p_query_scan (ODR o, const char *qbuf); +Z_RPNQuery *p_query_rpn (ODR o, const char *qbuf); +Z_AttributesPlusTerm *p_query_scan (ODR o, const char *qbuf); #endif diff --git a/include/proto.h b/include/proto.h index cc4a107..1bf3a65 100644 --- a/include/proto.h +++ b/include/proto.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.25 1995-09-27 15:02:49 quinn + * Revision 1.26 1995-09-29 17:12:08 quinn + * Smallish + * + * Revision 1.25 1995/09/27 15:02:49 quinn * Modified function heads & prototypes. * * Revision 1.24 1995/08/29 11:17:43 quinn @@ -311,9 +314,9 @@ typedef struct Z_NSRAuthentication char *account; } Z_NSRAuthentication; -int MDF z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt); +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt); -int MDF z_StrAuthentication(ODR o, char **p, int opt); +int z_StrAuthentication(ODR o, char **p, int opt); /* ------------------ SEARCH SERVICE ----------------*/ @@ -1126,38 +1129,38 @@ typedef struct Z_APDU } u; } Z_APDU; -int MDF z_APDU(ODR o, Z_APDU **p, int opt); -int MDF z_SUTRS(ODR o, Odr_oct **p, int opt); - -Z_InitRequest MDF *zget_InitRequest(ODR o); -Z_InitResponse MDF *zget_InitResponse(ODR o); -Z_SearchRequest MDF *zget_SearchRequest(ODR o); -Z_SearchResponse MDF *zget_SearchResponse(ODR o); -Z_PresentRequest MDF *zget_PresentRequest(ODR o); -Z_PresentResponse MDF *zget_PresentResponse(ODR o); -Z_DeleteResultSetRequest MDF *zget_DeleteResultSetRequest(ODR o); -Z_DeleteResultSetResponse MDF *zget_DeleteResultSetResponse(ODR o); -Z_ScanRequest MDF *zget_ScanRequest(ODR o); -Z_ScanResponse MDF *zget_ScanResponse(ODR o); -Z_TriggerResourceControlRequest MDF *zget_TriggerResourceControlRequest(ODR o); -Z_ResourceControlRequest MDF *zget_ResourceControlRequest(ODR o); -Z_ResourceControlResponse MDF *zget_ResourceControlResponse(ODR o); -Z_Close MDF *zget_Close(ODR o); -int MDF z_InternationalString(ODR o, char **p, int opt); -int MDF z_OtherInformation(ODR o, Z_OtherInformation **p, int opt); -int MDF z_ElementSetName(ODR o, char **p, int opt); -int MDF z_IntUnit(ODR o, Z_IntUnit **p, int opt); -int MDF z_Unit(ODR o, Z_Unit **p, int opt); -int MDF z_DatabaseName(ODR o, Z_DatabaseName **p, int opt); -int MDF z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt); -int MDF z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt); -int MDF z_Term(ODR o, Z_Term **p, int opt); -int MDF z_Specification(ODR o, Z_Specification **p, int opt); -int MDF z_Permissions(ODR o, Z_Permissions **p, int opt); -int MDF z_DiagRec(ODR o, Z_DiagRec **p, int opt); -int MDF z_AttributeList(ODR o, Z_AttributeList **p, int opt); -int MDF z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt); -Z_APDU MDF *zget_APDU(ODR o, enum Z_APDU_which which); +int z_APDU(ODR o, Z_APDU **p, int opt); +int z_SUTRS(ODR o, Odr_oct **p, int opt); + +Z_InitRequest *zget_InitRequest(ODR o); +Z_InitResponse *zget_InitResponse(ODR o); +Z_SearchRequest *zget_SearchRequest(ODR o); +Z_SearchResponse *zget_SearchResponse(ODR o); +Z_PresentRequest *zget_PresentRequest(ODR o); +Z_PresentResponse *zget_PresentResponse(ODR o); +Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o); +Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o); +Z_ScanRequest *zget_ScanRequest(ODR o); +Z_ScanResponse *zget_ScanResponse(ODR o); +Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o); +Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o); +Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o); +Z_Close *zget_Close(ODR o); +int z_InternationalString(ODR o, char **p, int opt); +int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt); +int z_ElementSetName(ODR o, char **p, int opt); +int z_IntUnit(ODR o, Z_IntUnit **p, int opt); +int z_Unit(ODR o, Z_Unit **p, int opt); +int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt); +int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt); +int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt); +int z_Term(ODR o, Z_Term **p, int opt); +int z_Specification(ODR o, Z_Specification **p, int opt); +int z_Permissions(ODR o, Z_Permissions **p, int opt); +int z_DiagRec(ODR o, Z_DiagRec **p, int opt); +int z_AttributeList(ODR o, Z_AttributeList **p, int opt); +int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt); +Z_APDU *zget_APDU(ODR o, enum Z_APDU_which which); #include #include diff --git a/include/prt-acc.h b/include/prt-acc.h index fb8324c..23b1987 100644 --- a/include/prt-acc.h +++ b/include/prt-acc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: prt-acc.h,v $ - * Revision 1.4 1995-09-27 15:02:49 quinn + * Revision 1.5 1995-09-29 17:12:09 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:49 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/08/17 12:45:16 quinn @@ -155,6 +158,6 @@ typedef struct Z_PromptObject1 } u; } Z_PromptObject1; -int MDF z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt); +int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt); #endif diff --git a/include/prt-dia.h b/include/prt-dia.h index 6a6a3f0..5c07fba 100644 --- a/include/prt-dia.h +++ b/include/prt-dia.h @@ -344,6 +344,6 @@ typedef struct Z_DiagnosticFormat Z_DiagnosticUnit **diagnostics; } Z_DiagnosticFormat; -int MDF z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt); +int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt); #endif diff --git a/include/prt-exd.h b/include/prt-exd.h index 34dad37..a25feb2 100644 --- a/include/prt-exd.h +++ b/include/prt-exd.h @@ -50,7 +50,7 @@ typedef struct Z_TaskPackage Z_External *taskSpecificParameters; } Z_TaskPackage; -int MDF z_TaskPackage(ODR o, Z_TaskPackage **p, int opt); +int z_TaskPackage(ODR o, Z_TaskPackage **p, int opt); /* ----------------------- ITEM ORDER ------------------------- */ @@ -147,6 +147,6 @@ typedef struct Z_ItemOrder } u; } Z_ItemOrder; -int MDF z_ItemOrder(ODR o, Z_ItemOrder **p, int opt); +int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt); #endif diff --git a/include/prt-exp.h b/include/prt-exp.h index f84b9c5..8910829 100644 --- a/include/prt-exp.h +++ b/include/prt-exp.h @@ -1015,6 +1015,6 @@ typedef struct Z_ExplainRecord } u; } Z_ExplainRecord; -int MDF z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); +int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); #endif diff --git a/include/prt-ext.h b/include/prt-ext.h index 27b2af5..d55ff5c 100644 --- a/include/prt-ext.h +++ b/include/prt-ext.h @@ -77,6 +77,6 @@ struct Z_External } u; }; -int MDF z_External(ODR o, Z_External **p, int opt); +int z_External(ODR o, Z_External **p, int opt); #endif diff --git a/include/prt-grs.h b/include/prt-grs.h index 75f83dd..c97c7df 100644 --- a/include/prt-grs.h +++ b/include/prt-grs.h @@ -174,6 +174,6 @@ struct Z_GenericRecord Z_TaggedElement **elements; }; -int MDF z_GenericRecord(ODR o, Z_GenericRecord **p, int opt); +int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt); #endif diff --git a/include/prt-rsc.h b/include/prt-rsc.h index e1ec0c8..1fff481 100644 --- a/include/prt-rsc.h +++ b/include/prt-rsc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: prt-rsc.h,v $ - * Revision 1.4 1995-09-27 15:02:52 quinn + * Revision 1.5 1995-09-29 17:12:11 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:52 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/08/17 12:45:17 quinn @@ -77,7 +80,7 @@ typedef struct Z_ResourceReport1 char *message; } Z_ResourceReport1; -int MDF z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt); +int z_ResourceReport1(ODR o, Z_ResourceReport1 **p, int opt); /* -------------------- Resource-2 -------------------- */ @@ -94,6 +97,6 @@ typedef struct Z_ResourceReport2 char *message; /* OPTIONAL */ } Z_ResourceReport2; -int MDF z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt); +int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt); #endif diff --git a/include/prt.h b/include/prt.h index f17a7ee..bf590a8 100644 --- a/include/prt.h +++ b/include/prt.h @@ -3,52 +3,52 @@ #include -int MDF ber_boolean(ODR o, int *val); -int MDF ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt); -int MDF ber_enctag(ODR o, int class, int tag, int constructed); -int MDF ber_dectag(unsigned char *buf, int *class, int *tag, int *constructed); -int MDF odr_bool(ODR o, int **p, int opt); -int MDF odr_integer(ODR o, int **p, int opt); -int MDF odr_implicit_settag(ODR o, int class, int tag); +int ber_boolean(ODR o, int *val); +int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt); +int ber_enctag(ODR o, int class, int tag, int constructed); +int ber_dectag(unsigned char *buf, int *class, int *tag, int *constructed); +int odr_bool(ODR o, int **p, int opt); +int odr_integer(ODR o, int **p, int opt); +int odr_implicit_settag(ODR o, int class, int tag); #if 0 -int MDF odr_implicit(ODR o, int (*type)(ODR o, void *p, int opt), void *p, +int odr_implicit(ODR o, int (*type)(ODR o, void *p, int opt), void *p, int class, int tag, int opt); #endif -int MDF ber_enclen(ODR o, int len, int lenlen, int exact); -int MDF ber_declen(unsigned char *buf, int *len); -char MDF *odr_indent(ODR o); -int MDF ber_null(ODR o); -int MDF odr_null(ODR o, Odr_null **p, int opt); -int MDF ber_integer(ODR o, int *val); -int MDF odr_constructed_begin(ODR o, void *p, int class, int tag); -int MDF odr_constructed_end(ODR o); -int MDF odr_sequence_begin(ODR o, void *p, int size); -int MDF odr_sequence_end(ODR o); -int MDF ber_octetstring(ODR o, Odr_oct *p, int cons); -int MDF odr_octetstring(ODR o, Odr_oct **p, int opt); -int MDF odp_more_chunks(ODR o, unsigned char *base, int len); -int MDF odr_constructed_more(ODR o); -int MDF odr_bitstring(ODR o, Odr_bitmask **p, int opt); -int MDF ber_bitstring(ODR o, Odr_bitmask *p, int cons); -int MDF odr_generalstring(ODR o, char **p, int opt); -int MDF ber_oidc(ODR o, Odr_oid *p); -int MDF odr_oid(ODR o, Odr_oid **p, int opt); -int MDF odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp); -int MDF odr_cstring(ODR o, char **p, int opt); -int MDF odr_sequence_of(ODR o, Odr_fun type, void *p, int *num); -int MDF odr_any(ODR o, Odr_any **p, int opt); -int MDF ber_any(ODR o, Odr_any **p); -int MDF completeBER(unsigned char *buf, int len); -void MDF odr_begin(ODR o); -void MDF odr_end(ODR o); -void MDF odr_release_mem(struct odr_memblock *p); -Odr_oid MDF *odr_oiddup(ODR odr, Odr_oid *o); -int MDF odr_grow_block(odr_ecblock *b, int min_bytes); -int MDF odr_write(ODR o, unsigned char *buf, int bytes); -int MDF odr_seek(ODR o, int whence, int offset); -int MDF odr_dumpBER(FILE *f, char *buf, int len); -void MDF odr_choice_bias(ODR o, int what); -int MDF odr_total(ODR o); +int ber_enclen(ODR o, int len, int lenlen, int exact); +int ber_declen(unsigned char *buf, int *len); +char *odr_indent(ODR o); +int ber_null(ODR o); +int odr_null(ODR o, Odr_null **p, int opt); +int ber_integer(ODR o, int *val); +int odr_constructed_begin(ODR o, void *p, int class, int tag); +int odr_constructed_end(ODR o); +int odr_sequence_begin(ODR o, void *p, int size); +int odr_sequence_end(ODR o); +int ber_octetstring(ODR o, Odr_oct *p, int cons); +int odr_octetstring(ODR o, Odr_oct **p, int opt); +int odp_more_chunks(ODR o, unsigned char *base, int len); +int odr_constructed_more(ODR o); +int odr_bitstring(ODR o, Odr_bitmask **p, int opt); +int ber_bitstring(ODR o, Odr_bitmask *p, int cons); +int odr_generalstring(ODR o, char **p, int opt); +int ber_oidc(ODR o, Odr_oid *p); +int odr_oid(ODR o, Odr_oid **p, int opt); +int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp); +int odr_cstring(ODR o, char **p, int opt); +int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num); +int odr_any(ODR o, Odr_any **p, int opt); +int ber_any(ODR o, Odr_any **p); +int completeBER(unsigned char *buf, int len); +void odr_begin(ODR o); +void odr_end(ODR o); +void odr_release_mem(struct odr_memblock *p); +Odr_oid *odr_oiddup(ODR odr, Odr_oid *o); +int odr_grow_block(odr_ecblock *b, int min_bytes); +int odr_write(ODR o, unsigned char *buf, int bytes); +int odr_seek(ODR o, int whence, int offset); +int odr_dumpBER(FILE *f, char *buf, int len); +void odr_choice_bias(ODR o, int what); +int odr_total(ODR o); char *odr_errmsg(int n); #endif diff --git a/include/statserv.h b/include/statserv.h index 7295280..99c3834 100644 --- a/include/statserv.h +++ b/include/statserv.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: statserv.h,v $ - * Revision 1.6 1995-09-27 15:02:53 quinn + * Revision 1.7 1995-09-29 17:12:12 quinn + * Smallish + * + * Revision 1.6 1995/09/27 15:02:53 quinn * Modified function heads & prototypes. * * Revision 1.5 1995/06/19 12:38:31 quinn @@ -59,8 +62,8 @@ typedef struct statserv_options_block char setuid[ODR_MAXNAME+1]; /* setuid to this user after binding */ } statserv_options_block; -int MDF statserv_main(int argc, char **argv); -statserv_options_block MDF *statserv_getcontrol(void); -void MDF statserv_setcontrol(statserv_options_block *block); +int statserv_main(int argc, char **argv); +statserv_options_block *statserv_getcontrol(void); +void statserv_setcontrol(statserv_options_block *block); #endif diff --git a/include/tcpip.h b/include/tcpip.h index 1eb2f48..1aa4eba 100644 --- a/include/tcpip.h +++ b/include/tcpip.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: tcpip.h,v $ - * Revision 1.4 1995-09-28 10:12:36 quinn + * Revision 1.5 1995-09-29 17:12:13 quinn + * Smallish + * + * Revision 1.4 1995/09/28 10:12:36 quinn * Windows-support changes * * Revision 1.3 1995/09/27 15:02:53 quinn @@ -62,8 +65,8 @@ #include #endif -struct sockaddr_in MDF *tcpip_strtoaddr(const char *str); +struct sockaddr_in *tcpip_strtoaddr(const char *str); -COMSTACK MDF tcpip_type(int blocking, int protocol); +COMSTACK tcpip_type(int blocking, int protocol); #endif diff --git a/include/xmosi.h b/include/xmosi.h index 24cd7c9..0b1a17a 100644 --- a/include/xmosi.h +++ b/include/xmosi.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: xmosi.h,v $ - * Revision 1.3 1995-09-27 15:02:53 quinn + * Revision 1.4 1995-09-29 17:12:13 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:53 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:50:39 quinn @@ -55,8 +58,8 @@ #include #include -struct netbuf MDF *mosi_strtoaddr(const char *str); +struct netbuf *mosi_strtoaddr(const char *str); -COMSTACK MDF mosi_type(int blocking, int protocol); +COMSTACK mosi_type(int blocking, int protocol); #endif diff --git a/include/yaz-ccl.h b/include/yaz-ccl.h index 21cff6c..2868acd 100644 --- a/include/yaz-ccl.h +++ b/include/yaz-ccl.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: yaz-ccl.h,v $ - * Revision 1.4 1995-09-27 15:02:54 quinn + * Revision 1.5 1995-09-29 17:12:14 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:54 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/05/16 08:50:40 quinn @@ -40,7 +43,7 @@ #include #include -Z_RPNQuery MDF *ccl_rpn_query (struct ccl_rpn_node *p); -Z_AttributesPlusTerm MDF *ccl_scan_query (struct ccl_rpn_node *p); +Z_RPNQuery *ccl_rpn_query (struct ccl_rpn_node *p); +Z_AttributesPlusTerm *ccl_scan_query (struct ccl_rpn_node *p); #endif diff --git a/odr/ber_any.c b/odr/ber_any.c index 76f726a..ace1738 100644 --- a/odr/ber_any.c +++ b/odr/ber_any.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_any.c,v $ - * Revision 1.11 1995-09-27 15:02:54 quinn + * Revision 1.12 1995-09-29 17:12:15 quinn + * Smallish + * + * Revision 1.11 1995/09/27 15:02:54 quinn * Modified function heads & prototypes. * * Revision 1.10 1995/05/16 08:50:42 quinn @@ -42,7 +45,7 @@ #include -int MDF ber_any(ODR o, Odr_any **p) +int ber_any(ODR o, Odr_any **p) { int res; @@ -71,7 +74,7 @@ int MDF ber_any(ODR o, Odr_any **p) /* * Return length of BER-package or 0. */ -int MDF completeBER(unsigned char *buf, int len) +int completeBER(unsigned char *buf, int len) { int res, ll, class, tag, cons; unsigned char *b = buf; diff --git a/odr/ber_bit.c b/odr/ber_bit.c index bbb202e..6f9dcdc 100644 --- a/odr/ber_bit.c +++ b/odr/ber_bit.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_bit.c,v $ - * Revision 1.6 1995-09-27 15:02:54 quinn + * Revision 1.7 1995-09-29 17:12:16 quinn + * Smallish + * + * Revision 1.6 1995/09/27 15:02:54 quinn * Modified function heads & prototypes. * * Revision 1.5 1995/05/16 08:50:43 quinn @@ -28,7 +31,7 @@ #include -int MDF ber_bitstring(ODR o, Odr_bitmask *p, int cons) +int ber_bitstring(ODR o, Odr_bitmask *p, int cons) { int res, len; unsigned char *base; diff --git a/odr/ber_bool.c b/odr/ber_bool.c index 0657d5b..646a27f 100644 --- a/odr/ber_bool.c +++ b/odr/ber_bool.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_bool.c,v $ - * Revision 1.7 1995-09-27 15:02:55 quinn + * Revision 1.8 1995-09-29 17:12:16 quinn + * Smallish + * + * Revision 1.7 1995/09/27 15:02:55 quinn * Modified function heads & prototypes. * * Revision 1.6 1995/05/16 08:50:43 quinn @@ -32,7 +35,7 @@ #include -int MDF ber_boolean(ODR o, int *val) +int ber_boolean(ODR o, int *val) { int res, len; diff --git a/odr/ber_int.c b/odr/ber_int.c index 88b647f..49ef264 100644 --- a/odr/ber_int.c +++ b/odr/ber_int.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_int.c,v $ - * Revision 1.10 1995-09-29 17:01:50 quinn + * Revision 1.11 1995-09-29 17:12:16 quinn + * Smallish + * + * Revision 1.10 1995/09/29 17:01:50 quinn * More Windows work * * Revision 1.9 1995/09/28 10:12:39 quinn @@ -51,10 +54,10 @@ #include #include -static int MDF ber_encinteger(ODR o, int val); -static int MDF ber_decinteger(unsigned char *buf, int *val); +static int ber_encinteger(ODR o, int val); +static int ber_decinteger(unsigned char *buf, int *val); -int MDF ber_integer(ODR o, int *val) +int ber_integer(ODR o, int *val) { int res; @@ -81,7 +84,7 @@ int MDF ber_integer(ODR o, int *val) /* * Returns: number of bytes written or -1 for error (out of bounds). */ -int MDF ber_encinteger(ODR o, int val) +int ber_encinteger(ODR o, int val) { int lenpos; int a, len; @@ -111,7 +114,7 @@ int MDF ber_encinteger(ODR o, int val) /* * Returns: Number of bytes read or 0 if no match, -1 if error. */ -int MDF ber_decinteger(unsigned char *buf, int *val) +int ber_decinteger(unsigned char *buf, int *val) { unsigned char *b = buf, fill; int res, len, remains; diff --git a/odr/ber_len.c b/odr/ber_len.c index c770780..d9b43ab 100644 --- a/odr/ber_len.c +++ b/odr/ber_len.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_len.c,v $ - * Revision 1.5 1995-09-27 15:02:55 quinn + * Revision 1.6 1995-09-29 17:12:17 quinn + * Smallish + * + * Revision 1.5 1995/09/27 15:02:55 quinn * Modified function heads & prototypes. * * Revision 1.4 1995/05/16 08:50:45 quinn @@ -24,7 +27,7 @@ * Returns: =0 success, indefinite start-marker set. 1 byte encoded. * Returns: -1 failure, out of bounds. */ -int MDF ber_enclen(ODR o, int len, int lenlen, int exact) +int ber_enclen(ODR o, int len, int lenlen, int exact) { unsigned char octs[sizeof(int)]; int n = 0; @@ -88,7 +91,7 @@ int MDF ber_enclen(ODR o, int len, int lenlen, int exact) * len = -1 indefinite. * len >= 0 Length. */ -int MDF ber_declen(unsigned char *buf, int *len) +int ber_declen(unsigned char *buf, int *len) { unsigned char *b = buf; int n; diff --git a/odr/ber_null.c b/odr/ber_null.c index 095100b..c39e9aa 100644 --- a/odr/ber_null.c +++ b/odr/ber_null.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_null.c,v $ - * Revision 1.7 1995-09-27 15:02:55 quinn + * Revision 1.8 1995-09-29 17:12:18 quinn + * Smallish + * + * Revision 1.7 1995/09/27 15:02:55 quinn * Modified function heads & prototypes. * * Revision 1.6 1995/05/22 11:32:01 quinn @@ -33,7 +36,7 @@ /* * BER-en/decoder for NULL type. */ -int MDF ber_null(ODR o) +int ber_null(ODR o) { switch (o->direction) { diff --git a/odr/ber_oct.c b/odr/ber_oct.c index ee45789..af9d86d 100644 --- a/odr/ber_oct.c +++ b/odr/ber_oct.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_oct.c,v $ - * Revision 1.9 1995-09-27 15:02:55 quinn + * Revision 1.10 1995-09-29 17:12:18 quinn + * Smallish + * + * Revision 1.9 1995/09/27 15:02:55 quinn * Modified function heads & prototypes. * * Revision 1.8 1995/05/16 08:50:47 quinn @@ -36,7 +39,7 @@ #include -int MDF ber_octetstring(ODR o, Odr_oct *p, int cons) +int ber_octetstring(ODR o, Odr_oct *p, int cons) { int res, len; unsigned char *base, *c; diff --git a/odr/ber_oid.c b/odr/ber_oid.c index 58b7637..20435c6 100644 --- a/odr/ber_oid.c +++ b/odr/ber_oid.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_oid.c,v $ - * Revision 1.8 1995-09-27 15:02:56 quinn + * Revision 1.9 1995-09-29 17:12:19 quinn + * Smallish + * + * Revision 1.8 1995/09/27 15:02:56 quinn * Modified function heads & prototypes. * * Revision 1.7 1995/05/16 08:50:47 quinn @@ -33,7 +36,7 @@ #include -int MDF ber_oidc(ODR o, Odr_oid *p) +int ber_oidc(ODR o, Odr_oid *p) { int len, lenp, end; int pos, n, res, id; diff --git a/odr/ber_tag.c b/odr/ber_tag.c index b626f0a..b71acea 100644 --- a/odr/ber_tag.c +++ b/odr/ber_tag.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_tag.c,v $ - * Revision 1.12 1995-09-27 15:02:57 quinn + * Revision 1.13 1995-09-29 17:12:21 quinn + * Smallish + * + * Revision 1.12 1995/09/27 15:02:57 quinn * Modified function heads & prototypes. * * Revision 1.11 1995/05/16 08:50:48 quinn @@ -56,7 +59,7 @@ * * Should perhaps be odr_tag? */ -int MDF ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) +int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) { static int lclass = -1, ltag, br, lcons; /* save t&c rather than decoding twice */ @@ -134,7 +137,7 @@ int MDF ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) * BER-encode a class/tag/constructed package (identifier octets). Return * number of bytes encoded, or -1 if out of bounds. */ -int MDF ber_enctag(ODR o, int class, int tag, int constructed) +int ber_enctag(ODR o, int class, int tag, int constructed) { int cons = (constructed ? 1 : 0), n = 0; unsigned char octs[sizeof(int)], b; @@ -174,7 +177,7 @@ int MDF ber_enctag(ODR o, int class, int tag, int constructed) /* ber_dectag * Decode BER identifier octets. Return number of bytes read or -1 for error. */ -int MDF ber_dectag(unsigned char *buf, int *class, int *tag, int *constructed) +int ber_dectag(unsigned char *buf, int *class, int *tag, int *constructed) { unsigned char *b = buf; diff --git a/odr/dumpber.c b/odr/dumpber.c index 5b97245..7ae685d 100644 --- a/odr/dumpber.c +++ b/odr/dumpber.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dumpber.c,v $ - * Revision 1.3 1995-09-27 15:02:57 quinn + * Revision 1.4 1995-09-29 17:12:21 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:02:57 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/06/27 13:20:51 quinn @@ -111,7 +114,7 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level) return b - buf; } -int MDF odr_dumpBER(FILE *f, char *buf, int len) +int odr_dumpBER(FILE *f, char *buf, int len) { return do_dumpBER(f, buf, len, 0); } diff --git a/odr/odr.c b/odr/odr.c index 307283c..cc94ef8 100644 --- a/odr/odr.c +++ b/odr/odr.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr.c,v $ - * Revision 1.17 1995-09-29 17:01:50 quinn + * Revision 1.18 1995-09-29 17:12:22 quinn + * Smallish + * + * Revision 1.17 1995/09/29 17:01:50 quinn * More Windows work * * Revision 1.16 1995/09/27 15:02:57 quinn @@ -87,22 +90,22 @@ char *odr_errmsg(int n) return odr_errlist[n]; } -void MDF odr_perror(ODR o, char *message) +void odr_perror(ODR o, char *message) { fprintf(stderr, "%s: %s\n", message, odr_errlist[o->error]); } -int MDF odr_geterror(ODR o) +int odr_geterror(ODR o) { return o->error; } -void MDF odr_setprint(ODR o, FILE *file) +void odr_setprint(ODR o, FILE *file) { o->print = file; } -ODR MDF odr_createmem(int direction) +ODR odr_createmem(int direction) { struct odr *r; @@ -120,7 +123,7 @@ ODR MDF odr_createmem(int direction) return r; } -void MDF odr_reset(ODR o) +void odr_reset(ODR o) { o->error = ONONE; o->bp = o->buf; @@ -136,7 +139,7 @@ void MDF odr_reset(ODR o) o->choice_bias = -1; } -void MDF odr_destroy(ODR o) +void odr_destroy(ODR o) { odr_release_mem(o->mem); if (o->ecb.buf && o->ecb.can_grow) @@ -146,7 +149,7 @@ void MDF odr_destroy(ODR o) free(o); } -void MDF odr_setbuf(ODR o, char *buf, int len, int can_grow) +void odr_setbuf(ODR o, char *buf, int len, int can_grow) { o->buf = o->bp = (unsigned char *) buf; o->buflen = o->left = len; @@ -157,7 +160,7 @@ void MDF odr_setbuf(ODR o, char *buf, int len, int can_grow) o->ecb.size = len; } -char MDF *odr_getbuf(ODR o, int *len, int *size) +char *odr_getbuf(ODR o, int *len, int *size) { *len = o->ecb.top; if (size) diff --git a/odr/odr_any.c b/odr/odr_any.c index 81edb96..293c4cc 100644 --- a/odr/odr_any.c +++ b/odr/odr_any.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_any.c,v $ - * Revision 1.5 1995-09-27 15:02:58 quinn + * Revision 1.6 1995-09-29 17:12:22 quinn + * Smallish + * + * Revision 1.5 1995/09/27 15:02:58 quinn * Modified function heads & prototypes. * * Revision 1.4 1995/05/16 08:50:50 quinn @@ -29,7 +32,7 @@ * does not work, and neither does the optional flag, unless the element * is the last in a sequence. */ -int MDF odr_any(ODR o, Odr_any **p, int opt) +int odr_any(ODR o, Odr_any **p, int opt) { if (o->error) return 0; diff --git a/odr/odr_bit.c b/odr/odr_bit.c index 5deb9cd..1407116 100644 --- a/odr/odr_bit.c +++ b/odr/odr_bit.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_bit.c,v $ - * Revision 1.9 1995-09-27 15:02:58 quinn + * Revision 1.10 1995-09-29 17:12:22 quinn + * Smallish + * + * Revision 1.9 1995/09/27 15:02:58 quinn * Modified function heads & prototypes. * * Revision 1.8 1995/05/16 08:50:51 quinn @@ -41,7 +44,7 @@ * Top level bitstring string en/decoder. * Returns 1 on success, 0 on error. */ -int MDF odr_bitstring(ODR o, Odr_bitmask **p, int opt) +int odr_bitstring(ODR o, Odr_bitmask **p, int opt) { int res, cons = 0; diff --git a/odr/odr_bool.c b/odr/odr_bool.c index b5ea387..2fcb888 100644 --- a/odr/odr_bool.c +++ b/odr/odr_bool.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_bool.c,v $ - * Revision 1.7 1995-09-27 15:02:58 quinn + * Revision 1.8 1995-09-29 17:12:23 quinn + * Smallish + * + * Revision 1.7 1995/09/27 15:02:58 quinn * Modified function heads & prototypes. * * Revision 1.6 1995/05/16 08:50:52 quinn @@ -34,7 +37,7 @@ * Top level boolean en/decoder. * Returns 1 on success, 0 on error. */ -int MDF odr_bool(ODR o, int **p, int opt) +int odr_bool(ODR o, int **p, int opt) { int res, cons = 0; diff --git a/odr/odr_choice.c b/odr/odr_choice.c index 945e4fe..59beae4 100644 --- a/odr/odr_choice.c +++ b/odr/odr_choice.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_choice.c,v $ - * Revision 1.10 1995-09-27 15:02:58 quinn + * Revision 1.11 1995-09-29 17:12:23 quinn + * Smallish + * + * Revision 1.10 1995/09/27 15:02:58 quinn * Modified function heads & prototypes. * * Revision 1.9 1995/08/15 12:00:23 quinn @@ -38,7 +41,7 @@ #include -int MDF odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) +int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) { int i, cl = -1, tg, cn, *which = whichp, bias = o->choice_bias; @@ -97,7 +100,7 @@ int MDF odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) return 0; } -void MDF odr_choice_bias(ODR o, int what) +void odr_choice_bias(ODR o, int what) { o->choice_bias = what; } diff --git a/odr/odr_cons.c b/odr/odr_cons.c index 4e54334..1ae66c1 100644 --- a/odr/odr_cons.c +++ b/odr/odr_cons.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_cons.c,v $ - * Revision 1.14 1995-09-27 15:02:58 quinn + * Revision 1.15 1995-09-29 17:12:23 quinn + * Smallish + * + * Revision 1.14 1995/09/27 15:02:58 quinn * Modified function heads & prototypes. * * Revision 1.13 1995/08/15 11:16:39 quinn @@ -54,7 +57,7 @@ #include #include -int MDF odr_constructed_begin(ODR o, void *p, int class, int tag) +int odr_constructed_begin(ODR o, void *p, int class, int tag) { int res; int cons = 1; @@ -110,7 +113,7 @@ int MDF odr_constructed_begin(ODR o, void *p, int class, int tag) return 1; } -int MDF odr_constructed_more(ODR o) +int odr_constructed_more(ODR o) { if (o->error) return 0; @@ -122,7 +125,7 @@ int MDF odr_constructed_more(ODR o) return (!(*o->bp == 0 && *(o->bp + 1) == 0)); } -int MDF odr_constructed_end(ODR o) +int odr_constructed_end(ODR o) { int res; int pos; diff --git a/odr/odr_int.c b/odr/odr_int.c index 2f9308c..cad4add 100644 --- a/odr/odr_int.c +++ b/odr/odr_int.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_int.c,v $ - * Revision 1.9 1995-09-29 17:01:50 quinn + * Revision 1.10 1995-09-29 17:12:24 quinn + * Smallish + * + * Revision 1.9 1995/09/29 17:01:50 quinn * More Windows work * * Revision 1.8 1995/09/27 15:02:59 quinn @@ -40,7 +43,7 @@ * Top level integer en/decoder. * Returns 1 on success, 0 on error. */ -int MDF odr_integer(ODR o, int **p, int opt) +int odr_integer(ODR o, int **p, int opt) { int res, cons = 0; diff --git a/odr/odr_mem.c b/odr/odr_mem.c index 4437058..e342625 100644 --- a/odr/odr_mem.c +++ b/odr/odr_mem.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_mem.c,v $ - * Revision 1.7 1995-09-27 15:02:59 quinn + * Revision 1.8 1995-09-29 17:12:24 quinn + * Smallish + * + * Revision 1.7 1995/09/27 15:02:59 quinn * Modified function heads & prototypes. * * Revision 1.6 1995/08/21 09:10:41 quinn @@ -88,7 +91,7 @@ static odr_memblock *get_block(int size) /* * Return p to the global freelist. */ -void MDF odr_release_mem(ODR_MEM p) +void odr_release_mem(ODR_MEM p) { odr_memblock *t; @@ -103,7 +106,7 @@ void MDF odr_release_mem(ODR_MEM p) /* * Extract the memory control block from o. */ -ODR_MEM MDF odr_extract_mem(ODR o) +ODR_MEM odr_extract_mem(ODR o) { ODR_MEM r = o->mem; @@ -111,7 +114,7 @@ ODR_MEM MDF odr_extract_mem(ODR o) return r; } -void MDF *odr_malloc(ODR o, int size) +void *odr_malloc(ODR o, int size) { struct odr_memblock *p = o->mem; char *r; @@ -133,7 +136,7 @@ void MDF *odr_malloc(ODR o, int size) return r; } -int MDF odr_total(ODR o) +int odr_total(ODR o) { return o->mem ? o->mem->total : 0; } @@ -141,7 +144,7 @@ int MDF odr_total(ODR o) /* ---------- memory management for data encoding ----------*/ -int MDF odr_grow_block(odr_ecblock *b, int min_bytes) +int odr_grow_block(odr_ecblock *b, int min_bytes) { int togrow; @@ -163,7 +166,7 @@ int MDF odr_grow_block(odr_ecblock *b, int min_bytes) return 0; } -int MDF odr_write(ODR o, unsigned char *buf, int bytes) +int odr_write(ODR o, unsigned char *buf, int bytes) { if (o->ecb.pos + bytes >= o->ecb.size && odr_grow_block(&o->ecb, bytes)) { @@ -177,7 +180,7 @@ int MDF odr_write(ODR o, unsigned char *buf, int bytes) return 0; } -int MDF odr_seek(ODR o, int whence, int offset) +int odr_seek(ODR o, int whence, int offset) { if (whence == ODR_S_CUR) offset += o->ecb.pos; diff --git a/odr/odr_null.c b/odr/odr_null.c index ac26999..ac772b2 100644 --- a/odr/odr_null.c +++ b/odr/odr_null.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_null.c,v $ - * Revision 1.7 1995-09-27 15:02:59 quinn + * Revision 1.8 1995-09-29 17:12:24 quinn + * Smallish + * + * Revision 1.7 1995/09/27 15:02:59 quinn * Modified function heads & prototypes. * * Revision 1.6 1995/05/22 11:32:03 quinn @@ -33,7 +36,7 @@ * Top level null en/decoder. * Returns 1 on success, 0 on error. */ -int MDF odr_null(ODR o, Odr_null **p, int opt) +int odr_null(ODR o, Odr_null **p, int opt) { int res, cons = 0; diff --git a/odr/odr_oct.c b/odr/odr_oct.c index d5d2dab..b289738 100644 --- a/odr/odr_oct.c +++ b/odr/odr_oct.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_oct.c,v $ - * Revision 1.10 1995-09-27 15:02:59 quinn + * Revision 1.11 1995-09-29 17:12:25 quinn + * Smallish + * + * Revision 1.10 1995/09/27 15:02:59 quinn * Modified function heads & prototypes. * * Revision 1.9 1995/05/16 08:50:56 quinn @@ -42,7 +45,7 @@ * Top level octet string en/decoder. * Returns 1 on success, 0 on error. */ -int MDF odr_octetstring(ODR o, Odr_oct **p, int opt) +int odr_octetstring(ODR o, Odr_oct **p, int opt) { int res, cons = 0; @@ -78,7 +81,7 @@ int MDF odr_octetstring(ODR o, Odr_oct **p, int opt) /* * Friendlier interface to octetstring. */ -int MDF odr_cstring(ODR o, char **p, int opt) +int odr_cstring(ODR o, char **p, int opt) { int cons = 0, res; Odr_oct *t; diff --git a/odr/odr_oid.c b/odr/odr_oid.c index 2072903..94025f6 100644 --- a/odr/odr_oid.c +++ b/odr/odr_oid.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_oid.c,v $ - * Revision 1.11 1995-09-27 15:03:00 quinn + * Revision 1.12 1995-09-29 17:12:25 quinn + * Smallish + * + * Revision 1.11 1995/09/27 15:03:00 quinn * Modified function heads & prototypes. * * Revision 1.10 1995/05/29 08:11:44 quinn @@ -47,7 +50,7 @@ * Top level oid en/decoder. * Returns 1 on success, 0 on error. */ -int MDF odr_oid(ODR o, Odr_oid **p, int opt) +int odr_oid(ODR o, Odr_oid **p, int opt) { int res, cons = 0; diff --git a/odr/odr_seq.c b/odr/odr_seq.c index 8ab4e03..66377f8 100644 --- a/odr/odr_seq.c +++ b/odr/odr_seq.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_seq.c,v $ - * Revision 1.15 1995-09-27 15:03:00 quinn + * Revision 1.16 1995-09-29 17:12:26 quinn + * Smallish + * + * Revision 1.15 1995/09/27 15:03:00 quinn * Modified function heads & prototypes. * * Revision 1.14 1995/08/15 11:16:39 quinn @@ -56,7 +59,7 @@ #include #include -int MDF odr_sequence_begin(ODR o, void *p, int size) +int odr_sequence_begin(ODR o, void *p, int size) { char **pp = (char**) p; @@ -79,7 +82,7 @@ int MDF odr_sequence_begin(ODR o, void *p, int size) return 0; } -int MDF odr_sequence_end(ODR o) +int odr_sequence_end(ODR o) { return odr_constructed_end(o); } @@ -89,7 +92,7 @@ int odr_sequence_more(ODR o) return odr_constructed_more(o); } -int MDF odr_sequence_of(ODR o, Odr_fun type, void *p, int *num) +int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num) { char ***pp = (char***) p; /* for dereferencing */ char **tmp = 0; diff --git a/odr/odr_tag.c b/odr/odr_tag.c index ccbd780..9e3ee32 100644 --- a/odr/odr_tag.c +++ b/odr/odr_tag.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_tag.c,v $ - * Revision 1.4 1995-09-27 15:03:00 quinn + * Revision 1.5 1995-09-29 17:12:27 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:03:00 quinn * Modified function heads & prototypes. * * Revision 1.3 1995/05/16 08:51:00 quinn @@ -20,7 +23,7 @@ #include -int MDF odr_implicit_settag(ODR o, int class, int tag) +int odr_implicit_settag(ODR o, int class, int tag) { if (o->error) return 0; diff --git a/odr/odr_use.c b/odr/odr_use.c index bf6a55a..25a178d 100644 --- a/odr/odr_use.c +++ b/odr/odr_use.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_use.c,v $ - * Revision 1.6 1995-09-27 15:03:00 quinn + * Revision 1.7 1995-09-29 17:12:27 quinn + * Smallish + * + * Revision 1.6 1995/09/27 15:03:00 quinn * Modified function heads & prototypes. * * Revision 1.5 1995/08/10 08:54:47 quinn @@ -27,7 +30,7 @@ #include #include -int MDF odr_external(ODR o, Odr_external **p, int opt) +int odr_external(ODR o, Odr_external **p, int opt) { Odr_external *pp; static Odr_arm arm[] = @@ -50,7 +53,7 @@ int MDF odr_external(ODR o, Odr_external **p, int opt) odr_sequence_end(o); } -int MDF odr_visiblestring(ODR o, char **p, int opt) +int odr_visiblestring(ODR o, char **p, int opt) { return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_VISIBLESTRING, opt); @@ -60,19 +63,19 @@ int MDF odr_visiblestring(ODR o, char **p, int opt) * a char may not be sufficient to hold a general string, but we'll deal * with that once we start looking more closely at UniCode & co. */ -int MDF odr_generalstring(ODR o, char **p, int opt) +int odr_generalstring(ODR o, char **p, int opt) { return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GENERALSTRING, opt); } -int MDF odr_graphicstring(ODR o, char **p, int opt) +int odr_graphicstring(ODR o, char **p, int opt) { return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GRAPHICSTRING, opt); } -int MDF odr_generalizedtime(ODR o, char **p, int opt) +int odr_generalizedtime(ODR o, char **p, int opt) { return odr_implicit(o, odr_cstring, p, ODR_UNIVERSAL, ODR_GENERALIZEDTIME, opt); diff --git a/odr/odr_util.c b/odr/odr_util.c index a25d1ad..7a07775 100644 --- a/odr/odr_util.c +++ b/odr/odr_util.c @@ -2,7 +2,7 @@ #include #include -char MDF *odr_indent(ODR o) +char *odr_indent(ODR o) { static char buf[512]; int i = o->indent; @@ -14,7 +14,7 @@ char MDF *odr_indent(ODR o) return buf; } -int MDF odp_more_chunks(ODR o, unsigned char *base, int len) +int odp_more_chunks(ODR o, unsigned char *base, int len) { if (!len) return 0; @@ -33,7 +33,7 @@ int MDF odp_more_chunks(ODR o, unsigned char *base, int len) return o->bp - base < len; } -Odr_oid MDF *odr_oiddup(ODR odr, Odr_oid *o) +Odr_oid *odr_oiddup(ODR odr, Odr_oid *o) { Odr_oid *r; diff --git a/server/statserv.c b/server/statserv.c index aa68bc1..a692eb2 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: statserv.c,v $ - * Revision 1.27 1995-09-27 15:03:02 quinn + * Revision 1.28 1995-09-29 17:12:30 quinn + * Smallish + * + * Revision 1.27 1995/09/27 15:03:02 quinn * Modified function heads & prototypes. * * Revision 1.26 1995/08/29 14:44:51 quinn @@ -334,7 +337,7 @@ static void catchchld(int num) signal(SIGCHLD, catchchld); } -statserv_options_block MDF *statserv_getcontrol(void) +statserv_options_block *statserv_getcontrol(void) { static statserv_options_block cb; @@ -342,12 +345,12 @@ statserv_options_block MDF *statserv_getcontrol(void) return &cb; } -void MDF statserv_setcontrol(statserv_options_block *block) +void statserv_setcontrol(statserv_options_block *block) { memcpy(&control_block, block, sizeof(*block)); } -int MDF statserv_main(int argc, char **argv) +int statserv_main(int argc, char **argv) { int ret, listeners = 0; char *arg; diff --git a/util/dmalloc.c b/util/dmalloc.c index 7bfc0e0..78603c8 100644 --- a/util/dmalloc.c +++ b/util/dmalloc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dmalloc.c,v $ - * Revision 1.7 1995-09-29 17:01:50 quinn + * Revision 1.8 1995-09-29 17:12:33 quinn + * Smallish + * + * Revision 1.7 1995/09/29 17:01:50 quinn * More Windows work * * Revision 1.6 1995/09/27 15:03:02 quinn @@ -38,7 +41,7 @@ static const unsigned char head[] = {44, 33, 22, 11}; static const unsigned char tail[] = {11, 22, 33, 44}; static const unsigned char freed[] = {99, 99, 99, 99}; -void MDF *d_malloc(char *file, int line, int nbytes) +void *d_malloc(char *file, int line, int nbytes) { char *res; int long len; @@ -55,7 +58,7 @@ void MDF *d_malloc(char *file, int line, int nbytes) return res; } -void MDF d_free(char *file, int line, char *ptr) +void d_free(char *file, int line, char *ptr) { long len; @@ -71,7 +74,7 @@ void MDF d_free(char *file, int line, char *ptr) return; } -void MDF *d_realloc(char *file, int line, char *ptr, int nbytes) +void *d_realloc(char *file, int line, char *ptr, int nbytes) { long len, nlen = nbytes; char *p = ptr; diff --git a/util/log.c b/util/log.c index 76eaf1b..134d7fd 100644 --- a/util/log.c +++ b/util/log.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: log.c,v $ - * Revision 1.8 1995-09-27 15:03:02 quinn + * Revision 1.9 1995-09-29 17:12:34 quinn + * Smallish + * + * Revision 1.8 1995/09/27 15:03:02 quinn * Modified function heads & prototypes. * * Revision 1.7 1995/06/19 12:40:18 quinn @@ -95,12 +98,12 @@ char *strerror(int n) #endif -FILE MDF *log_file(void) +FILE *log_file(void) { return l_file; } -void MDF log_init(int level, const char *prefix, const char *name) +void log_init(int level, const char *prefix, const char *name) { l_level = level; if (prefix && *prefix) @@ -112,7 +115,7 @@ void MDF log_init(int level, const char *prefix, const char *name) setvbuf(l_file, 0, _IONBF, 0); } -void MDF logf(int level, const char *fmt, ...) +void logf(int level, const char *fmt, ...) { va_list ap; char buf[4096], flags[1024]; @@ -144,7 +147,7 @@ void MDF logf(int level, const char *fmt, ...) fflush(l_file); } -int MDF log_mask_str (const char *str) +int log_mask_str (const char *str) { const char *p; int i, level = LOG_DEFAULT_LEVEL; diff --git a/util/marcdisp.c b/util/marcdisp.c index 88f400e..9a33ebf 100644 --- a/util/marcdisp.c +++ b/util/marcdisp.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: marcdisp.c,v $ - * Revision 1.3 1995-09-27 15:03:03 quinn + * Revision 1.4 1995-09-29 17:12:34 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:03:03 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:51:12 quinn @@ -37,7 +40,7 @@ int atoi_n (const char *buf, int len) return val; } -int MDF marc_display (const char *buf, FILE *outf) +int marc_display (const char *buf, FILE *outf) { int entry_p; int record_length; diff --git a/util/oid.c b/util/oid.c index a65d028..84d4061 100644 --- a/util/oid.c +++ b/util/oid.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: oid.c,v $ - * Revision 1.5 1995-09-29 17:01:51 quinn + * Revision 1.6 1995-09-29 17:12:35 quinn + * Smallish + * + * Revision 1.5 1995/09/29 17:01:51 quinn * More Windows work * * Revision 1.4 1995/09/27 15:03:03 quinn @@ -164,19 +167,19 @@ static oident oids[] = /* OID utilities */ -void MDF oid_oidcpy(int *t, int *s) +void oid_oidcpy(int *t, int *s) { while ((*(t++) = *(s++)) > -1); } -void MDF oid_oidcat(int *t, int *s) +void oid_oidcat(int *t, int *s) { while (*t > -1) t++; while ((*(t++) = *(s++)) > -1); } -int MDF oid_oidcmp(int *o1, int *o2) +int oid_oidcmp(int *o1, int *o2) { while (*o1 == *o2 && *o1 > -1) { @@ -191,7 +194,7 @@ int MDF oid_oidcmp(int *o1, int *o2) return -1; } -int MDF oid_oidlen(int *o) +int oid_oidlen(int *o) { int len = 0; @@ -211,7 +214,7 @@ static int match_prefix(int *look, int *prefix) return 0; } -struct oident MDF *oid_getentbyoid(int *o) +struct oident *oid_getentbyoid(int *o) { enum oid_proto proto; int prelen; @@ -235,7 +238,7 @@ struct oident MDF *oid_getentbyoid(int *o) /* * To query, fill out proto, class, and value of the ent parameter. */ -int MDF *oid_getoidbyent(struct oident *ent) +int *oid_getoidbyent(struct oident *ent) { struct oident *p; static int ret[OID_SIZE]; @@ -257,7 +260,7 @@ int MDF *oid_getoidbyent(struct oident *ent) return 0; } -oid_value MDF oid_getvalbyname(char *name) +oid_value oid_getvalbyname(char *name) { struct oident *p; diff --git a/util/options.c b/util/options.c index 6246b23..3dc74a6 100644 --- a/util/options.c +++ b/util/options.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: options.c,v $ - * Revision 1.3 1995-09-27 15:03:03 quinn + * Revision 1.4 1995-09-29 17:12:35 quinn + * Smallish + * + * Revision 1.3 1995/09/27 15:03:03 quinn * Modified function heads & prototypes. * * Revision 1.2 1995/05/16 08:51:13 quinn @@ -28,7 +31,7 @@ static int arg_no = 1; static int arg_off = 0; -int MDF options (const char *desc, char **argv, int argc, char **arg) +int options (const char *desc, char **argv, int argc, char **arg) { int ch, i = 0; diff --git a/util/pquery.c b/util/pquery.c index f842788..5dd6516 100644 --- a/util/pquery.c +++ b/util/pquery.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: pquery.c,v $ - * Revision 1.6 1995-09-27 15:03:03 quinn + * Revision 1.7 1995-09-29 17:12:36 quinn + * Smallish + * + * Revision 1.6 1995/09/27 15:03:03 quinn * Modified function heads & prototypes. * * Revision 1.5 1995/06/15 12:31:02 quinn @@ -248,7 +251,7 @@ static Z_RPNStructure *rpn_structure (ODR o, int num_attr, int max_attr, return sz; } -Z_RPNQuery MDF *p_query_rpn (ODR o, const char *qbuf) +Z_RPNQuery *p_query_rpn (ODR o, const char *qbuf) { Z_RPNQuery *zq; int attr_array[1024]; @@ -262,7 +265,7 @@ Z_RPNQuery MDF *p_query_rpn (ODR o, const char *qbuf) return zq; } -Z_AttributesPlusTerm MDF *p_query_scan (ODR o, const char *qbuf) +Z_AttributesPlusTerm *p_query_scan (ODR o, const char *qbuf) { int attr_list[1024]; int num_attr = 0; diff --git a/util/yaz-ccl.c b/util/yaz-ccl.c index 095bf4b..a801874 100644 --- a/util/yaz-ccl.c +++ b/util/yaz-ccl.c @@ -141,7 +141,7 @@ static Z_RPNStructure *ccl_rpn_structure (struct ccl_rpn_node *p) return zs; } -Z_RPNQuery MDF *ccl_rpn_query (struct ccl_rpn_node *p) +Z_RPNQuery *ccl_rpn_query (struct ccl_rpn_node *p) { Z_RPNQuery *zq; @@ -152,7 +152,7 @@ Z_RPNQuery MDF *ccl_rpn_query (struct ccl_rpn_node *p) return zq; } -Z_AttributesPlusTerm MDF *ccl_scan_query (struct ccl_rpn_node *p) +Z_AttributesPlusTerm *ccl_scan_query (struct ccl_rpn_node *p) { if (p->kind != CCL_RPN_TERM) return NULL; -- 1.7.10.4