Go to the source code of this file.
Functions | |
le_result_t | le_arg_GetProgramName (char *nameBuffPtr, size_t nameBuffSize, size_t *nameLenPtr) |
size_t | le_arg_NumArgs (void) |
le_result_t | le_arg_GetArg (const size_t argIndex, char *argBufferPtr, size_t argBufferSize) |
Legato Command Line Arguments API include file.
Copyright (C) Sierra Wireless, Inc. 2013. All rights reserved. Use of this work is subject to license.
le_result_t le_arg_GetArg | ( | const size_t | argIndex, |
char * | argBufferPtr, | ||
size_t | argBufferSize | ||
) |
Gets the command line argument by index. If argIndex is valid then the argument string is copied into argBufferPtr. At most only argBufferSize - 1 bytes will be copied to argBufferPtr and a terminating NULL character will always be inserted after the last copied byte.
The argument string is assumed to be a UTF-8 string. UTF-8 characters may be more than one byte long. Only copies whole characters, not partial characters. Even if LE_OVERFLOW is returned, argBufferPtr may not be completely filled. See Truncation for more details.
[in] | argIndex | Index of the argument to get. |
[out] | argBufferPtr | Buffer to copy the argument to. |
[in] | argBufferSize | Size of the buffer. |
le_result_t le_arg_GetProgramName | ( | char * | nameBuffPtr, |
size_t | nameBuffSize, | ||
size_t * | nameLenPtr | ||
) |
Gets the program name. The name of the running program is copied into the provided buffer.
The name is assumed to be a UTF-8 string. UTF-8 characters may be more than one byte long. Only copies whole characters, not partial characters. Even if LE_OVERFLOW is returned, argBufferPtr may not be completely filled. See Truncation for more details.
The copied string is always Null-terminated if it is available.
[out] | nameBuffPtr | Buffer to copy the program name to. |
[in] | nameBuffSize | Size of the buffer. |
[out] | nameLenPtr | Length of the name copied to the buffer not including the NULL-terminator. This can be NULL if the name length is not needed. |
size_t le_arg_NumArgs | ( | void | ) |
Gets the number of command line arguments available not including the program name.