aboutsummaryrefslogtreecommitdiff
path: root/src/pies.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-20 22:33:00 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-02-20 22:42:46 +0200
commit46130027d8e6e91951226456174e6ad471ddc50f (patch)
treef88ce6edd9b078b5f331497bc452525f3c4c9c94 /src/pies.h
parente6902abfddb4d7b16dc9a4231a3781f354a08cd5 (diff)
downloadpies-46130027d8e6e91951226456174e6ad471ddc50f.tar.gz
pies-46130027d8e6e91951226456174e6ad471ddc50f.tar.bz2
Improve control interface
This commit implements the following operations on the new /conf endpoints: GET /conf/runtime - List configuration PUT /conf/runtime - Reload configuration POST /conf/runtime - Post new configuration GET /conf/files - List configuration files DELETE /conf/files - Delete some or all configuration files from the list POST /conf/files - Install new configuration file Piesctl supports the following new commands: piesctl config reload piesctl config file clear piesctl config file add SYNTAX NAME piesctl config file del[ete] NAME [NAME...] piesctl config file list * src/ctl.c (res_conf): New function. (restab): New endpoint /conf * src/pies.c (config_file_add): Set free_entry. (config_file_remove, config_file_remove_all) (config_file_list_serialize): New functions. (pies_config_parse): Bail out if tree processing fails. (pies_reload): Remove unused function. (main): Redo ACTION_RELOAD handling. Handle ACTION_COMMIT. * src/pies.h (ACTION_COMMIT): New action. (config_file_remove, config_file_remove_all) (config_file_list_serialize) (pies_read_config, progman_gc): New protos. * src/piesctl.c (cmdline_parser_state): New struct (next_token, peek_token): Take ptr to cmdline_parser_state as argument. (parse_error, require_token, assert_eol) (piesctl_format): New functions. (parse_condition_to_uri): Rewrite using piesctl_format. New subcommand: config. Improve help output.
Diffstat (limited to 'src/pies.h')
-rw-r--r--src/pies.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pies.h b/src/pies.h
index b61e11b..5154317 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -271,7 +271,8 @@ enum pies_action {
271 ACTION_RELOAD, 271 ACTION_RELOAD,
272 ACTION_CTRLALTDEL, 272 ACTION_CTRLALTDEL,
273 ACTION_KBREQUEST, 273 ACTION_KBREQUEST,
274 ACTION_POWER 274 ACTION_POWER,
275 ACTION_COMMIT
275}; 276};
276 277
277extern char *instance; 278extern char *instance;
@@ -309,6 +310,10 @@ struct config_syntax;
309struct config_syntax *str_to_config_syntax (const char *str); 310struct config_syntax *str_to_config_syntax (const char *str);
310void config_file_add (struct config_syntax *syntax, const char *name); 311void config_file_add (struct config_syntax *syntax, const char *name);
311void config_file_add_type (enum config_syntax_type syntax, const char *name); 312void config_file_add_type (enum config_syntax_type syntax, const char *name);
313void config_file_list_serialize (struct json_value *ar);
314
315int config_file_remove (const char *name);
316void config_file_remove_all (void);
312 317
313void free_redirector (struct redirector *rp); 318void free_redirector (struct redirector *rp);
314 319
@@ -322,9 +327,12 @@ void free_action (struct action *act);
322 327
323void pies_schedule_children (int op); 328void pies_schedule_children (int op);
324 329
330int pies_read_config (void);
331
325void register_prog (struct component *comp); 332void register_prog (struct component *comp);
326int progman_waiting_p (void); 333int progman_waiting_p (void);
327void progman_start (void); 334void progman_start (void);
335void progman_gc (void);
328void progman_wake_sleeping (int); 336void progman_wake_sleeping (int);
329void progman_stop (void); 337void progman_stop (void);
330void progman_cleanup (int expect_term); 338void progman_cleanup (int expect_term);

Return to:

Send suggestions and report system problems to the System administrator.