xref: /netbsd-src/external/ibm-public/postfix/dist/src/global/mail_command_server.c (revision 41fbaed053f8fbfdf9d2a4ee0a7386a3c83f8505)
1*41fbaed0Stron /*	$NetBSD: mail_command_server.c,v 1.1.1.1 2009/06/23 10:08:46 tron Exp $	*/
2*41fbaed0Stron 
3*41fbaed0Stron /*++
4*41fbaed0Stron /* NAME
5*41fbaed0Stron /*	mail_command_server 3
6*41fbaed0Stron /* SUMMARY
7*41fbaed0Stron /*	single-command server
8*41fbaed0Stron /* SYNOPSIS
9*41fbaed0Stron /*	#include <mail_proto.h>
10*41fbaed0Stron /*
11*41fbaed0Stron /*	int	mail_command_server(stream, type, name, ...)
12*41fbaed0Stron /*	VSTREAM	*stream;
13*41fbaed0Stron /*	int	type;
14*41fbaed0Stron /*	const char *name;
15*41fbaed0Stron /* DESCRIPTION
16*41fbaed0Stron /*	This module implements the server interface for single-command
17*41fbaed0Stron /*	requests: a clients sends a single command and expects a single
18*41fbaed0Stron /*	completion status code.
19*41fbaed0Stron /*
20*41fbaed0Stron /*	Arguments:
21*41fbaed0Stron /* .IP stream
22*41fbaed0Stron /*	Server endpoint.
23*41fbaed0Stron /* .IP "type, name, ..."
24*41fbaed0Stron /*	Attribute list as defined in attr_scan(3).
25*41fbaed0Stron /* DIAGNOSTICS
26*41fbaed0Stron /*	Fatal: out of memory.
27*41fbaed0Stron /* SEE ALSO
28*41fbaed0Stron /*	attr_scan(3)
29*41fbaed0Stron /*	mail_command_client(3) client interface
30*41fbaed0Stron /*	mail_proto(3h), client-server protocol
31*41fbaed0Stron #include <mail_proto.h>
32*41fbaed0Stron /* LICENSE
33*41fbaed0Stron /* .ad
34*41fbaed0Stron /* .fi
35*41fbaed0Stron /*	The Secure Mailer license must be distributed with this software.
36*41fbaed0Stron /* AUTHOR(S)
37*41fbaed0Stron /*	Wietse Venema
38*41fbaed0Stron /*	IBM T.J. Watson Research
39*41fbaed0Stron /*	P.O. Box 704
40*41fbaed0Stron /*	Yorktown Heights, NY 10598, USA
41*41fbaed0Stron /*--*/
42*41fbaed0Stron 
43*41fbaed0Stron /* System library. */
44*41fbaed0Stron 
45*41fbaed0Stron #include <sys_defs.h>
46*41fbaed0Stron #include <stdlib.h>		/* 44BSD stdarg.h uses abort() */
47*41fbaed0Stron #include <stdarg.h>
48*41fbaed0Stron #include <string.h>
49*41fbaed0Stron 
50*41fbaed0Stron /* Utility library. */
51*41fbaed0Stron 
52*41fbaed0Stron #include <vstream.h>
53*41fbaed0Stron 
54*41fbaed0Stron /* Global library. */
55*41fbaed0Stron 
56*41fbaed0Stron #include "mail_proto.h"
57*41fbaed0Stron 
58*41fbaed0Stron /* mail_command_server - read single-command request */
59*41fbaed0Stron 
mail_command_server(VSTREAM * stream,...)60*41fbaed0Stron int     mail_command_server(VSTREAM *stream,...)
61*41fbaed0Stron {
62*41fbaed0Stron     va_list ap;
63*41fbaed0Stron     int     count;
64*41fbaed0Stron 
65*41fbaed0Stron     va_start(ap, stream);
66*41fbaed0Stron     count = attr_vscan(stream, ATTR_FLAG_MISSING, ap);
67*41fbaed0Stron     va_end(ap);
68*41fbaed0Stron     return (count);
69*41fbaed0Stron }
70