summaryrefslogtreecommitdiffhomepage
path: root/include/sys/cmd.h
blob: b2825a75688d67eb450fbb40eb62fd4d23a18abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _SYS_CMD_H
#define _SYS_CMD_H

#ifdef __cplusplus
extern "C" {
#endif

#define __NEED_size_t

#include <bits/alltypes.h>

/***************************************************************************/
/* 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;               */
/*   otherwise, -1 shall be returned and errno set to indicate the error.  */
/*                                                                         */
/* 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