Changed code so that it will be compatible with c++.
1. Added #ifdef extern "C" to public header files. 2. Changed variables that are key words in c++, to different names (like ns instead of namespace). 3. Changed char* to const char* for constant strings.
This commit is contained in:
parent
eda4a58ebf
commit
58ea4eba27
27 changed files with 274 additions and 119 deletions
|
|
@ -555,7 +555,7 @@ yang_find_module_by_prefix_yspec(yang_stmt *yspec,
|
|||
/*! Given a yang spec and a namespace, return yang module
|
||||
*
|
||||
* @param[in] yspec A yang specification
|
||||
* @param[in] namespace namespace
|
||||
* @param[in] ns namespace
|
||||
* @retval ymod Yang module statement if found
|
||||
* @retval NULL not found
|
||||
* @see yang_find_module_by_name
|
||||
|
|
@ -563,14 +563,14 @@ yang_find_module_by_prefix_yspec(yang_stmt *yspec,
|
|||
*/
|
||||
yang_stmt *
|
||||
yang_find_module_by_namespace(yang_stmt *yspec,
|
||||
char *namespace)
|
||||
char *ns)
|
||||
{
|
||||
yang_stmt *ymod = NULL;
|
||||
|
||||
if (namespace == NULL)
|
||||
if (ns == NULL)
|
||||
goto done;
|
||||
while ((ymod = yn_each(yspec, ymod)) != NULL) {
|
||||
if (yang_find(ymod, Y_NAMESPACE, namespace) != NULL)
|
||||
if (yang_find(ymod, Y_NAMESPACE, ns) != NULL)
|
||||
break;
|
||||
}
|
||||
done:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue