Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | ;;; config-skel.el - config function command skeleton |
| 2 | |
| 3 | (require 'skeleton) |
| 4 | |
| 5 | (define-skeleton config-skel |
| 6 | "Insert a vlib config skeleton " |
| 7 | nil |
| 8 | '(setq cfg-name (skeleton-read "Config Class Name: ")) |
| 9 | |
| 10 | " |
| 11 | static 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 | |
| 27 | VLIB_CONFIG_FUNCTION (" cfg-name "_config, \"" cfg-name "\"); |
| 28 | ") |