Subversion Repositories HelenOS

Rev

Rev 3397 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3397 Rev 3492
Line 118... Line 118...
118
#define ${defname}_ENTRY_H
118
#define ${defname}_ENTRY_H
119
 
119
 
120
EOF
120
EOF
121
	[ "${CMDTYPE}" = "module" ] && cat << EOF >> ${OUTDIR}/entry.h
121
	[ "${CMDTYPE}" = "module" ] && cat << EOF >> ${OUTDIR}/entry.h
122
/* Entry points for the ${CMDNAME} command */
122
/* Entry points for the ${CMDNAME} command */
123
extern int * ${CMDENTRY}(char **);
123
extern int ${CMDENTRY}(char **);
124
extern void * ${HELPENTRY}(unsigned int);
124
extern void ${HELPENTRY}(unsigned int);
125
 
125
 
126
#endif /* ${defname}_ENTRY_H */
126
#endif /* ${defname}_ENTRY_H */
127
 
127
 
128
EOF
128
EOF
129
	[ "${CMDTYPE}" = "builtin" ] && cat << EOF >> ${OUTDIR}/entry.h
129
	[ "${CMDTYPE}" = "builtin" ] && cat << EOF >> ${OUTDIR}/entry.h
Line 168... Line 168...
168
#include "cmds.h"
168
#include "cmds.h"
169
 
169
 
170
static char *cmdname = "${CMDNAME}";
170
static char *cmdname = "${CMDNAME}";
171
 
171
 
172
/* Dispays help for ${CMDNAME} in various levels */
172
/* Dispays help for ${CMDNAME} in various levels */
173
void * ${HELPENTRY}(unsigned int level)
173
void ${HELPENTRY}(unsigned int level)
174
{
174
{
175
	printf("This is the %s help for '%s'.\n",
175
	printf("This is the %s help for '%s'.\n",
176
		level ? EXT_HELP : SHORT_HELP, cmdname);
176
		level ? EXT_HELP : SHORT_HELP, cmdname);
177
	return CMD_VOID;
177
	return;
178
}
178
}
179
 
179
 
180
EOF
180
EOF
181
	[ "${CMDTYPE}" = "module" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}.c
181
	[ "${CMDTYPE}" = "module" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}.c
182
/* Main entry point for ${CMDNAME}, accepts an array of arguments */
182
/* Main entry point for ${CMDNAME}, accepts an array of arguments */
183
int * ${CMDENTRY}(char **argv)
183
int ${CMDENTRY}(char **argv)
184
EOF
184
EOF
185
	[ "${CMDTYPE}" = "builtin" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}.c
185
	[ "${CMDTYPE}" = "builtin" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}.c
186
/* Main entry point for ${CMDNAME}, accepts an array of arguments and a
186
/* Main entry point for ${CMDNAME}, accepts an array of arguments and a
187
 * pointer to the cliuser_t structure */
187
 * pointer to the cliuser_t structure */
188
int * ${CMDENTRY}(char **argv, cliuser_t *usr)
188
int ${CMDENTRY}(char **argv, cliuser_t *usr)
189
EOF
189
EOF
190
	cat << EOF >> ${OUTDIR}/${CMDNAME}.c
190
	cat << EOF >> ${OUTDIR}/${CMDNAME}.c
191
{
191
{
192
	unsigned int argc;
192
	unsigned int argc;
193
	unsigned int i;
193
	unsigned int i;