/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. #if HAVE_CONFIG_H
  25. # include "config.h"
  26. #endif
  27. #include <stdio.h>
  28. #include "src/pdsh/mod.h"
  29. int pdsh_module_priority = DEFAULT_MODULE_PRIORITY;
  30. static int opt_a(opt_t *, int, char *);
  31. static int a_init (void);
  32. /*
  33. * Export pdsh module operations structure
  34. */
  35. struct pdsh_module_operations a_module_ops = {
  36. (ModInitF) a_init,
  37. (ModExitF) NULL,
  38. (ModReadWcollF) NULL,
  39. (ModPostOpF) NULL,
  40. };
  41. /*
  42. * Export rcmd module operations
  43. */
  44. struct pdsh_rcmd_operations a_rcmd_ops = {
  45. (RcmdInitF) NULL,
  46. (RcmdSigF) NULL,
  47. (RcmdF) NULL,
  48. };
  49. /*
  50. * Export module options
  51. */
  52. struct pdsh_module_option a_module_options[] =
  53. { { 'a', NULL, "the a option for Module A", DSH | PCP, (optFunc) opt_a },
  54. PDSH_OPT_TABLE_END
  55. };
  56. /*
  57. * A module info
  58. */
  59. struct pdsh_module pdsh_module_info = {
  60. "misc",
  61. "A",
  62. "Mark Grondona",
  63. "Module test A",
  64. DSH,
  65. &a_module_ops,
  66. &a_rcmd_ops,
  67. &a_module_options[0],
  68. };
  69. static int opt_a(opt_t *pdsh_opt, int opt, char *arg)
  70. {
  71. fprintf (stdout, "A: got option\n");
  72. return 0;
  73. }
  74. static int a_init (void)
  75. {
  76. fprintf (stdout, "A: in init\n");
  77. return 0;
  78. }
  79. /*
  80. * vi: tabstop=4 shiftwidth=4 expandtab
  81. */