declare smobs in alloc.c
[bpt/emacs.git] / etc / srecode / c.srt
CommitLineData
62a81506
CY
1;;; c.srt --- SRecode templates for c-mode
2
ba318903 3;; Copyright (C) 2007-2010, 2012-2014 Free Software Foundation, Inc.
62a81506
CY
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
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.
13
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.
18
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/>.
21
22set mode "c-mode"
23
24set comment_start "/**"
25set comment_end " */"
26set comment_prefix " *"
27
28;; OVERRIDE THIS in your user or project template file to whatever
29;; you use for your project.
30set HEADEREXT ".h"
31
32context file
33
34template empty :time :user :file :c
35----
36{{>:filecomment}}
37
38{{#NOTHEADER}}
39
40{{^}}
41{{/NOTHEADER}}
42{{#HEADER}}
43{{>:header_guard}}
44{{/HEADER}}
45----
46
890f7890 47template header_guard :file :blank :c
62a81506 48----
e8cc7880
DE
49#ifndef {{FILENAME_SYMBOL:upcase}}
50#define {{FILENAME_SYMBOL:upcase}} 1
62a81506
CY
51
52{{^}}
53
e8cc7880 54#endif // {{FILENAME_SYMBOL:upcase}}
62a81506
CY
55----
56
57context misc
58
59template arglist
60"Insert an argument list for a function.
61@todo - Support smart CR in a buffer for not too long lines."
62----
63({{#ARGS}}{{TYPE}} {{NAME}}{{#NOTLAST}},{{/NOTLAST}}{{/ARGS}})
64----
65
66context declaration
67
68prompt TYPE "Return Type: "
69
70template function :indent :blank
71"Insert a function declaration."
72----
73{{?TYPE}} {{?NAME}}{{>:misc:arglist}}
74{{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}}
75{
76{{^}}
77}
78----
79bind "f"
80
81template function-prototype :indent :blank
82"Insert a function declaration."
83----
84{{?TYPE}} {{?NAME}}{{>:misc:arglist}};
85----
86
87
88prompt TYPE "Data Type: "
89
90template variable :indent :blank
91"Insert a variable declaration."
92----
93{{?TYPE}} {{?NAME}}{{#HAVEDEFAULT}} = {{DEFAULT}}{{/HAVEDEFAULT}};
94----
95bind "v"
96
97template variable-prototype :indent :blank
98"Insert a variable declaration."
99----
100{{?TYPE}} {{?NAME}};
101----
102bind "v"
103
104
105template include :blank
106"An include statement."
107----
108#include "{{?NAME}}"
109----
110bind "i"
111
112template system-include :blank
113"An include statement."
114----
115#include <{{?NAME}}>
116----
117bind "i"
118
119template label :blank :indent
120----
121 {{?NAME}}:
122----
123
124context declaration
125
126template comment-function :indent :blank
127"Used to put a nice comment in front of a function.
128Override this with your own preference to avoid using doxygen"
129----
130{{>A:declaration:doxygen-function}}
131----
132
133;;; DOXYGEN FEATURES
134;;
135;;
136context declaration
137
138template doxygen-function :indent :blank
139----
140/**
141 * @name {{NAME}} - {{DOC}}{{^}}{{#ARGS}}
142 * @param {{NAME}} - {{DOC}}{{/ARGS}}
143 * @return {{TYPE}}
144 */
145----
146
147template doxygen-variable-same-line
148----
149/**< {{DOC}}{{^}} */
150----
151
152template doxygen-section-comment :blank :indent
153"Insert a comment that separates sections of an Emacs Lisp file."
154----
155\f
156/** {{?TITLE}}
157 *
158 * {{^}}
159 */
160
161----
162
163
164;; end