79 lines
1.5 KiB
Plaintext
79 lines
1.5 KiB
Plaintext
; C file template
|
|
;
|
|
;
|
|
; This is the default C file template for the yait project init tool. This file
|
|
; is auto-generated on install and can be modified to your hearts content. An
|
|
; original copy can be found at /etc/yait/
|
|
;
|
|
|
|
@def main
|
|
/*
|
|
* main.c
|
|
*
|
|
* {{PACKAGE}}/{{AUTHOR}} 0.0.1
|
|
*
|
|
* Copying policy
|
|
*
|
|
* {{PACKAGE}} 0.0.1 can be copied and distributed freely for any
|
|
* non-commercial purposes. {{PACKAGE}} 0.0.1 can only be incorporated
|
|
* into commercial software with the permission of the current author.
|
|
*
|
|
* This file contains the main driving routine.
|
|
*
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "version.h"
|
|
#include "estruct.h"
|
|
|
|
void usage(int status)
|
|
{
|
|
printf("Usage: %s REQUIRED POSITIONAL ARGUMENT\n", PROGRAM_NAME);
|
|
printf(" or: %s [options]\n\n", PROGRAM_NAME);
|
|
fputs(" --help display this help and exit\n", stdout);
|
|
fputs(" --version output version information and exit\n", stdout);
|
|
|
|
exit(status);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int carg;
|
|
|
|
if (argc == 2) {
|
|
if (strcmp(argv[1], "--help") == 0) {
|
|
usage(EXIT_FAILURE);
|
|
}
|
|
if (strcmp(argv[1], "--version") == 0) {
|
|
version();
|
|
exit(EXIT_SUCCESS);
|
|
}
|
|
}
|
|
|
|
puts(MESSAGE);
|
|
|
|
return 0;
|
|
}
|
|
@end
|
|
|
|
@def header
|
|
#ifndef {{MODULE}}_H_
|
|
#define {{MODULE}}_H_
|
|
|
|
#endif /* {{MODULE}}_H_ */
|
|
@end
|
|
|
|
@def impl
|
|
/* {{MODULE}}.c
|
|
*
|
|
* The routines in this file handle **things**
|
|
*
|
|
* written by {{AUTHOR}}
|
|
*/
|
|
|
|
#include "{{MODULE}}.h"
|
|
@end
|