PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/test-modules/a.c

https://code.google.com/
C | 94 lines | 43 code | 13 blank | 38 comment | 0 complexity | 6c814ca7fb9834ed461c8eaf4dd37792 MD5 | raw file
 1/*****************************************************************************\
 2 *  $Id$
 3 *****************************************************************************
 4 *  Copyright (C) 2010 Lawrence Livermore National Security, LLC.
 5 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 6 *  UCRL-CODE-2003-005.
 7 *  This file is part of Pdsh, a parallel remote shell program.
 8 *  For details, see <http://www.llnl.gov/linux/pdsh/>.
 9 *
10 *  Pdsh is free software; you can redistribute it and/or modify it under
11 *  the terms of the GNU General Public License as published by the Free
12 *  Software Foundation; either version 2 of the License, or (at your option)
13 *  any later version.
14 *
15 *  Pdsh is distributed in the hope that it will be useful, but WITHOUT ANY
16 *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18 *  details.
19 *
20 *  You should have received a copy of the GNU General Public License along
21 *  with Pdsh; if not, write to the Free Software Foundation, Inc.,
22 *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
23\*****************************************************************************/
24
25#if HAVE_CONFIG_H
26#  include "config.h"
27#endif
28
29#include <stdio.h>
30
31#include "src/pdsh/mod.h"
32
33int pdsh_module_priority = DEFAULT_MODULE_PRIORITY;
34
35static int opt_a(opt_t *, int, char *);
36static int a_init (void);
37
38/*
39 * Export pdsh module operations structure
40 */
41struct pdsh_module_operations a_module_ops = {
42    (ModInitF)       a_init,
43    (ModExitF)       NULL,
44    (ModReadWcollF)  NULL,
45    (ModPostOpF)     NULL,
46};
47
48/*
49 * Export rcmd module operations
50 */
51struct pdsh_rcmd_operations a_rcmd_ops = {
52    (RcmdInitF)  NULL,
53    (RcmdSigF)   NULL,
54    (RcmdF)      NULL,
55};
56
57/*
58 * Export module options
59 */
60struct pdsh_module_option a_module_options[] =
61 { { 'a', NULL, "the a option for Module A", DSH | PCP, (optFunc) opt_a },
62   PDSH_OPT_TABLE_END
63 };
64
65/*
66 * A module info
67 */
68struct pdsh_module pdsh_module_info = {
69  "misc",
70  "A",
71  "Mark Grondona",
72  "Module test A",
73  DSH,
74
75  &a_module_ops,
76  &a_rcmd_ops,
77  &a_module_options[0],
78};
79
80static int opt_a(opt_t *pdsh_opt, int opt, char *arg)
81{
82    fprintf (stdout, "A: got option\n");
83    return 0;
84}
85
86static int a_init (void)
87{
88    fprintf (stdout, "A: in init\n");
89    return 0;
90}
91
92/*
93 * vi: tabstop=4 shiftwidth=4 expandtab
94 */