PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/bundles/plugins-trunk/XInsert/xml/c.insert.xml

#
XML | 187 lines | 177 code | 10 blank | 0 comment | 0 complexity | 9092aa7376201ad9d4c7b4b90be36c52 MD5 | raw file
  1<?xml version="1.0" encoding="ISO-8859-1"?>

  2  <menu name="C">

  3    <item name="GPL">/*

  4 * $filename - Short Description

  5 * Copyright (C) $date $author

  6 * $email

  7 * $webaddress

  8 *

  9 * This program is free software; you can redistribute it and/or

 10 * modify it under the terms of the GNU General Public License

 11 * as published by the Free Software Foundation; either version 2

 12 * of the License, or any later version.

 13 *

 14 * This program 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 this program; if not, write to the Free Software

 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

 22 */ </item>

 23    <item name="function" type="xinsert_script">{%functionname "Function Name:"}{%returns "returns:" "void" ?}

 24

 25{$=returns} {$=functionname}()

 26{

 27	/* {$=functionname} main comment */

 28  |

 29}

 30</item>

 31    <item name="main">int main(char ** argv, int argc)\n{\n\t|\n}\n</item>

 32		

 33    <menu name="Documentation">

 34      <item name="author" type="xinsert_script">/* Author      : {$?author} */</item>

 35      <item name="email" type="xinsert_script">/* Email       : {$?email} */</item>

 36      <item name="web" type="xinsert_script">/* Web address : {$?webaddress} */</item>

 37      <item name="description">/* Description : | */</item>

 38      <item name="version">/* Version     : | */</item>

 39      <item name="see also">/* See also    : | */</item>

 40      <item name="written" type="xinsert_script">/* Written     : {$=date} */</item>

 41      <item name="modified" type="xinsert_script">/* Modified    : On - {$=date}, By - {$?author}, Details - | */</item>

 42      <item name="deprecated" type="xinsert_script">/* Deprecated  : {$=date} */</item>

 43      <item name="tested" type="xinsert_script">/* Tested : {$=date} */</item>

 44      <item name="param">/* Parameter - | */</item>

 45      <item name="returns">/* Returns - | */</item>

 46      <item name="pre-condition">/* PRE | */</item>

 47      <item name="post-condition">/* POST | */</item>

 48      <item name="error conditions">/* Error conditions - | */</item>

 49    </menu>

 50

 51    <menu name="Selection">

 52      <item name="{ }">{\n|\n}</item>

 53      <item name="if">if (|)\n\t</item>

 54      <item name="if..else">if (|)\n{\n\t\n}\nelse\n{\n\t\n}</item>

 55      <item name="switch">switch()\n{\n\tcase:\n\t\t|\n\t\tbreak;\n\tdefault:\n}</item>

 56      <item name="case">\tcase:\n\t\t|\n\t\tbreak;\n</item>

 57    </menu>

 58

 59    <menu name="Iteration">

 60      <item name="do">do\n{\n\t|\n} while()</item>

 61      <item name="for">for( ; ; )\n{\n\t|\n}</item>

 62      <item name="while">while()\n{\n\t|\n}</item>

 63    </menu>

 64

 65    <menu name="Includes">

 66      <item name="assert">#include &lt;assert.h>\n</item>

 67      <item name="ctype">#include &lt;ctype.h>\n</item>

 68      <item name="math">#include &lt;math.h>\n</item>

 69			<item name="stdio">#include &lt;stdio.h>\n</item>

 70      <item name="stdlib">#include &lt;stdlib.h>\n</item>

 71      <item name="string">#include &lt;string.h>\n</item>

 72      <item name="time">#include &lt;time.h>\n</item>

 73    </menu>

 74

 75    <menu name="Library Functions">

 76      <item name="ascii to float">atof(|)</item>

 77      <item name="ascii to int">atoi(|)</item>

 78      <item name="ascii to long">atol(|)</item>

 79      <item name="assert">assert(|);</item>

 80      <item name="calloc" type="xinsert_script">{%type "type:"}{%size "items:"}({$=type} *) calloc({$=size}, sizeof({$=type}))</item>

 81      <item name="fclose" type="xinsert_script">{%fd "file descriptor:"}fclose({$=fd});</item>

 82      <item name="fopen" type="xinsert_script">{%fd "file descriptor:"}{%fn "file name:"}{%mode "mode:" "w" ?}{$=fd} = fopen({$=fn}, "{$=mode}");</item>

 83      <item name="fprintf" type="xinsert_script">{%file "file descriptor:"}fprintf({$=file}, "|" , );</item>

 84      <item name="free">free(|);</item>

 85      <item name="fscanf" type="xinsert_script">{%file "file descriptor:"}fscanf({$=file}, "|", );</item>

 86      <item name="malloc" type="xinsert_script">{%type "type:"}({$=type} *) malloc(sizeof({$=type}))</item>

 87      <item name="max" type="xinsert_script">{%one "Compare:"}{%two "with:"}max({$=one}, {$=two})</item>

 88      <item name="min" type="xinsert_script">{%one "Compare:"}{%two "with:"}min({$=one}, {$=two})</item>

 89      <item name="memset" type="xinsert_script">{%string "String variable:"}{%char "Char value:" "0" ?}{%size "length"}memset({$=string}, '{$=char}', {$=size});</item>

 90      <item name="printf">printf("|", );</item>

 91      <item name="scanf">scanf("|", );</item>

 92      <item name="sscanf" type="xinsert_script">{%string "string:"}sscanf({$=string}, "|" , );</item>

 93      <item name="strcmp" type="xinsert_script">{%one "Compare:"}{%two "with:"}(strcmp({$=one}, {$=two}) == 0)</item>

 94      <item name="strncmp" type="xinsert_script">{%one "Compare:"}{%two "with:"}{%chars "characters:"}(strncmp({$=one}, {$=two}, {$=chars}) == 0)</item>

 95      <item name="strcpy" type="xinsert_script">{%from "From:"}{%into "into:"}strcpy({$=into}, {%=$from})</item>

 96      <item name="strncpy" type="xinsert_script">{%from "From:"}{%into "into:"}{%chars "characters:"}strncpy({$=into}, {$=from}, {$=chars})</item>

 97      <item name="strlen">strlen(|)</item>

 98      <item name="tolower">tolower(|)</item>

 99      <item name="toupper">toupper(|)</item>

