Code

sysdb: Don't pretty-print JSON in non-interactive mode.
[sysdb.git] / src / tools / sysdb / command.h
index 3cf9fcad2025e4dc951fdae3763252f24650dddd..b2e5fa7ccc7363ea6efd51a091c06fb1c3caaac7 100644 (file)
 #define SYSDB_COMMAND_H 1
 
 /*
- * sdb_command_exec:
- * Execute the current command buffer.
+ * sdb_command_print_reply:
+ * Read a reply from the server and print it to the standard output channel.
  *
  * Returns:
  *  - 0 on success
- *  - a negative value else
+ *  - a negative value if no reply could be read from the server
+ *  - a positive value if the server returned an error
  */
 int
+sdb_command_print_reply(sdb_input_t *input);
+
+/*
+ * sdb_command_exec:
+ * Execute the current command buffer and return the query as send to the
+ * server. The query buffer points to dynamically allocated memory which has
+ * to be free'd by the caller.
+ *
+ * The function waits for the server's reply and prints it to the standard
+ * output channel.
+ *
+ * Returns:
+ *  - the query (nul-terminated string) on success
+ *  - NULL else
+ */
+char *
 sdb_command_exec(sdb_input_t *input);
 
+/*
+ * sdb_command_print_server_version:
+ * Query and print the server version.
+ */
+void
+sdb_command_print_server_version(sdb_input_t *input);
+
 #endif /* SYSDB_COMMAND_H */
 
 /* vim: set tw=78 sw=4 ts=4 noexpandtab : */