|
Guardtime Parameter and Task Handling SDK libparamset
|
#include <stddef.h>#include <stdarg.h>Go to the source code of this file.
Functions | |
| size_t | PST_snprintf (char *buf, size_t n, const char *format,...) |
| char * | PST_strncpy (char *destination, const char *source, size_t n) |
| size_t | PST_snhiprintf (char *buf, size_t buf_len, int indent, int nxtLnIndnt, int headerLen, int rowLen, const char *paramName, const char delimiter, const char *desc,...) |
| size_t PST_snhiprintf | ( | char * | buf, |
| size_t | buf_len, | ||
| int | indent, | ||
| int | nxtLnIndnt, | ||
| int | headerLen, | ||
| int | rowLen, | ||
| const char * | paramName, | ||
| const char | delimiter, | ||
| const char * | desc, | ||
| ... | |||
| ) |
Similar to the PST_snprintf but is used to print text for command-line help. Formatter can:
desc) with maximum length (including indention) of rowLen.desc) with indention of indent. See Example 1.desc) where next line has extra indention of nxtLnIndnt. See Example 2.headerLen. It is composed of paramName and delimiter (including indent). If real header is larger than headerLen, it is printed without delimiter on the first line. In that case delimiter is printed on the next row followed by description (desc). See Example 3 and Example 4.Usage and examples:
| buf | Pointer to buffer. |
| buf_len | The size of the buffer. |
| indent | The size of regular indention. Can be 0. |
| nxtLnIndnt | The amount of extra indention beginning from the next line. Can be 0. |
| headerLen | The size of the header. Can be 0. |
| rowLen | The overall size of the line. |
| paramName | Parameter name used to compose header. |
| delimiter | Delimiter character used for delimiter that separates parameter name from description. |
| desc | Format string, parameter description. |
| ... | Extra parameters for formatting. |
NULL character. On error 0 is returned. | size_t PST_snprintf | ( | char * | buf, |
| size_t | n, | ||
| const char * | format, | ||
| ... | |||
| ) |
Platform independent version of snprintf.
| buf | Pointer to buffer. |
| n | Maximum number of bytes to be written into buffer. Includes terminating NULL character. |
| format | Format string. |
| ... | Extra parameters for formatting. |
NULL character. On error 0 is returned. | char* PST_strncpy | ( | char * | destination, |
| const char * | source, | ||
| size_t | n | ||
| ) |
Platform independent version of strncpy that guarantees NULL terminated destination. To copy N characters from source to destination n and size of destination must be N + 1.
| destination | Pointer to destination. |
| source | Pointer to source. |
| n | Maximum number of characters to be copied including terminating NULL. |
NULL is returned.
1.8.13