100    </menu>

101

102    <menu name="Macros">

103      <item name="#include file">#include "|"</item>

104      <item name="#include library">#include &lt;|></item>

105      <item name="#ifdef">#ifdef _|</item>

106      <item name="#ifndef">#ifndef _|</item>

107      <item name="#else">#else\n</item>

108      <item name="#endif">#endif /* _| */</item>

109      <item name="#ifdef..#endif">#ifdef _|\n\n#endif</item>

110      <item name="#ifdef..#else..#endif">#ifdef _|\n\n#else\n\n#endif /* */\n</item>

111      <item name="#define">#define |</item>

112      <item name="#define macro">#define | ( )\n</item>

113      <item name="#define macro()">#define |( ) ( )\n</item>

114      <item name="boolean type">#ifndef _BOOL\n#define _BOOL\ntypedef int BOOL\n#define TRUE 0\n#define FALSE 0\n#endif /* _BOOL */\n</item>

115    </menu>

116

117    <menu name="Types/Values">

118      <item name="BOOL">BOOL</item>

119      <item name="char">char</item>

120      <item name="char[]">char |[]</item>

121      <item name="const">const </item>

122      <item name="double">double</item>

123      <item name="double[]">double |[]</item>

124      <item name="FALSE">FALSE</item>

125      <item name="FILE">FILE *</item>

126      <item name="float">float</item>

127      <item name="float[]">float |[]</item>

128      <item name="int">int</item>

129      <item name="int[]">int |[]</item>

130      <item name="long">long</item>

131      <item name="NULL">NULL</item>

132      <item name="short">short</item>

133      <item name="TRUE">TRUE</item>

134      <item name="unsigned int">unsigned int</item>

135      <item name="unsigned long">unsigned long</item>

136      <item name="unsigned short">unsigned short</item>

137      <item name="void">void</item>

138    </menu>

139

140    <menu name="Type Casts">

141      <menu name="Closed">

142        <item name="(char)">((char) |)</item>

143        <item name="(char *)">((char *) |)</item>

144        <item name="(double)">((double) |)</item>

145        <item name="(double *)">((double *) |)</item>

146        <item name="(float)">((float) |)</item>

147        <item name="(float*)">((float *) |)</item>

148        <item name="(int)">((int) |)</item>

149        <item name="(int *)">((int *) |)</item>

150        <item name="(long)">((long) |)</item>

151        <item name="(long *)">((long *) |)</item>

152        <item name="(short)">((short) |)</item>

153        <item name="(short *)">((short *) |)</item>

154        <item name="(unsigned int)">((unsigned int) |)</item>

155        <item name="(unsigned int *)">((unsigned int *) |)</item>

156        <item name="(unsigned long)">((unsigned long) |)</item>

157        <item name="(unsigned long *)">((unsigned long *) |)</item>

158        <item name="(unsigned short)">((unsigned short) |)</item>

159        <item name="(unsigned short *)">((unsigned short *) |)</item>

160        <item name="(void)">((void) |)</item>

161        <item name="(void *)">((void *) |)</item>

162      </menu>

163      <menu name="Open">

164        <item name="(char)">(char)</item>

165        <item name="(char *)">(char *)</item>

166        <item name="(double)">(double)</item>

167        <item name="(double *)">(double *)</item>

168        <item name="(float)">(float)</item>

169        <item name="(float*)">(float *)</item>

170        <item name="(int)">(int)</item>

171        <item name="(int *)">(int *)</item>

172        <item name="(long)">(long)</item>

173        <item name="(long *)">(long *)</item>

174        <item name="(short)">(short)</item>

175        <item name="(short *)">(short *)</item>

176        <item name="(unsigned int)">(unsigned int)</item>

177        <item name="(unsigned int *)">(unsigned int *)</item>

178        <item name="(unsigned long)">(unsigned long)</item>

179        <item name="(unsigned long *)">(unsigned long *)</item>

180        <item name="(unsigned short)">(unsigned short)</item>

181        <item name="(unsigned short *)">(unsigned short *)</item>

182        <item name="(void)">(void)</item>

183        <item name="(void *)">(void *)</item>

184      </menu>

185    </menu>

186

187</menu>