IPC API  3.40.00.06
NameServer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2015, 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 
171 #define NameServer_E_NAMETOOLONG (-11)
172 
173 /* =============================================================================
174  * Macros
175  * =============================================================================
176  */
177 
181 #define NameServer_ALLOWGROWTH (~0)
182 
186 #define NameServer_Params_MAXNAMELEN (16)
187 
188 /* =============================================================================
189  * Structures & Enums
190  * =============================================================================
191  */
192 
196 typedef struct NameServer_Object *NameServer_Handle;
197 
201 typedef struct NameServer_Params {
261 
262 
263 /* =============================================================================
264  * NameServer Module-wide Functions
265  * =============================================================================
266  */
267 
276 
292 NameServer_Handle NameServer_create(String name,
293  const NameServer_Params *params);
294 
313 Int NameServer_delete(NameServer_Handle *handlePtr);
314 
335 NameServer_Handle NameServer_getHandle(String name);
336 
337 /* =============================================================================
338  * NameServer Per-instance Functions
339  * =============================================================================
340  */
341 
371 Ptr NameServer_add(NameServer_Handle handle, String name, Ptr buf, UInt32 len);
372 
404 Ptr NameServer_addUInt32(NameServer_Handle handle, String name, UInt32 value);
405 
459 Int NameServer_get(NameServer_Handle handle,
460  String name,
461  Ptr buf,
462  UInt32 *len,
463  UInt16 procId[]);
464 
512 Int NameServer_getUInt32(NameServer_Handle handle,
513  String name,
514  Ptr buf,
515  UInt16 procId[]);
516 
544 Int NameServer_getLocal(NameServer_Handle handle,
545  String name,
546  Ptr buf,
547  UInt32 *len);
548 
571 Int NameServer_getLocalUInt32(NameServer_Handle handle,
572  String name,
573  Ptr buf);
574 
591 Int NameServer_match(NameServer_Handle handle, String name, UInt32 *value);
592 
618 Int NameServer_remove(NameServer_Handle handle, String name);
619 
649 Int NameServer_removeEntry(NameServer_Handle handle, Ptr entry);
650 
651 #if defined (__cplusplus)
652 }
653 #endif /* defined (__cplusplus) */
654 
655 #endif /* ti_ipc_NameServer__include */
struct NameServer_Object * NameServer_Handle
NameServer handle type.
Definition: NameServer.h:196
Int NameServer_getLocalUInt32(NameServer_Handle handle, String name, Ptr buf)
Gets a 32-bit value by name from the local table.
UInt maxValueLen
Length, in MAUs, of the value field in the table.
Definition: NameServer.h:247
struct NameServer_Params NameServer_Params
NameServer_Handle type.
NameServer_Handle type.
Definition: NameServer.h:201
Int NameServer_get(NameServer_Handle handle, String name, Ptr buf, UInt32 *len, UInt16 procId[])
Gets the variable value length by name.
Ptr NameServer_add(NameServer_Handle handle, String name, Ptr buf, UInt32 len)
Adds a variable length value into the local NameServer table.
Int NameServer_getUInt32(NameServer_Handle handle, String name, Ptr buf, UInt16 procId[])
Gets a 32-bit value by name.
Int NameServer_getLocal(NameServer_Handle handle, String name, Ptr buf, UInt32 *len)
Gets the variable value length by name from the local table.
Int NameServer_delete(NameServer_Handle *handlePtr)
Deletes a NameServer instance.
UInt maxRuntimeEntries
Maximum name/value pairs that can be dynamically created.
Definition: NameServer.h:202
Int NameServer_remove(NameServer_Handle handle, String name)
Remove a name/value pair from the table.
Ptr tableHeap
Name/value table is allocated from this heap.
Definition: NameServer.h:217
Bool checkExisting
Check if a name already exists in the name/value table.
Definition: NameServer.h:230
UInt maxNameLen
Length, in MAUs, of the name field in the table.
Definition: NameServer.h:253
NameServer_Handle NameServer_getHandle(String name)
Gets the NameServer handle given the name.
NameServer_Handle NameServer_create(String name, const NameServer_Params *params)
Creates a NameServer instance.
Ptr NameServer_addUInt32(NameServer_Handle handle, String name, UInt32 value)
Adds a 32-bit value into the local NameServer table.
Int NameServer_removeEntry(NameServer_Handle handle, Ptr entry)
Remove a name/value pair from the table.
Void NameServer_Params_init(NameServer_Params *params)
Initializes parameter structure.
Copyright 2015, Texas Instruments Incorporated