|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 12822 (0x3216) Types: TextFile Names: »massoc.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z« └─⟦d846658bd⟧ └─⟦this⟧ »osimis/msap/massoc.c«
/* automatically generated by pepy 6.0 #10 (ron.cs.ucl.ac.uk), do not edit! */ #include <isode/psap.h> static char *pepyid = "pepy 6.0 #10 (ron.cs.ucl.ac.uk) of Tue May 22 10:37:59 BST 1990"; void advise (); /* Generated from module CMIPAssoc, Object Identifier 2.9.1.1.1 */ #include <stdio.h> #include <isode/rosap.h> #include "msap.h" #ifndef PEPYPARM #define PEPYPARM char * #endif /* PEPYPARM */ extern PEPYPARM NullParm; /* ARGSUSED */ int build_CMIPAssoc_CMIPUserInfo (pe, explicit, len, buffer, parm) register PE *pe; int explicit; integer len; char *buffer; struct MSAPassocinfo * parm; { PE p0_z = NULLPE; register PE *p0 = &p0_z; if (((*pe) = pe_alloc (PE_CLASS_UNIV, PE_FORM_CONS, PE_CONS_SEQ)) == NULLPE) { advise (NULLCP, "CMIPUserInfo: %s", PEPY_ERR_NOMEM); return NOTOK; } (*p0) = NULLPE; if ( parm -> mai_protvrsn ) { /* protocolVersion */ if (build_CMIPAssoc_ProtocolVersion (p0, 0, NULLINT, NULLCP, &parm -> mai_protvrsn) == NOTOK) return NOTOK; (*p0) -> pe_class = PE_CLASS_CONT; (*p0) -> pe_id = 0; #ifdef DEBUG (void) testdebug ((*p0), "protocolVersion"); #endif } if ((*p0) != NULLPE) if (seq_add ((*pe), (*p0), -1) == NOTOK) { advise (NULLCP, "CMIPUserInfo %s%s", PEPY_ERR_BAD_SEQ, pe_error ((*pe) -> pe_errno)); return NOTOK; } (*p0) = NULLPE; if ( parm -> mai_funits ) { /* functionalUnits */ if (build_CMIPAssoc_FunctionalUnits (p0, 0, NULLINT, NULLCP, &parm -> mai_funits) == NOTOK) return NOTOK; (*p0) -> pe_class = PE_CLASS_CONT; (*p0) -> pe_id = 1; #ifdef DEBUG (void) testdebug ((*p0), "functionalUnits"); #endif } if ((*p0) != NULLPE) if (seq_add ((*pe), (*p0), -1) == NOTOK) { advise (NULLCP, "CMIPUserInfo %s%s", PEPY_ERR_BAD_SEQ, pe_error ((*pe) -> pe_errno)); return NOTOK; } (*p0) = NULLPE; if ( parm -> mai_access ) { /* accessControl */ if (encode_UNIV_EXTERNAL (p0, 0, NULLINT, NULLCP, parm -> mai_access) == NOTOK) return NOTOK; { /* accessControl TAG PUSHDOWN */ PE p1_z; register PE *p1 = &p1_z; if ((*p1 = pe_alloc (PE_CLASS_CONT, PE_FORM_CONS, 2)) == NULLPE) { advise (NULLCP, "accessControl: %s", PEPY_ERR_NOMEM); return NOTOK; } (*p1) -> pe_cons = (*p0); (*p0) = *p1; } #ifdef DEBUG (void) testdebug ((*p0), "accessControl"); #endif } if ((*p0) != NULLPE) if (seq_add ((*pe), (*p0), -1) == NOTOK) { advise (NULLCP, "CMIPUserInfo %s%s", PEPY_ERR_BAD_SEQ, pe_error ((*pe) -> pe_errno)); return NOTOK; } (*p0) = NULLPE; if ( parm -> mai_info ) { /* userInfo */ if (encode_UNIV_EXTERNAL (p0, 0, NULLINT, NULLCP, parm -> mai_info) == NOTOK) return NOTOK; { /* userInfo TAG PUSHDOWN */ PE p2_z; register PE *p2 = &p2_z; if ((*p2 = pe_alloc (PE_CLASS_CONT, PE_FORM_CONS, 3)) == NULLPE) { advise (NULLCP, "userInfo: %s", PEPY_ERR_NOMEM); return NOTOK; } (*p2) -> pe_cons = (*p0); (*p0) = *p2; } #ifdef DEBUG (void) testdebug ((*p0), "userInfo"); #endif } if ((*p0) != NULLPE) if (seq_add ((*pe), (*p0), -1) == NOTOK) { advise (NULLCP, "CMIPUserInfo %s%s", PEPY_ERR_BAD_SEQ, pe_error ((*pe) -> pe_errno)); return NOTOK; } #ifdef DEBUG (void) testdebug ((*pe), "CMIPAssoc.CMIPUserInfo"); #endif return OK; } /* ARGSUSED */ int build_CMIPAssoc_ProtocolVersion (pe, explicit, len, buffer, parm) register PE *pe; int explicit; integer len; char *buffer; int * parm; { char * cp = int2strb(*parm, 1); PE p3_z = NULLPE; register PE *p3 = &p3_z; char *p5; int p4; p5 = cp ; p4 = 1; (*p3) = p5 ? strb2bitstr (p5, p4, PE_CLASS_UNIV, PE_PRIM_BITS) : NULLPE; if ((*p3) == NULLPE) { advise (NULLCP, "ProtocolVersion %s", PEPY_ERR_INIT_FAILED); return NOTOK; } if (bit_test ((*p3), 0) == NOTOK) (void) bit_off ((*p3), 0); if (((*pe) = bit2prim ((*p3))) == NULLPE) { advise (NULLCP, "ProtocolVersion: %s", PEPY_ERR_NOMEM); return NOTOK; } #define BITS "\020\01version1" #ifdef DEBUG (void) testdebug ((*pe), "CMIPAssoc.ProtocolVersion"); #endif #undef BITS return OK; } /* ARGSUSED */ int build_CMIPAssoc_FunctionalUnits (pe, explicit, len, buffer, parm) register PE *pe; int explicit; integer len; char *buffer; int * parm; { char * cp = int2strb(*parm, 5); PE p6_z = NULLPE; register PE *p6 = &p6_z; char *p8; int p7; p8 = cp ; p7 = 5; (*p6) = p8 ? strb2bitstr (p8, p7, PE_CLASS_UNIV, PE_PRIM_BITS) : NULLPE; if ((*p6) == NULLPE) { advise (NULLCP, "FunctionalUnits %s", PEPY_ERR_INIT_FAILED); return NOTOK; } if (bit_test ((*p6), 4) == NOTOK) (void) bit_off ((*p6), 4); if (((*pe) = bit2prim ((*p6))) == NULLPE) { advise (NULLCP, "FunctionalUnits: %s", PEPY_ERR_NOMEM); return NOTOK; } #define BITS "\020\01multipleObjectSelection\02filter\03multipleReply\04extendedService\05confirmedCancelGet" #ifdef DEBUG (void) testdebug ((*pe), "CMIPAssoc.FunctionalUnits"); #endif #undef BITS return OK; } /* ARGSUSED */ int parse_CMIPAssoc_CMIPUserInfo (pe, explicit, len, buffer, parm) register PE pe; int explicit; integer *len; char **buffer; struct MSAPassocinfo * parm; { register PE p9; #ifdef DEBUG (void) testdebug (pe, "CMIPAssoc.CMIPUserInfo"); #endif if (explicit) { if (pe -> pe_class != PE_CLASS_UNIV || pe -> pe_form != PE_FORM_CONS || pe -> pe_id != PE_CONS_SEQ) { advise (NULLCP, "CMIPUserInfo bad class/form/id: %s/%d/0x%x", pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id); return NOTOK; } } else if (pe -> pe_form != PE_FORM_CONS) { advise (NULLCP, "CMIPUserInfo bad form: %d", pe -> pe_form); return NOTOK; } if ((p9 = prim2seq (pe)) == NULLPE) { advise (NULLCP, "CMIPUserInfo %s%s", PEPY_ERR_BAD_SEQ, pe_error (pe -> pe_errno)); return NOTOK; } pe = p9; { register PE p10; if ((p10 = first_member (pe)) != NULLPE && PE_ID (p10 -> pe_class, p10 -> pe_id) != PE_ID (PE_CLASS_CONT, 0)) p10 = NULLPE; if (p10 != NULLPE) { p9 = p10; { /* protocolVersion */ #ifdef DEBUG (void) testdebug (p10, "protocolVersion"); #endif if (parse_CMIPAssoc_ProtocolVersion (p10, 0, NULLINTP, NULLVP, &parm -> mai_protvrsn) == NOTOK) return NOTOK; } } else { /* set default here using yp -> yp_default */ } } { register PE p11; if ((p11 = (pe != p9 ? next_member (pe, p9) : first_member (pe))) != NULLPE && PE_ID (p11 -> pe_class, p11 -> pe_id) != PE_ID (PE_CLASS_CONT, 1)) p11 = NULLPE; if (p11 != NULLPE) { p9 = p11; { /* functionalUnits */ #ifdef DEBUG (void) testdebug (p11, "functionalUnits"); #endif if (parse_CMIPAssoc_FunctionalUnits (p11, 0, NULLINTP, NULLVP, &parm -> mai_funits) == NOTOK) return NOTOK; } } else { /* set default here using yp -> yp_default */ } } { register PE p12; if ((p12 = (pe != p9 ? next_member (pe, p9) : first_member (pe))) != NULLPE && PE_ID (p12 -> pe_class, p12 -> pe_id) != PE_ID (PE_CLASS_CONT, 2)) p12 = NULLPE; if (p12 != NULLPE) { p9 = p12; { /* element TAG PULLUP */ register PE p13; if ((p13 = prim2set (p12)) == NULLPE) { advise (NULLCP, "accessControl %selement: %s", PEPY_ERR_BAD, pe_error (p12 -> pe_errno)); return NOTOK; } if (p13 -> pe_cardinal != 1) { advise (NULLCP, "accessControl %s element: %d", PEPY_ERR_TOO_MANY_TAGGED, p13 -> pe_cardinal); return NOTOK; } p12 = first_member (p13); } { /* accessControl */ #ifdef DEBUG (void) testdebug (p12, "accessControl"); #endif if (decode_UNIV_EXTERNAL (p12, 1, NULLINTP, NULLVP, &parm -> mai_access) == NOTOK) return NOTOK; } } } { register PE p14; if ((p14 = (pe != p9 ? next_member (pe, p9) : first_member (pe))) != NULLPE) { p9 = p14; { /* element TAG PULLUP */ register PE p15; if ((p15 = prim2set (p14)) == NULLPE) { advise (NULLCP, "userInfo %selement: %s", PEPY_ERR_BAD, pe_error (p14 -> pe_errno)); return NOTOK; } if (p15 -> pe_cardinal != 1) { advise (NULLCP, "userInfo %s element: %d", PEPY_ERR_TOO_MANY_TAGGED, p15 -> pe_cardinal); return NOTOK; } p14 = first_member (p15); } { /* userInfo */ #ifdef DEBUG (void) testdebug (p14, "userInfo"); #endif if (decode_UNIV_EXTERNAL (p14, 1, NULLINTP, NULLVP, &parm -> mai_info) == NOTOK) return NOTOK; } } } if (pe -> pe_cardinal > 4) { advise (NULLCP, "CMIPUserInfo %s(4): %d", PEPY_ERR_TOO_MANY_ELEMENTS, pe -> pe_cardinal); return NOTOK; } return OK; } /* ARGSUSED */ int parse_CMIPAssoc_ProtocolVersion (pe, explicit, len, buffer, parm) register PE pe; int explicit; integer *len; char **buffer; int * parm; { char * cp; int length; register PE p16; #ifdef DEBUG (void) testdebug (pe, "CMIPAssoc.ProtocolVersion"); #endif if (explicit) { if (pe -> pe_class != PE_CLASS_UNIV || pe -> pe_id != PE_PRIM_BITS) { advise (NULLCP, "ProtocolVersion bad class/form/id: %s/%d/0x%x", pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id); return NOTOK; } } if ((p16 = prim2bit (pe)) == NULLPE) { advise (NULLCP, "ProtocolVersion %s%s", PEPY_ERR_BAD_BITS, pe_error (pe -> pe_errno)); return NOTOK; } cp = bitstr2strb (pe, &( length)); if (buffer && len) *buffer = cp , *len = length; #define BITS "\020\01version1" { *parm = strb2int(cp, length); free(cp); } #undef BITS return OK; } /* ARGSUSED */ int parse_CMIPAssoc_FunctionalUnits (pe, explicit, len, buffer, parm) register PE pe; int explicit; integer *len; char **buffer; int * parm; { char * cp; int length; register PE p17; #ifdef DEBUG (void) testdebug (pe, "CMIPAssoc.FunctionalUnits"); #endif if (explicit) { if (pe -> pe_class != PE_CLASS_UNIV || pe -> pe_id != PE_PRIM_BITS) { advise (NULLCP, "FunctionalUnits bad class/form/id: %s/%d/0x%x", pe_classlist[pe -> pe_class], pe -> pe_form, pe -> pe_id); return NOTOK; } } if ((p17 = prim2bit (pe)) == NULLPE) { advise (NULLCP, "FunctionalUnits %s%s", PEPY_ERR_BAD_BITS, pe_error (pe -> pe_errno)); return NOTOK; } cp = bitstr2strb (pe, &( length)); if (buffer && len) *buffer = cp , *len = length; #define BITS "\020\01multipleObjectSelection\02filter\03multipleReply\04extendedService\05confirmedCancelGet" { *parm = strb2int(cp, length); free(cp); } #undef BITS return OK; } /* VARARGS2 */ static void advise (what, fmt, a, b, c, d, e, f, g, h, i, j) char *what, *fmt, *a, *b, *c, *d, *e, *f, *g, *h, *i, *j; { (void) fflush(stdout); (void) fprintf(stderr, "libmsap: "); (void) fprintf(stderr, fmt, a, b, c, d, e, f, g, h, i, j); if (what) (void) fputc(' ', stderr), perror(what); else (void) fputc('\n', stderr); (void) fflush(stderr); }