blob: dc2ec3805c2300f067ab70699f2ca71fc39bfcd4 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001;;; config-skel.el - config function command skeleton
2
3(require 'skeleton)
4
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -07005(define-skeleton skel-config
Ed Warnickecb9cada2015-12-08 15:45:58 -07006"Insert a vlib config skeleton "
7nil
8'(setq cfg-name (skeleton-read "Config Class Name: "))
9
10"
11static clib_error_t *
12" cfg-name "_config (vlib_main_t * vm, unformat_input_t * input)
13{
14 u32 whatever;
15
16 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
17 if (unformat (input, \"whatever %d\", &whatever))
18 ;
19 else
20 return clib_error_return (0, \"unknown input `%U'\",
21 format_unformat_error, input);
22 }
23
24 return 0;
25}
26
27VLIB_CONFIG_FUNCTION (" cfg-name "_config, \"" cfg-name "\");
28")