yumapro  20.10-12
YumaPro SDK
help.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_help
13 #define _H_help
14 
15 /* FILE: help.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
29 /*********************************************************************
30 * *
31 * C H A N G E H I S T O R Y *
32 * *
33 *********************************************************************
34 
35 date init comment
36 ----------------------------------------------------------------------
37 05-oct-07 abb Begun
38 
39 */
40 
41 #include <xmlstring.h>
42 
43 #ifndef _H_ncxconst
44 #include "ncxconst.h"
45 #endif
46 
47 #ifndef _H_obj
48 #include "obj.h"
49 #endif
50 
51 #ifndef _H_typ
52 #include "typ.h"
53 #endif
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /********************************************************************
60 * *
61 * C O N S T A N T S *
62 * *
63 *********************************************************************/
64 
65 #define HELP_MODE_BRIEF_MAX 60
66 #define HELP_MODE_NORMAL_MAX 100
67 
68 
69 /********************************************************************
70 * *
71 * T Y P E S *
72 * *
73 *********************************************************************/
74 
84 typedef enum help_mode_t_ {
89 } help_mode_t;
90 
91 
92 /********************************************************************
93 * *
94 * F U N C T I O N S *
95 * *
96 *********************************************************************/
97 
98 
109 extern void
110  help_program_module (const xmlChar *modname,
111  const xmlChar *cliname,
112  help_mode_t mode);
113 
114 
123 extern void
124  help_data_module (const ncx_module_t *mod,
125  help_mode_t mode);
126 
127 
134 extern void
135  help_type (const typ_template_t *typ,
136  help_mode_t mode);
137 
138 
145 extern void
146  help_object (obj_template_t *obj,
147  help_mode_t mode);
148 
149 
160 extern void
161  help_write_lines (const xmlChar *str,
162  uint32 indent,
163  boolean startnl);
164 
165 
177 extern void
178  help_write_lines_max (const xmlChar *str,
179  uint32 indent,
180  boolean startnl,
181  uint32 maxlen);
182 
183 
190 extern help_mode_t
191  help_cvt_str (const xmlChar *str);
192 
193 
200 extern const xmlChar *
201  help_cvt_enum (help_mode_t mode);
202 
203 
207 #ifdef __cplusplus
208 } /* end extern 'C' */
209 #endif
210 
211 #endif /* _H_help */
typ_get_basetype
ncx_btype_t typ_get_basetype(const typ_def_t *typdef)
Get the final base type of the specified typ_def_t.
Definition: typ.c:1764
help_type
void help_type(const typ_template_t *typ, help_mode_t mode)
Print the full help text for a YANG data type to STDOUT.
Definition: help.c:369
HELP_MODE_NORMAL
@ HELP_MODE_NORMAL
–normal mode selected or default
Definition: help.h:87
obj_dump_datadefQ
void obj_dump_datadefQ(dlq_hdr_t *datadefQ, help_mode_t mode, uint32 nestlevel, uint32 indent)
Dump the contents of a datadefQ for debugging.
Definition: obj_help.c:655
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
obj_any_rpcs
boolean obj_any_rpcs(const dlq_hdr_t *datadefQ)
Check if there are any RPC methods in the datadefQ.
Definition: obj.c:9760
val.h
Value Node Basic Support.
help_cvt_str
help_mode_t help_cvt_str(const xmlChar *str)
Convert a string to a help_mode_t enum.
Definition: help.c:538
HELP_MODE_NONE
@ HELP_MODE_NONE
value not set
Definition: help.h:85
help_write_lines
void help_write_lines(const xmlChar *str, uint32 indent, boolean startnl)
write some indented output to STDOUT
Definition: help.c:440
ncx_get_mod_ocversion
const xmlChar * ncx_get_mod_ocversion(const ncx_module_t *mod)
Get the module openconfig-version string for the specified module.
Definition: ncx.c:8994
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
help.h
YANG help text support for CLI Print help text for various templates.
OBJ_TYP_CONTAINER
@ OBJ_TYP_CONTAINER
container
Definition: obj.h:614
ERR_NCX_MOD_NOT_FOUND
@ ERR_NCX_MOD_NOT_FOUND
236
Definition: status_enum.h:275
ncx_find_object
obj_template_t * ncx_find_object(ncx_module_t *mod, const xmlChar *objname)
Find a top level module object.
Definition: ncx.c:4345
HELP_MODE_BRIEF
@ HELP_MODE_BRIEF
–brief mode selected
Definition: help.h:86
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
obj_help.h
Help command support for obj_template_t.
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
typ.h
Parameter Type Handler.
tk_get_btype_sym
const char * tk_get_btype_sym(ncx_btype_t btyp)
Get the symbolic token symbol for one of the base types.
Definition: tk.c:3324
log_stdout
void log_stdout(const char *fstr,...) __attribute__((format(printf
Write output to STDOUT.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
help_program_module
void help_program_module(const xmlChar *modname, const xmlChar *cliname, help_mode_t mode)
Print the full help text for an entire program module to STDOUT.
Definition: help.c:229
OBJ_TYP_RPC
@ OBJ_TYP_RPC
rpc-stmt
Definition: obj.h:623
help_mode_t_
help_mode_t_
modes to match the keywords brief, normal, full
Definition: help.h:84
obj_get_datadefQ
dlq_hdr_t * obj_get_datadefQ(obj_template_t *obj)
Get the datadefQ (or caseQ) if this object has one.
Definition: obj.c:11455
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
log.h
NCX System Logging Manager.
help_object
void help_object(obj_template_t *obj, help_mode_t mode)
Print the full help text for an object template to STDOUT.
Definition: help.c:413
HELP_MODE_FULL
@ HELP_MODE_FULL
–full selected
Definition: help.h:88
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
obj_dump_template
void obj_dump_template(obj_template_t *obj, help_mode_t mode, uint32 nestlevel, uint32 indent)
Dump the contents of an obj_template_t struct for help text.
Definition: obj_help.c:220
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
help_write_lines_max
void help_write_lines_max(const xmlChar *str, uint32 indent, boolean startnl, uint32 maxlen)
write some indented output to STDOUT
Definition: help.c:480
ncx_find_module
ncx_module_t * ncx_find_module(const xmlChar *modname, const xmlChar *revision)
Find a ncx_module_t in the ncx_sesmodQ.
Definition: ncx.c:3227
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
help_cvt_enum
const xmlChar * help_cvt_enum(help_mode_t mode)
Convert a help_mode_t enum to a string.
Definition: help.c:563
help_data_module
void help_data_module(const ncx_module_t *mod, help_mode_t mode)
Print the full help text for an entire data module to STDOUT.
Definition: help.c:330
status.h
Global error messages for status code enumerations.