summaryrefslogtreecommitdiffstats
path: root/extras/emacs/plugin-test-skel.el
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-10-31 09:54:34 -0400
committerDave Barach <dave@barachs.net>2018-10-31 09:55:09 -0400
commit8284244d48efad190058a39f05b37f02ea48d0ce (patch)
treef5687f200810b85ed41eb8f471eec28b13a74736 /extras/emacs/plugin-test-skel.el
parent6070768ce02fa7bde2146b5bd39078630f667d28 (diff)
EMACS-LISP-ONLY: fix names of xxx_main_t pointers
main_t pointer: <first-letter-of-plugin-name> + "mp" test_main_t pointer: <first-letter-of-plugin-name> + "mp" AKA: (setq main-p (concat (substring plugin-name 0 1) "mp")) etc. Change-Id: Ie1b38fb62485183bbe00f649683492aa82a21376 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'extras/emacs/plugin-test-skel.el')
-rw-r--r--extras/emacs/plugin-test-skel.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/extras/emacs/plugin-test-skel.el b/extras/emacs/plugin-test-skel.el
index 5928c974c9f..1de1b9861af 100644
--- a/extras/emacs/plugin-test-skel.el
+++ b/extras/emacs/plugin-test-skel.el
@@ -22,6 +22,7 @@ nil
(setq plugin-name (read-string "Plugin name: ")))
'(setq PLUGIN-NAME (upcase plugin-name))
'(setq capital-oh-en "ON")
+'(setq main-p (concat (substring plugin-name 0 1) "tmp"))
"/*
* " plugin-name ".c - skeleton vpp-api-test plug-in
*
@@ -159,10 +160,10 @@ _(" plugin-name "_enable_disable, \"<intfc> [disable]\")
static void " plugin-name "_api_hookup (vat_main_t *vam)
{
- " plugin-name "_test_main_t * sm = &" plugin-name "_test_main;
+ " plugin-name "_test_main_t * " main-p " = &" plugin-name "_test_main;
/* Hook up handlers for replies from the data plane plug-in */
#define _(N,n) \\
- vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \\
+ vl_msg_api_set_handlers((VL_API_##N + " main-p "->msg_id_base), \\
#n, \\
vl_api_##n##_t_handler, \\
vl_noop_handler, \\
@@ -185,16 +186,16 @@ static void " plugin-name "_api_hookup (vat_main_t *vam)
clib_error_t * vat_plugin_register (vat_main_t *vam)
{
- " plugin-name "_test_main_t * sm = &" plugin-name "_test_main;
+ " plugin-name "_test_main_t * " main-p " = &" plugin-name "_test_main;
u8 * name;
- sm->vat_main = vam;
+ " main-p "->vat_main = vam;
/* Ask the vpp engine for the first assigned message-id */
name = format (0, \"" plugin-name "_%08x%c\", api_version, 0);
- sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name);
+ " main-p "->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name);
- if (sm->msg_id_base != (u16) ~0)
+ if (" main-p "->msg_id_base != (u16) ~0)
" plugin-name "_api_hookup (vam);
vec_free(name);