]> git.ipfire.org Git - thirdparty/git.git/blobdiff - simple-ipc.h
reftable/reader: iterate to next block in place
[thirdparty/git.git] / simple-ipc.h
index 2c48a5ee004732e7c33739befcf6efe4db2d4e27..a849d9f8411fdbb9855fbf7a502776244914a05c 100644 (file)
@@ -5,13 +5,6 @@
  * See Documentation/technical/api-simple-ipc.txt
  */
 
-#ifdef SUPPORTS_SIMPLE_IPC
-#include "pkt-line.h"
-
-/*
- * Simple IPC Client Side API.
- */
-
 enum ipc_active_state {
        /*
         * The pipe/socket exists and the daemon is waiting for connections.
@@ -43,6 +36,13 @@ enum ipc_active_state {
        IPC_STATE__OTHER_ERROR,
 };
 
+#ifdef SUPPORTS_SIMPLE_IPC
+#include "pkt-line.h"
+
+/*
+ * Simple IPC Client Side API.
+ */
+
 struct ipc_client_connect_options {
        /*
         * Spin under timeout if the server is running but can't
@@ -65,11 +65,7 @@ struct ipc_client_connect_options {
        unsigned int uds_disallow_chdir:1;
 };
 
-#define IPC_CLIENT_CONNECT_OPTIONS_INIT { \
-       .wait_if_busy = 0, \
-       .wait_if_not_found = 0, \
-       .uds_disallow_chdir = 0, \
-}
+#define IPC_CLIENT_CONNECT_OPTIONS_INIT { 0 }
 
 /*
  * Determine if a server is listening on this named pipe or socket using
@@ -107,7 +103,8 @@ void ipc_client_close_connection(struct ipc_client_connection *connection);
  */
 int ipc_client_send_command_to_connection(
        struct ipc_client_connection *connection,
-       const char *message, struct strbuf *answer);
+       const char *message, size_t message_len,
+       struct strbuf *answer);
 
 /*
  * Used by the client to synchronously connect and send and receive a
@@ -119,7 +116,8 @@ int ipc_client_send_command_to_connection(
  */
 int ipc_client_send_command(const char *path,
                            const struct ipc_client_connect_options *options,
-                           const char *message, struct strbuf *answer);
+                           const char *message, size_t message_len,
+                           struct strbuf *answer);
 
 /*
  * Simple IPC Server Side API.
@@ -144,6 +142,7 @@ typedef int (ipc_server_reply_cb)(struct ipc_server_reply_data *,
  */
 typedef int (ipc_server_application_cb)(void *application_data,
                                        const char *request,
+                                       size_t request_len,
                                        ipc_server_reply_cb *reply_cb,
                                        struct ipc_server_reply_data *reply_data);