tstream: Added a typedef for the function prototype.
authorAndreas Schneider <asn@redhat.com>
Tue, 16 Feb 2010 10:23:58 +0000 (11:23 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Feb 2010 12:48:22 +0000 (13:48 +0100)
libcli/util/tstream.c
libcli/util/tstream.h

index 8911c5d541ad512242f9e27251f1362bcd75a057..9c42ca1f4e14eafc34e5df832fa7dbb92828a4f8 100644 (file)
@@ -30,9 +30,7 @@ struct tstream_read_pdu_blob_state {
        struct {
                struct tevent_context *ev;
                struct tstream_context *stream;
-               NTSTATUS (*full_fn)(void *private_data,
-                                   DATA_BLOB blob,
-                                   size_t *packet_size);
+               tstream_read_pdu_blob_full_fn_t *full_fn;
                void *full_private;
        } caller;
 
@@ -46,9 +44,7 @@ struct tevent_req *tstream_read_pdu_blob_send(TALLOC_CTX *mem_ctx,
                                struct tevent_context *ev,
                                struct tstream_context *stream,
                                size_t initial_read_size,
-                               NTSTATUS (*full_fn)(void *private_data,
-                                                   DATA_BLOB blob,
-                                                   size_t *packet_size),
+                               tstream_read_pdu_blob_full_fn_t *full_fn,
                                void *full_private)
 {
        struct tevent_req *req;
index a945287985571348654104abf2de5682ba2496d3..36ae65d9e5bd39ee7720cf035fe1271412247154 100644 (file)
 #ifndef _LIBCLI_UTIL_TSTREAM_H_
 #define _LIBCLI_UTIL_TSTREAM_H_
 
+/**
+ * @brief The function which will report the size of the full pdu.
+ *
+ * @param[in]  private_data Some private data which could be used.
+ *
+ * @param[in]  blob     The received blob to get the size from.
+ *
+ * @param[out] packet_size The pointer to store the size of the full pdu.
+ *
+ * @return              NT_STATUS_OK on success, STATUS_MORE_ENTRIES if there
+ *                      are more entries.
+ */
+typedef NTSTATUS tstream_read_pdu_blob_full_fn_t(void *private_data,
+                                                DATA_BLOB blob,
+                                                size_t *packet_size);
+
 /**
  * @brief A helper function to read a full PDU from a stream
  *
@@ -54,9 +70,7 @@ struct tevent_req *tstream_read_pdu_blob_send(TALLOC_CTX *mem_ctx,
                                struct tevent_context *ev,
                                struct tstream_context *stream,
                                size_t inital_read_size,
-                               NTSTATUS (*full_fn)(void *private_data,
-                                                   DATA_BLOB blob,
-                                                   size_t *packet_size),
+                               tstream_read_pdu_blob_full_fn_t *full_fn,
                                void *full_private);
 /**
  * @brief Receive the result of the tstream_read_pdu_blob_send() call.