The yp-show library contains vendor code for global APIs that are not specific to 1 YANG module.
The mandatory to implement callback functions for yangcli application initialization and cleanup are described in this section.
Copy and Setup libshow subtree
The default library created by building libshow is 'libyp_show-example.so'. This is not the correct filename, in order to prevent the real yap-show library from being overwritten by the empty example library, if “make install” is run.
The libshow subtree should be copied to your own development area and modified.
Instructions are in the src/Makefile:
# # to make a real library, copy this directory contents # to a new location and change yp-show-example to yp_show # in the SUBDIR_NM macro below # # SUBDIR_NM=yp_show # SUBDIR_NM=yp_show-example
Change the string 'yp-show-example' to 'yp-show' in the src/Makefile in the copy of libshow.
This function is used to initialize the show commands in the yangcli-pro application during initialization.
/* yangcli show init callback * * INPUTS: * * RETURNS: * status; error will abort startup */ extern status_t yp_show_init (void);
This function is used to cleanup the yangcli-pro show commands when the application is shutting down or restarting.
/* yangcli show cleanup callback * this callback is invoked once during yangcli_cleanup */ extern void yp_show_cleanup (void);