diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-20 14:33:22 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-20 14:33:22 +0100 |
commit | d747ff97dcf12ea39f8836b85c608cce9a3720e5 (patch) | |
tree | 7df5f4766aac7af3d07e79af538c798fa6e7a851 /eurephiadm | |
parent | 31148e445a38e6daac0331d3839037dc297cd359 (diff) | |
download | eurephia-d747ff97dcf12ea39f8836b85c608cce9a3720e5.tar.gz eurephia-d747ff97dcf12ea39f8836b85c608cce9a3720e5.tar.xz eurephia-d747ff97dcf12ea39f8836b85c608cce9a3720e5.zip |
Moved field_print_* functions into separate files
Diffstat (limited to 'eurephiadm')
-rw-r--r-- | eurephiadm/CMakeLists.txt | 1 | ||||
-rw-r--r-- | eurephiadm/commands/users.c | 8 | ||||
-rw-r--r-- | eurephiadm/field_print.c | 30 | ||||
-rw-r--r-- | eurephiadm/field_print.h | 29 |
4 files changed, 61 insertions, 7 deletions
diff --git a/eurephiadm/CMakeLists.txt b/eurephiadm/CMakeLists.txt index 3362847..d2ae8fd 100644 --- a/eurephiadm/CMakeLists.txt +++ b/eurephiadm/CMakeLists.txt @@ -5,6 +5,7 @@ SET(efw_ipt_SRC eurephiadm.c argparser.c get_console_input.c + field_print.c client_config.c client_context.c client_session.c diff --git a/eurephiadm/commands/users.c b/eurephiadm/commands/users.c index dd18ecd..21c8486 100644 --- a/eurephiadm/commands/users.c +++ b/eurephiadm/commands/users.c @@ -46,14 +46,8 @@ #include "../argparser.h" #include "../get_console_input.h" +#include "../field_print.h" -inline void field_print_int(char *label, int val) { - printf("%25.25s: %i\n", label, val); -} - -inline void field_print_str(char *label, char *val) { - printf("%25.25s: %s\n", label, (val == NULL ? "-" : val)); -} void display_users_help(int page) { printf("\n%s -- Administer user accounts\n\n", MODULE); diff --git a/eurephiadm/field_print.c b/eurephiadm/field_print.c new file mode 100644 index 0000000..c63528a --- /dev/null +++ b/eurephiadm/field_print.c @@ -0,0 +1,30 @@ +/* field_print.c -- simple functions for printing label/value pairs + * + * GPLv2 - Copyright (C) 2008 David Sommerseth <dazo@users.sourceforge.net> + * + * 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; version 2 + * of the License. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdio.h> + +inline void field_print_int(char *label, int val) { + printf("%25.25s: %i\n", label, val); +} + +inline void field_print_str(char *label, char *val) { + printf("%25.25s: %s\n", label, (val == NULL ? "-" : val)); +} + diff --git a/eurephiadm/field_print.h b/eurephiadm/field_print.h new file mode 100644 index 0000000..a1442c6 --- /dev/null +++ b/eurephiadm/field_print.h @@ -0,0 +1,29 @@ +/* field_print.h -- simple functions for printing label/value pairs + * + * GPLv2 - Copyright (C) 2008 David Sommerseth <dazo@users.sourceforge.net> + * + * 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; version 2 + * of the License. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <stdio.h> + +#ifndef FIELD_PRINT_H +#define FIELD_PRINT_H + +inline void field_print_int(char *label, int val); +inline void field_print_str(char *label, char *val); + +#endif |