rc_set_service_option -> rc_service_option_set, rc_get_service_option -> rc_service_option_get
This commit is contained in:
parent
52f33e2815
commit
cef0ad3215
@ -441,7 +441,7 @@ rc_service_state_t rc_service_state (const char *service)
|
|||||||
}
|
}
|
||||||
librc_hidden_def(rc_service_state)
|
librc_hidden_def(rc_service_state)
|
||||||
|
|
||||||
char *rc_get_service_option (const char *service, const char *option)
|
char *rc_service_option_get (const char *service, const char *option)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buffer[RC_LINEBUFFER];
|
char buffer[RC_LINEBUFFER];
|
||||||
@ -459,9 +459,9 @@ char *rc_get_service_option (const char *service, const char *option)
|
|||||||
|
|
||||||
return (value);
|
return (value);
|
||||||
}
|
}
|
||||||
librc_hidden_def(rc_get_service_option)
|
librc_hidden_def(rc_service_option_get)
|
||||||
|
|
||||||
bool rc_set_service_option (const char *service, const char *option,
|
bool rc_service_option_set (const char *service, const char *option,
|
||||||
const char *value)
|
const char *value)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -488,7 +488,7 @@ bool rc_set_service_option (const char *service, const char *option,
|
|||||||
free (file);
|
free (file);
|
||||||
return (retval);
|
return (retval);
|
||||||
}
|
}
|
||||||
librc_hidden_def(rc_set_service_option)
|
librc_hidden_def(rc_service_option_set)
|
||||||
|
|
||||||
static pid_t _exec_service (const char *service, const char *arg)
|
static pid_t _exec_service (const char *service, const char *arg)
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,6 @@ librc_hidden_proto(rc_get_config_entry)
|
|||||||
librc_hidden_proto(rc_get_list)
|
librc_hidden_proto(rc_get_list)
|
||||||
librc_hidden_proto(rc_get_runlevel)
|
librc_hidden_proto(rc_get_runlevel)
|
||||||
librc_hidden_proto(rc_get_runlevels)
|
librc_hidden_proto(rc_get_runlevels)
|
||||||
librc_hidden_proto(rc_get_service_option)
|
|
||||||
librc_hidden_proto(rc_is_dir)
|
librc_hidden_proto(rc_is_dir)
|
||||||
librc_hidden_proto(rc_is_exec)
|
librc_hidden_proto(rc_is_exec)
|
||||||
librc_hidden_proto(rc_is_file)
|
librc_hidden_proto(rc_is_file)
|
||||||
@ -88,6 +87,8 @@ librc_hidden_proto(rc_service_delete)
|
|||||||
librc_hidden_proto(rc_service_description)
|
librc_hidden_proto(rc_service_description)
|
||||||
librc_hidden_proto(rc_service_exists)
|
librc_hidden_proto(rc_service_exists)
|
||||||
librc_hidden_proto(rc_service_in_runlevel)
|
librc_hidden_proto(rc_service_in_runlevel)
|
||||||
|
librc_hidden_proto(rc_service_option_get)
|
||||||
|
librc_hidden_proto(rc_service_option_set)
|
||||||
librc_hidden_proto(rc_service_options)
|
librc_hidden_proto(rc_service_options)
|
||||||
librc_hidden_proto(rc_service_mark)
|
librc_hidden_proto(rc_service_mark)
|
||||||
librc_hidden_proto(rc_service_resolve)
|
librc_hidden_proto(rc_service_resolve)
|
||||||
@ -102,7 +103,6 @@ librc_hidden_proto(rc_service_started_daemon)
|
|||||||
librc_hidden_proto(rc_service_state)
|
librc_hidden_proto(rc_service_state)
|
||||||
librc_hidden_proto(rc_set_runlevel)
|
librc_hidden_proto(rc_set_runlevel)
|
||||||
librc_hidden_proto(rc_set_service_daemon)
|
librc_hidden_proto(rc_set_service_daemon)
|
||||||
librc_hidden_proto(rc_set_service_option)
|
|
||||||
librc_hidden_proto(rc_strcatpaths)
|
librc_hidden_proto(rc_strcatpaths)
|
||||||
librc_hidden_proto(rc_strlist_add)
|
librc_hidden_proto(rc_strlist_add)
|
||||||
librc_hidden_proto(rc_strlist_addu)
|
librc_hidden_proto(rc_strlist_addu)
|
||||||
|
4
src/rc.c
4
src/rc.c
@ -362,14 +362,14 @@ static int do_options (int argc, char **argv)
|
|||||||
eerrorx ("%s: no option specified", applet);
|
eerrorx ("%s: no option specified", applet);
|
||||||
|
|
||||||
if (strcmp (applet, "get_options") == 0) {
|
if (strcmp (applet, "get_options") == 0) {
|
||||||
char *option = rc_get_service_option (service, argv[0]);
|
char *option = rc_service_option_get (service, argv[0]);
|
||||||
if (option) {
|
if (option) {
|
||||||
printf ("%s", option);
|
printf ("%s", option);
|
||||||
free (option);
|
free (option);
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
} else if (strcmp (applet, "save_options") == 0)
|
} else if (strcmp (applet, "save_options") == 0)
|
||||||
ok = rc_set_service_option (service, argv[0], argv[1]);
|
ok = rc_service_option_set (service, argv[0], argv[1]);
|
||||||
else
|
else
|
||||||
eerrorx ("%s: unknown applet", applet);
|
eerrorx ("%s: unknown applet", applet);
|
||||||
|
|
||||||
|
4
src/rc.h
4
src/rc.h
@ -135,13 +135,13 @@ bool rc_service_wait (const char *service);
|
|||||||
* @param service to check
|
* @param service to check
|
||||||
* @param option to load
|
* @param option to load
|
||||||
* @return saved value */
|
* @return saved value */
|
||||||
char *rc_get_service_option (const char *service, const char *option);
|
char *rc_service_option_get (const char *service, const char *option);
|
||||||
/*! Save a persistent value for a service
|
/*! Save a persistent value for a service
|
||||||
* @param service to save for
|
* @param service to save for
|
||||||
* @param option to save
|
* @param option to save
|
||||||
* @param value of the option
|
* @param value of the option
|
||||||
* @return true if saved, otherwise false */
|
* @return true if saved, otherwise false */
|
||||||
bool rc_set_service_option (const char *service, const char *option,
|
bool rc_service_option_set (const char *service, const char *option,
|
||||||
const char *value);
|
const char *value);
|
||||||
/*! Save the arguments to find a running daemon
|
/*! Save the arguments to find a running daemon
|
||||||
* @param service to save arguments for
|
* @param service to save arguments for
|
||||||
|
Loading…
x
Reference in New Issue
Block a user