Skip to content

Commit

Permalink
system-plugin: refactor plugin library linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
zinccyy committed Jan 3, 2023
1 parent d1e7fb5 commit 2421d90
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(
SOURCES

src/plugin.c
src/plugin/common.c
src/plugin/ly_tree.c

# startup
Expand Down
8 changes: 4 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "sysrepo_types.h"
#include <sysrepo.h>
#include <signal.h>
#include <unistd.h>

#include "plugin.h"
#include "plugin/common.h"

volatile int exit_application = 0;

extern const char *PLUGIN_NAME;
extern int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_data);
extern void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_data);

static void sigint_handler(__attribute__((unused)) int signum);

int main(void)
Expand Down
3 changes: 3 additions & 0 deletions src/plugin/common.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "common.h"

const char *const PLUGIN_NAME = "ietf-system-plugin";
5 changes: 3 additions & 2 deletions src/plugin/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#ifndef SYSTEM_PLUGIN_COMMON_H
#define SYSTEM_PLUGIN_COMMON_H

#define PLUGIN_NAME "system-plugin"
// #define PLUGIN_NAME "system-plugin"
extern const char *const PLUGIN_NAME;

#define BASE_YANG_MODULE "ietf-system"

Expand Down Expand Up @@ -79,4 +80,4 @@

#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

#endif // SYSTEM_PLUGIN_COMMON_H
#endif // SYSTEM_PLUGIN_COMMON_H

0 comments on commit 2421d90

Please sign in to comment.