]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/shell.h
Fix matched values bug
[openldap] / servers / slapd / back-shell / shell.h
1 /* shell.h - shell backend header file */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
5  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6  */
7
8 #ifndef SLAPD_SHELL_H
9 #define SLAPD_SHELL_H
10
11 #include "external.h"
12
13 LDAP_BEGIN_DECL
14
15 #if defined(HAVE_RECVMSG) && !defined(NO_THREADS)
16 #  define SHELL_SURROGATE_PARENT
17 #endif
18
19 #ifdef SHELL_SURROGATE_PARENT
20
21 extern ldap_pvt_thread_mutex_t shell_surrogate_index_mutex;
22 extern ldap_pvt_thread_mutex_t shell_surrogate_fd_mutex[2];
23 extern int                     shell_surrogate_fd[2];
24 extern pid_t                   shell_surrogate_pid;
25
26 typedef struct berval Cmd_info;
27 #define MAKE_CMD_INFO(args)  make_cmd_info( args )
28 #define IS_NULLCMD(cmd)      ((cmd).bv_val == NULL)
29
30 extern void make_surrogate_parent LDAP_P(( void ));
31
32 #else /* !SHELL_SURROGATE_PARENT */
33
34 typedef char **Cmd_info;
35 #define MAKE_CMD_INFO(args)  charray_dup( args )
36 #define IS_NULLCMD(cmd)      ((cmd) == NULL)
37
38 #endif /* SHELL_SURROGATE_PARENT */
39
40 struct shellinfo {
41         Cmd_info si_bind;       /* cmd + args to exec for bind    */
42         Cmd_info si_unbind;     /* cmd + args to exec for unbind  */
43         Cmd_info si_search;     /* cmd + args to exec for search  */
44         Cmd_info si_compare;    /* cmd + args to exec for compare */
45         Cmd_info si_modify;     /* cmd + args to exec for modify  */
46         Cmd_info si_modrdn;     /* cmd + args to exec for modrdn  */
47         Cmd_info si_add;        /* cmd + args to exec for add     */
48         Cmd_info si_delete;     /* cmd + args to exec for delete  */
49         Cmd_info si_abandon;    /* cmd + args to exec for abandon */
50 };
51
52 struct slap_backend_db;
53 struct slap_conn;
54 struct slap_op;
55
56 extern pid_t forkandexec LDAP_P((
57         Cmd_info args,
58         FILE **rfp,
59         FILE **wfp));
60
61 extern void print_suffixes LDAP_P((
62         FILE *fp,
63         struct slap_backend_db *bd));
64
65 extern int read_and_send_results LDAP_P((
66         struct slap_backend_db *bd,
67         struct slap_conn *conn,
68         struct slap_op *op,
69         FILE *fp,
70         AttributeName *attrs,
71         int attrsonly));
72
73 LDAP_END_DECL
74
75 #endif