1 ;;; Copyright (c) 2016 Cisco and/or its affiliates.
2 ;;; Licensed under the Apache License, Version 2.0 (the "License");
3 ;;; you may not use this file except in compliance with the License.
4 ;;; You may obtain a copy of the License at:
6 ;;; http://www.apache.org/licenses/LICENSE-2.0
8 ;;; Unless required by applicable law or agreed to in writing, software
9 ;;; distributed under the License is distributed on an "AS IS" BASIS,
10 ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 ;;; See the License for the specific language governing permissions and
12 ;;; limitations under the License.
18 (let (cd-args cmd-args start-dir)
19 (setq start-dir default-directory)
20 (makunbound 'plugin-name)
21 (makunbound 'PLUGIN-NAME)
22 (makunbound 'plugin-flavor)
23 (setq plugin-name (read-string "Plugin name: "))
25 (read-string "Dispatch type [dual or qs]: "))
26 (setq PLUGIN-NAME (upcase plugin-name))
27 (setq cmd-args (concat "mkdir -p " plugin-name))
28 (shell-command cmd-args)
29 (setq cd-args (concat start-dir "/" plugin-name))
30 (setq default-directory cd-args)
31 (find-file "CMakeLists.txt")
32 (skel-plugin-cmakelists-text-fragment)
33 (find-file (concat plugin-name ".api"))
35 (find-file (concat plugin-name "_all_api_h.h"))
36 (skel-plugin-all-apih)
37 (find-file (concat plugin-name ".h"))
39 (find-file (concat plugin-name ".c"))
41 (find-file (concat plugin-name "_msg_enum.h"))
42 (skel-plugin-msg-enum)
44 (if (string= plugin-flavor "qs")
45 (skel-plugin-qsnode) (skel-plugin-node))
46 (find-file (concat plugin-name "_test.c"))
48 (find-file (concat plugin-name "_periodic.c"))
49 (skel-plugin-periodic)
50 (find-file "setup.pg")