Dave Barach | e5389bb | 2016-03-28 17:12:19 -0400 | [diff] [blame] | 1 | ;;; elog-enum-skel.el - enum elog skeleton |
| 2 | |
| 3 | (require 'skeleton) |
| 4 | |
| 5 | (define-skeleton skel-elog-enum |
| 6 | "Insert a skeleton enum event definition" |
| 7 | nil |
| 8 | '(setq function-name (skeleton-read "Function: ")) |
| 9 | '(setq label (skeleton-read "Label: ")) |
| 10 | |
| 11 | " |
| 12 | |
| 13 | /* $$$ May or may not be needed */ |
| 14 | #include <vlib/vlib.h> |
| 15 | #include <vppinfra/elog.h> |
| 16 | |
| 17 | static inline void " function-name " (u8 which) |
| 18 | { |
| 19 | ELOG_TYPE_DECLARE (e) = |
| 20 | { |
| 21 | .format = \"" label ": %s\", |
| 22 | .format_args = \"t1\", |
| 23 | .n_enum_strings = 2, |
| 24 | .enum_strings = |
| 25 | { |
| 26 | \"string 1\", |
| 27 | \"string 2\", |
| 28 | }, |
| 29 | }; |
| 30 | struct { u8 which;} * ed; |
| 31 | ed = ELOG_DATA (&vlib_global_main.elog_main, e); |
| 32 | ed->which = which; |
| 33 | } |
| 34 | |
| 35 | ") |