From b85b1f5d35413312c08e7670dd4db67b7e088d91 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 30 Aug 2019 02:42:34 +0000 Subject: glue layer: introduced , implemented associated interfaces. --- include/sys/cmd.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 include/sys/cmd.h (limited to 'include') diff --git a/include/sys/cmd.h b/include/sys/cmd.h new file mode 100644 index 0000000..eb3cbfc --- /dev/null +++ b/include/sys/cmd.h @@ -0,0 +1,45 @@ +#ifndef _SYS_CMD_H +#define _SYS_CMD_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define __NEED_size_t + +#include + +/***************************************************************************/ +/* int (*cmd_args_to_argv)( */ +/* const char * args, */ +/* char * argbuf, size_t buflen, */ +/* char ** argv, size_t nptrs); */ +/* */ +/* arguments: */ +/* args: command to parse */ +/* argbuf: buffer to receive the corresponding sequence of */ +/* null-terminated arguments. */ +/* buflen: size of argbuf, including final null-terminator. */ +/* argv: argument vector to receive pointers to the above */ +/* null-terminated arguments. */ +/* nptrs: number of available argv pointers, including */ +/* including the terminating null pointer. */ +/* */ +/* return value: */ +/* zero upon successful parsing and buffer initialization */ +/* negative value returned upon failure, which is the actual value */ +/* returned by the underlying system call; accordingly, errno */ +/* is _not_ set by the above interface. */ +/* */ +/* implementation: */ +/* the above interface is async-safe, thread-safe, and re-entrant. */ +/* */ +/***************************************************************************/ + +int __cmd_args_to_argv(const char *, char *, size_t, char **, size_t); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3