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:
shmuels 2020-07-02 15:00:53 +03:00
parent eda4a58ebf
commit 58ea4eba27
27 changed files with 274 additions and 119 deletions

View file

@ -34,7 +34,9 @@
* The exported interface to plugins. External apps (eg frontend restconf plugins)
* should only include this file (not the restconf_*.h)
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _CLIXON_RESTCONF_H_
#define _CLIXON_RESTCONF_H_
@ -65,3 +67,8 @@ char *restconf_param_get(clicon_handle h, char *param);
int restconf_param_set(clicon_handle h, char *param, char *val);
#endif /* _CLIXON_RESTCONF_H_ */
#ifdef __cplusplus
} /* extern "C" */
#endif

View file

@ -34,6 +34,10 @@
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _RESTCONF_LIB_H_
#define _RESTCONF_LIB_H_
@ -68,3 +72,8 @@ char *restconf_uripath(clicon_handle h);
int restconf_drop_privileges(clicon_handle h, char *user);
#endif /* _RESTCONF_LIB_H_ */
#ifdef __cplusplus
} /* extern "C" */
#endif