diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-28 23:12:26 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-28 23:12:26 (EDT) |
commit | a66f3991715861e1ea6bf5d80df410dc4140fd32 (patch) | |
tree | b8f6c67e3f5ae0b0aac2e5c79c1b50d191111003 /src | |
parent | ee4c4798715680d091f1bfcf561ce8d747f5088e (diff) |
s_client: Stub
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.h | 28 | ||||
-rw-r--r-- | src/local.mk | 4 | ||||
-rw-r--r-- | src/main.c | 18 | ||||
-rw-r--r-- | src/s_client.c | 28 |
4 files changed, 76 insertions, 2 deletions
diff --git a/src/commands.h b/src/commands.h new file mode 100644 index 0000000..192209e --- /dev/null +++ b/src/commands.h @@ -0,0 +1,28 @@ +/* + * Command prototypes + * + * Copyright (C) 2019 Patrick McDermott + * + * This file is part of wolfssl-util. + * + * wolfssl-util 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. + * + * wolfssl-util 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 wolfssl-util. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef COMMANDS_H_ +#define COMMANDS_H_ + +int +s_client(int argc, char **argv); + +#endif /* COMMANDS_H_ */ diff --git a/src/local.mk b/src/local.mk index 234479c..6ac396b 100644 --- a/src/local.mk +++ b/src/local.mk @@ -1,2 +1,4 @@ wolfssl_util_SOURCES += \ - %reldir%/main.c + %reldir%/commands.h \ + %reldir%/main.c \ + %reldir%/s_client.c @@ -19,8 +19,24 @@ * along with wolfssl-util. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdio.h> +#include <string.h> + +#include "commands.h" + +static void +usage(FILE *stream, const char *program_name) +{ + fprintf(stream, "Usage: %s s_client [options]\n", program_name); +} + int main(int argc, char **argv) { - return 0; + if (argc < 2 || strcmp(argv[1], "s_client") != 0) { + usage(stderr, argv[0]); + return 1; + } + + return s_client(argc - 2, argv + 2); } diff --git a/src/s_client.c b/src/s_client.c new file mode 100644 index 0000000..0bcb20c --- /dev/null +++ b/src/s_client.c @@ -0,0 +1,28 @@ +/* + * s_client command + * + * Copyright (C) 2019 Patrick McDermott + * + * This file is part of wolfssl-util. + * + * wolfssl-util 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. + * + * wolfssl-util 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 wolfssl-util. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "commands.h" + +int +s_client(int argc, char **argv) +{ + return 0; +} |