xref: /titanic_51/usr/src/lib/libnisdb/db_entry_c.x (revision 75100ee845c13b4b3c7f0d83fa2f9725e699d6e9)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  *	db_entry_c.x
24  *
25  * Copyright 2015 Gary Mills
26  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
27  * Use is subject to license terms.
28  */
29 
30 /*
31  * Some manifest constants, chosen to maximize flexibility without
32  * plugging the wire full of data.
33  */
34 
35 #if RPC_HDR
36 %#ifndef _DB_NIS_H
37 %#define _DB_NIS_H
38 
39 %#include <rpcsvc/nis.h>
40 #endif /* RPC_HDR */
41 
42 #if RPC_XDR
43 %#include "nis_clnt.h"
44 #endif /* RPC_XDR */
45 
46 #ifdef USINGC
47 enum db_status {DB_SUCCESS, DB_NOTFOUND, DB_NOTUNIQUE,
48 		DB_BADTABLE, DB_BADQUERY, DB_BADOBJECT,
49 		DB_MEMORY_LIMIT, DB_STORAGE_LIMIT, DB_INTERNAL_ERROR};
50 
51 enum db_action {DB_LOOKUP, DB_REMOVE, DB_ADD, DB_FIRST, DB_NEXT,
52 			DB_ALL, DB_RESET_NEXT, DB_ADD_NOLOG,
53 			DB_ADD_NOSYNC, DB_REMOVE_NOSYNC };
54 #endif /* USINGC */
55 
56 /* Make alias to NIS definition */
57 
58 typedef entry_obj entry_object;
59 typedef entry_object * entry_object_p;
60 
61 typedef nis_name db_stringname;
62 typedef nis_attr db_attrname;          /* What the database knows it as */
63 
64 
65 /*  nis_dba.x ----------------------------- */
66 
67 /*
68  * Structure definitions for the parameters and results of the actual
69  * NIS DBA calls
70  *
71  * This is the standard result (in the protocol) of most of the nis
72  * requests.
73  */
74 
75 /*typedef long db_next_desc;*/
76 
77 typedef opaque db_next_desc<>;            /* opaque string */
78 
79 struct db_result {
80 	db_status 	status;		/* The status itself 	 */
81 	db_next_desc    nextinfo;       /* for first/next sequence */
82 	entry_object_p	objects<>;	/* And the objects found */
83 	long		ticks;		/* for statistics	 */
84 };
85 
86 struct db_request {
87   db_stringname table_name;
88   db_attrname  attrs<NIS_MAXCOLUMNS>;
89   entry_object * obj;      /* only used for addition */
90 };
91 
92 #ifndef USINGC
93 %#ifdef __cplusplus
94 %extern "C"  entry_object * new_entry( entry_object*);
95 %extern "C"  bool_t copy_entry ( entry_object*, entry_object*);
96 %extern "C"  void free_entry (entry_object*);
97 %extern "C"  bool_t sameEntry(entry_object *, entry_object *);
98 %#elif __STDC__
99 %extern entry_object * new_entry( entry_object*);
100 %extern bool_t copy_entry ( entry_object*, entry_object*);
101 %extern void free_entry (entry_object*);
102 %extern bool_t sameEntry(entry_object *, entry_object *);
103 %#endif
104 #else
105 #if RPC_HDR
106 %extern void print_entry();
107 %extern char copy_entry();
108 %extern void free_entry();
109 %extern void new_entry();
110 #endif /* RPC_HDR */
111 #endif /* USINGC */
112 
113 #if RPC_HDR
114 %#endif /* _DB_NIS_H */
115 #endif /* RPC_HDR */
116