Files
ipoim/utils.h
2026-03-24 20:44:22 +03:00

30 lines
693 B
C

#ifndef __UTILS_H
#define __UTILS_H
#include <stdbool.h>
// Print usage text.
void print_usage_text();
// Set CLI argument.
// Parameters:
// - key - argument key (without leading dash)
// - value - argument value as string
// Returns:
// - true on success
// - false on failure
// Remarks:
// - neither key nor value are copied, they are saved as pointers
// - use this function only with data from argv
bool cli_arg_set(const char *key, char *value);
// Get CLI argument.
// Parameters:
// - key - argument key (without leading dash)
// Returns:
// - pointer to the value (not owned by you)
// - NULL on failure
const char *cli_arg_get(const char *key);
#endif