daplose.c

来自「ftam等标准协议服务器和客户端的源代码。」· C语言 代码 · 共 168 行

C
168
字号
/* daplose.c - DAP: Support for directory protocol mappings */#ifndef	lintstatic char *rcsid = "$Header: /xtel/isode/isode/dsap/net/RCS/daplose.c,v 9.0 1992/06/16 12:14:05 isode Rel $";#endif/*  * $Header: /xtel/isode/isode/dsap/net/RCS/daplose.c,v 9.0 1992/06/16 12:14:05 isode Rel $ * * * $Log: daplose.c,v $ * Revision 9.0  1992/06/16  12:14:05  isode * Release 8.0 * *//* *				  NOTICE * *    Acquisition, use, and distribution of this module and related *    materials are subject to the restrictions of a license agreement. *    Consult the Preface in the User's Manual for the full terms of *    this agreement. * *//* LINTLIBRARY */#include <stdio.h>#include <varargs.h>#include "tailor.h"#include "quipu/dap2.h"#ifndef	lintstatic int  _daplose ();static int  _dapreject ();#endif/*  */#ifndef	lintint	daplose (va_alist)va_dcl{    int	    reason,	    result;    struct DAPindication *di;    va_list ap;    va_start (ap);    di = va_arg (ap, struct DAPindication *);    reason = va_arg (ap, int);    result = _daplose (di, reason, ap);    va_end (ap);    return result;}#else/* VARARGS4 */int	daplose (di, reason, what, fmt)struct DAPindication *di;int	reason;char   *what,       *fmt;{    return daplose (di, reason, what, fmt);}#endif/*  */#ifndef	lintstatic int  _daplose (di, reason, ap)  /* what, fmt, args ... */register struct DAPindication *di;int     reason;va_list	ap;{    register char  *bp;    char    buffer[BUFSIZ];    struct DAPabort	* da;    if (di) {	bzero ((char *) di, sizeof *di);	di->di_type = DI_ABORT;	da = &(di->di_abort);	da->da_reason = reason;	asprintf (bp = buffer, ap);	bp += strlen (bp);	copyDAPdata (buffer, bp - buffer, da);    }    return NOTOK;}#endif#ifndef	lintint	dapreject (va_alist)va_dcl{    int	    reason,	    id,	    result;    struct DAPindication *di;    va_list ap;    va_start (ap);    di = va_arg (ap, struct DAPindication *);    reason = va_arg (ap, int);    id = va_arg (ap, int);    result = _dapreject (di, reason, id, ap);    va_end (ap);    return result;}#else/* VARARGS4 */int	dapreject (di, reason, id, what, fmt)struct DAPindication *di;int	reason;int	id;char   *what,       *fmt;{    return dapreject (di, reason, id, what, fmt);}#endif/*  */#ifndef	lintstatic int  _dapreject (di, reason, id, ap)  /* what, fmt, args ... */register struct DAPindication *di;int     reason;int	id;va_list	ap;{    register char  *bp;    char    buffer[BUFSIZ];    struct DAPpreject	* dp;    if (di) {	bzero ((char *) di, sizeof *di);	di->di_type = DI_PREJECT;	dp = &(di->di_preject);	dp->dp_id = id;	dp->dp_reason = reason;	asprintf (bp = buffer, ap);	bp += strlen (bp);	copyDAPdata (buffer, bp - buffer, dp);    }    return (NOTOK);}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?