1 ;;; c.srt --- SRecode templates for c-mode
3 ;; Copyright (C) 2007-2010, 2012-2017 Free Software Foundation, Inc.
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 set comment_start "/**"
26 set comment_prefix " *"
28 ;; OVERRIDE THIS in your user or project template file to whatever
29 ;; you use for your project.
34 template empty :time :user :file :c
47 template header_guard :file :blank :c
49 #ifndef {{FILENAME_SYMBOL:upcase}}
50 #define {{FILENAME_SYMBOL:upcase}} 1
54 #endif // {{FILENAME_SYMBOL:upcase}}
60 "Insert an argument list for a function.
61 @todo - Support smart CR in a buffer for not too long lines."
63 ({{#ARGS}}{{TYPE}} {{NAME}}{{#NOTLAST}},{{/NOTLAST}}{{/ARGS}})
68 prompt TYPE "Return Type: "
70 template function :indent :blank
71 "Insert a function declaration."
73 {{?TYPE}} {{?NAME}}{{>:misc:arglist}}
74 {{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}}
81 template function-prototype :indent :blank
82 "Insert a function declaration."
84 {{?TYPE}} {{?NAME}}{{>:misc:arglist}};
88 prompt TYPE "Data Type: "
90 template variable :indent :blank
91 "Insert a variable declaration."
93 {{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}};
97 template variable-prototype :indent :blank
98 "Insert a variable declaration."
105 template include :blank
106 "An include statement."
112 template system-include :blank
113 "An include statement."
119 template label :blank :indent
126 template comment-function :indent :blank
127 "Used to put a nice comment in front of a function.
128 Override this with your own preference to avoid using doxygen"
130 {{>A:declaration:doxygen-function}}
138 template doxygen-function :indent :blank
141 * @name {{NAME}} - {{DOC}}{{^}}{{#ARGS}}
142 * @param {{NAME}} - {{DOC}}{{/ARGS}}
147 template doxygen-variable-same-line
152 template doxygen-section-comment :blank :indent
153 "Insert a comment that separates sections of an Emacs Lisp file."