Annotation of 43BSDReno/contrib/isode-beta/dsap/net/daplose.c, revision 1.1.1.1

1.1       root        1: /* daplose.c - DAP: Support for directory protocol mappings */
                      2: 
                      3: #ifndef        lint
                      4: static char *rcsid = "$Header: /f/osi/dsap/net/RCS/daplose.c,v 7.0 90/07/26 14:45:22 mrose Exp $";
                      5: #endif
                      6: 
                      7: /* 
                      8:  * $Header: /f/osi/dsap/net/RCS/daplose.c,v 7.0 90/07/26 14:45:22 mrose Exp $
                      9:  *
                     10:  *
                     11:  * $Log:       daplose.c,v $
                     12:  * Revision 7.0  90/07/26  14:45:22  mrose
                     13:  * *** empty log message ***
                     14:  * 
                     15:  */
                     16: 
                     17: /*
                     18:  *                               NOTICE
                     19:  *
                     20:  *    Acquisition, use, and distribution of this module and related
                     21:  *    materials are subject to the restrictions of a license agreement.
                     22:  *    Consult the Preface in the User's Manual for the full terms of
                     23:  *    this agreement.
                     24:  *
                     25:  */
                     26: 
                     27: 
                     28: /* LINTLIBRARY */
                     29: 
                     30: #include <stdio.h>
                     31: #include <varargs.h>
                     32: #include "tailor.h"
                     33: #include "quipu/dap2.h"
                     34: 
                     35: /*  */
                     36: 
                     37: #ifndef        lint
                     38: int    daplose (va_alist)
                     39: va_dcl
                     40: {
                     41:     int            reason,
                     42:            result;
                     43:     struct DAPindication *di;
                     44:     va_list ap;
                     45: 
                     46:     va_start (ap);
                     47: 
                     48:     di = va_arg (ap, struct DAPindication *);
                     49:     reason = va_arg (ap, int);
                     50: 
                     51:     result = _daplose (di, reason, ap);
                     52: 
                     53:     va_end (ap);
                     54: 
                     55:     return result;
                     56: }
                     57: #else
                     58: /* VARARGS4 */
                     59: 
                     60: int    daplose (di, reason, what, fmt)
                     61: struct DAPindication *di;
                     62: int    reason;
                     63: char   *what,
                     64:        *fmt;
                     65: {
                     66:     return daplose (di, reason, what, fmt);
                     67: }
                     68: #endif
                     69: 
                     70: /*  */
                     71: 
                     72: #ifndef        lint
                     73: static int  _daplose (di, reason, ap)  /* what, fmt, args ... */
                     74: register struct DAPindication *di;
                     75: int     reason;
                     76: va_list        ap;
                     77: {
                     78:     register char  *bp;
                     79:     char    buffer[BUFSIZ];
                     80:     struct DAPabort    * da;
                     81: 
                     82:     if (di) {
                     83:        bzero ((char *) di, sizeof *di);
                     84:        di->di_type = DI_ABORT;
                     85:        da = &(di->di_abort);
                     86:        da->da_reason = reason;
                     87: 
                     88:        asprintf (bp = buffer, ap);
                     89:        bp += strlen (bp);
                     90: 
                     91:        copyDAPdata (buffer, bp - buffer, da);
                     92:     }
                     93: 
                     94:     return NOTOK;
                     95: }
                     96: #endif
                     97: 
                     98: #ifndef        lint
                     99: int    dapreject (va_alist)
                    100: va_dcl
                    101: {
                    102:     int            reason,
                    103:            id,
                    104:            result;
                    105:     struct DAPindication *di;
                    106:     va_list ap;
                    107: 
                    108:     va_start (ap);
                    109: 
                    110:     di = va_arg (ap, struct DAPindication *);
                    111:     reason = va_arg (ap, int);
                    112:     id = va_arg (ap, int);
                    113: 
                    114:     result = _dapreject (di, reason, id, ap);
                    115: 
                    116:     va_end (ap);
                    117: 
                    118:     return result;
                    119: }
                    120: #else
                    121: /* VARARGS4 */
                    122: 
                    123: int    dapreject (di, reason, id, what, fmt)
                    124: struct DAPindication *di;
                    125: int    reason;
                    126: int    id;
                    127: char   *what,
                    128:        *fmt;
                    129: {
                    130:     return dapreject (di, reason, id, what, fmt);
                    131: }
                    132: #endif
                    133: 
                    134: /*  */
                    135: 
                    136: #ifndef        lint
                    137: static int  _dapreject (di, reason, id, ap)  /* what, fmt, args ... */
                    138: register struct DAPindication *di;
                    139: int     reason;
                    140: int    id;
                    141: va_list        ap;
                    142: {
                    143:     register char  *bp;
                    144:     char    buffer[BUFSIZ];
                    145:     struct DAPpreject  * dp;
                    146: 
                    147:     if (di) {
                    148:        bzero ((char *) di, sizeof *di);
                    149:        di->di_type = DI_PREJECT;
                    150:        dp = &(di->di_preject);
                    151:        dp->dp_id = id;
                    152:        dp->dp_reason = reason;
                    153: 
                    154:        asprintf (bp = buffer, ap);
                    155:        bp += strlen (bp);
                    156: 
                    157:        copyDAPdata (buffer, bp - buffer, dp);
                    158:     }
                    159: 
                    160:     return (NOTOK);
                    161: }
                    162: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.