IPC API  3.00.04.29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NameServer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
82 #ifndef ti_ipc_NameServer__include
83 #define ti_ipc_NameServer__include
84 
85 #if defined (__cplusplus)
86 extern "C" {
87 #endif
88 
89 /* =============================================================================
90  * All success and failure codes for the module
91  * =============================================================================
92  */
93 
97 #define NameServer_S_BUSY 2
98 
102 #define NameServer_S_ALREADYSETUP 1
103 
107 #define NameServer_S_SUCCESS 0
108 
112 #define NameServer_E_FAIL -1
113 
117 #define NameServer_E_INVALIDARG -2
118 
122 #define NameServer_E_MEMORY -3
123 
127 #define NameServer_E_ALREADYEXISTS -4
128 
132 #define NameServer_E_NOTFOUND -5
133 
137 #define NameServer_E_TIMEOUT -6
138 
142 #define NameServer_E_INVALIDSTATE -7
143 
147 #define NameServer_E_OSFAILURE -8
148 
152 #define NameServer_E_RESOURCE -9
153 
157 #define NameServer_E_RESTART -10
158 
159 /* =============================================================================
160  * Macros
161  * =============================================================================
162  */
163 
167 #define NameServer_ALLOWGROWTH (~0)
168 
172 #define NameServer_Params_MAXNAMELEN 16
173 
174 /* =============================================================================
175  * Structures & Enums
176  * =============================================================================
177  */
178 
182 typedef struct NameServer_Object *NameServer_Handle;
183 
187 typedef struct NameServer_Params {
188  UInt maxRuntimeEntries;
203  Ptr tableHeap;
216  Bool checkExisting;
233  UInt maxValueLen;
239  UInt maxNameLen;
247 
248 
249 /* =============================================================================
250  * NameServer Module-wide Functions
251  * =============================================================================
252  */
253 
262 
273 NameServer_Handle NameServer_create(String name,
274  const NameServer_Params *params);
275 
290 Int NameServer_delete(NameServer_Handle *handlePtr);
291 
312 NameServer_Handle NameServer_getHandle(String name);
313 
314 /* =============================================================================
315  * NameServer Per-instance Functions
316  * =============================================================================
317  */
318 
348 Ptr NameServer_add(NameServer_Handle handle, String name, Ptr buf, UInt32 len);
349 
381 Ptr NameServer_addUInt32(NameServer_Handle handle, String name, UInt32 value);
382 
434 Int NameServer_get(NameServer_Handle handle,
435  String name,
436  Ptr buf,
437  UInt32 *len,
438  UInt16 procId[]);
439 
487 Int NameServer_getUInt32(NameServer_Handle handle,
488  String name,
489  Ptr buf,
490  UInt16 procId[]);
491 
519 Int NameServer_getLocal(NameServer_Handle handle,
520  String name,
521  Ptr buf,
522  UInt32 *len);
523 
546 Int NameServer_getLocalUInt32(NameServer_Handle handle,
547  String name,
548  Ptr buf);
549 
566 Int NameServer_match(NameServer_Handle handle, String name, UInt32 *value);
567 
593 Int NameServer_remove(NameServer_Handle handle, String name);
594 
624 Int NameServer_removeEntry(NameServer_Handle handle, Ptr entry);
625 
626 #if defined (__cplusplus)
627 }
628 #endif /* defined (__cplusplus) */
629 
630 #endif /* ti_ipc_NameServer__include */
Copyright 2013, Texas Instruments Incorporated