Source
int zbx_user_macro_parse(const char *macro, int *macro_r, int *context_l, int *context_r, unsigned char *context_op)
/*
** Zabbix
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
static const char copyright_message[] =
"Copyright (C) 2024 Zabbix SIA\n"
"License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>.\n"
"This is free software: you are free to change and redistribute it according to\n"
"the license. There is NO WARRANTY, to the extent permitted by law.";
static const char help_message_footer[] =
"Report bugs to: <https://support.zabbix.com>\n"
"Zabbix home page: <http://www.zabbix.com>\n"
"Documentation: <https://www.zabbix.com/documentation>";
/******************************************************************************
* *
* Purpose: print version and compilation time of application on stdout *
* by application request with parameter '-V' *
* *
* Comments: title_message - is global variable which must be initialized *
* in each zabbix application *
* *
******************************************************************************/
void version(void)
{
printf("%s (Zabbix) %s\n", title_message, ZABBIX_VERSION);
printf("Revision %s %s, compilation time: %s %s\n\n", ZABBIX_REVISION, ZABBIX_REVDATE, __DATE__, __TIME__);
puts(copyright_message);
printf("\n");
zbx_tls_version();
}
/******************************************************************************
* *
* Purpose: print application parameters on stdout with layout suitable for *
* 80-column terminal *
* *
* Comments: usage_message - is global variable which must be initialized *
* in each zabbix application *
* *
******************************************************************************/
void usage(void)
{
/* left margin for the first line */
/* left margin for subsequent lines */
const char **p = usage_message;
if (NULL != *p)
printf("usage:\n");
while (NULL != *p)
{
size_t pos;
printf("%s%s", ZBX_SPACE1, progname);
pos = ZBX_CONST_STRLEN(ZBX_SPACE1) + strlen(progname);
while (NULL != *p)
{
size_t len;
len = strlen(*p);