fixes init script for non ipv6 enabled systems #472755
[packages/xinetd.git] / xinetd / builtins.h
1 /*
2  * (c) Copyright 1992 by Panagiotis Tsirigotis
3  * (c) Sections Copyright 1998-2001 by Rob Braun
4  * All rights reserved.  The file named COPYRIGHT specifies the terms 
5  * and conditions for redistribution.
6  */
7
8 #ifndef BUILTINS_H
9 #define BUILTINS_H
10
11 /*
12  * $Id: builtins.h,v 1.2 2003/05/08 14:52:24 steveg Exp $
13  */
14
15 #include "defs.h"
16
17
18 #define FORK            YES
19 #define NO_FORK         NO
20
21 struct builtin
22 {
23    voidfunc    b_handler ;             /* builtin service handler           */
24    boolean_e   b_fork_server ;         /* whether a server must be forked   */
25 } ;
26
27 typedef struct builtin builtin_s ;
28
29 /*
30  * All builtins are invoked with a struct server argument
31  */
32 #define BUILTIN_HANDLER( bp )          ( (bp)->b_handler ) 
33 #define BUILTIN_INVOKE( bp, serp )     (*(bp)->b_handler)( serp )
34 #define BUILTIN_FORKS( bp )            ( (bp)->b_fork_server == YES )
35
36
37 struct builtin_service
38 {
39    const char  *bs_name ;               /* for identification purposes      */
40    int         bs_socket_type ;         /* for identification purposes      */
41    builtin_s   bs_handle ;
42 } ;
43
44 const builtin_s *builtin_find(const char *service_name,int type);
45 const builtin_s *builtin_lookup(const struct builtin_service services[],const char *service_name,int type);
46
47 #endif   /* BUILTIN_H */