2 * (C) Copyright 2012 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* This is the protocol used to talk between the client (whenjobs) and
20 * the daemon (whenjobsd). Communication happens over a Unix domain
21 * socket '$HOME/.whenjobs/socket'. The wire protocol is SunRPC.
24 /* Maximum length of a variable name and string value. */
25 const MAX_VARIABLE_NAME_LENGTH = 256;
26 const MAX_VARIABLE_VALUE_LENGTH = 65536;
28 typedef string variable_name<MAX_VARIABLE_NAME_LENGTH>;
29 typedef string string_value<MAX_VARIABLE_VALUE_LENGTH>;
31 typedef variable_name variable_name_list<>;
33 /* Status code (OK or error) returned by most calls. */
39 union status switch (status_code s) {
53 union variable switch (variable_type t) {
59 string i<64>; /* OCaml [big_int], as a string. */
61 double f; /* C 'double' maps to an OCaml 'float' */
64 /* The API of the daemon. */
67 status reload_file (void) = 1;
68 void set_variable (variable_name, variable) = 2;
69 variable get_variable (variable_name) = 3;
70 variable_name_list get_variable_names (void) = 4;