#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <amxrt/amxrt.h>
#include "amxrt_priv.h"
Go to the source code of this file.
◆ _GNU_SOURCE
◆ amxrt_cmd_line_arg()
static void amxrt_cmd_line_arg |
( |
const char |
so, |
|
|
const char * |
lo, |
|
|
const char * |
args, |
|
|
const char * |
description |
|
) |
| |
|
static |
Definition at line 78 of file amxrt_user_output.c.
82 int pre_length = 4 + 2 + 4 + strlen(lo);
84 printf(
" %s-%c%s %s--%s%s",
89 pre_length += 3 + strlen(args);
92 for(
int i = 39 - pre_length; i > 0; i--) {
◆ amxrt_print_config_example()
static void amxrt_print_config_example |
( |
void |
| ) |
|
|
static |
Definition at line 114 of file amxrt_user_output.c.
116 printf(
"%sExample config section:%s\n",
c(
CYAN),
c(
RESET));
119 printf(
" %suris%s = %s\"pcb:/var/run/pcb_sys,ubus:/var/run/ubus/ubus.sock\"%s;\n",
c(
BLUE),
c(
RESET),
c(
CYAN),
c(
RESET));
120 printf(
" %sbackends%s = %s\"/usr/bin/mods/amxb/mod-amxb-pcb.so,/usr/bin/mods/amxb/mod-amxb-ubus.so\"%s;\n",
c(
BLUE),
c(
RESET),
c(
CYAN),
c(
RESET));
◆ amxrt_print_configuration()
void amxrt_print_configuration |
( |
void |
| ) |
|
◆ amxrt_print_error()
void amxrt_print_error |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 174 of file amxrt_user_output.c.
180 vsyslog(LOG_USER | LOG_ERR, fmt, args);
186 vfprintf(stderr, fmt, args);
189 fprintf(stderr,
"%s\n",
c(
RESET));
amxc_var_t * amxrt_get_config(void)
Gets the htable variant containing the configuration options.
◆ amxrt_print_failure()
void amxrt_print_failure |
( |
amxo_parser_t * |
parser, |
|
|
const char * |
string |
|
) |
| |
Definition at line 213 of file amxrt_user_output.c.
215 const char* msg = amxo_parser_get_message(parser);
218 syslog(LOG_USER | LOG_CRIT,
"Failed parsing - %s",
string == NULL ?
"###" :
string);
219 syslog(LOG_USER | LOG_CRIT,
"Reason - %s", msg == NULL ?
"###" : msg);
221 fprintf(stderr,
"%sERROR%s -- Failed parsing %s%s%s\n",
223 c(
CYAN),
string == NULL ?
"###" :
string,
c(
RESET));
225 fprintf(stderr,
"%sREASON%s -- %s%s%s\n",
◆ amxrt_print_help()
void amxrt_print_help |
( |
void |
| ) |
|
Definition at line 160 of file amxrt_user_output.c.
static void amxrt_print_config_example(void)
static void amxrt_print_notes(void)
void amxrt_print_usage(void)
Prints the usage information and all available options to stdout.
◆ amxrt_print_message()
void amxrt_print_message |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Definition at line 193 of file amxrt_user_output.c.
199 vsyslog(LOG_USER | LOG_NOTICE,
"%s", args);
205 vfprintf(stderr, fmt, args);
208 fprintf(stderr,
"%s\n",
c(
RESET));
◆ amxrt_print_notes()
static void amxrt_print_notes |
( |
void |
| ) |
|
|
static |
Definition at line 98 of file amxrt_user_output.c.
101 printf(
" %s*%s Short and long options take the same arguments\n",
c(
YELLOW),
c(
RESET));
103 printf(
" %s*%s At least one odl file or odl string must be specified\n",
c(
YELLOW),
c(
RESET));
105 printf(
" %s*%s Each bus backend can only be specified once\n",
c(
YELLOW),
c(
RESET));
107 printf(
" %s*%s The process daemizes (-D) after the entry points are called, but before\n",
c(
YELLOW),
c(
RESET));
108 printf(
" the data model is registered to the busses.\n");
110 printf(
" %s*%s All command line options can be put in the config section of one\n",
c(
YELLOW),
c(
RESET));
111 printf(
" of the main odls.\n");
◆ get_color()
const char* get_color |
( |
uint32_t |
cc | ) |
|
◆ colors
Initial value:= {
}
#define COLOR_BRIGHT_YELLOW
#define COLOR_BRIGHT_GREEN
#define COLOR_BRIGHT_WHITE
#define COLOR_BRIGHT_CYAN
#define COLOR_BRIGHT_BLUE
Definition at line 68 of file amxrt_user_output.c.