File: test.c

package info (click to toggle)
crash 5.0.6-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 27,724 kB
  • ctags: 12,102
  • sloc: ansic: 120,698; makefile: 505; yacc: 436; lex: 311
file content (83 lines) | stat: -rwxr-xr-x 1,979 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* test.c - core analysis suite
 *
 * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
 * Copyright (C) 2002, 2003, 2004, 2005 David Anderson
 * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include "defs.h"

/*
 *  Test your stuff here first if you'd like.  If anything's being done
 *  below in this routine, consider it leftover trash...
 */
void
cmd_test(void)
{
	int c;

        while ((c = getopt(argcnt, args, "")) != EOF) {
                switch(c)
                {
                default:
                        argerrs++;
                        break;
		}
	}

        if (argerrs)
                cmd_usage(pc->curcmd, SYNOPSIS);

        while (args[optind]) {
                ;
                optind++;
        }
}

/* 
 *  Scratch routine for testing a feature on a per-task basis by entering
 *  the "foreach test" command.  Like cmd_test(), anything that's being done
 *  below in this routine can be considered trash.
 */     
void
foreach_test(ulong task, ulong flags)
{
 
}

/*
 *  Template for building a new command.
 */
void
cmd_template(void)
{
        int c;

        while ((c = getopt(argcnt, args, "")) != EOF) {
                switch(c)
                {
                default:
                        argerrs++;
                        break;
                }
        }

        if (argerrs)
                cmd_usage(pc->curcmd, SYNOPSIS);

	while (args[optind]) {
		;
		optind++;
	}
}