diff options
author | Andreas Schneider <asn@redhat.com> | 2010-02-16 11:23:58 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-02-23 13:48:22 +0100 |
commit | 975a7a3d1b075bcaca820b2431c04734a139062f (patch) | |
tree | eff4efbfa271b726e6cc4124263fb2541d8f342e /libcli | |
parent | 69d5cea2e59162f19460e7ce4b6382fc5fdd6ca0 (diff) | |
download | samba-975a7a3d1b075bcaca820b2431c04734a139062f.tar.gz samba-975a7a3d1b075bcaca820b2431c04734a139062f.tar.bz2 samba-975a7a3d1b075bcaca820b2431c04734a139062f.zip |
tstream: Added a typedef for the function prototype.
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/util/tstream.c | 8 | ||||
-rw-r--r-- | libcli/util/tstream.h | 20 |
2 files changed, 19 insertions, 9 deletions
diff --git a/libcli/util/tstream.c b/libcli/util/tstream.c index 8911c5d541..9c42ca1f4e 100644 --- a/libcli/util/tstream.c +++ b/libcli/util/tstream.c @@ -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; diff --git a/libcli/util/tstream.h b/libcli/util/tstream.h index a945287985..36ae65d9e5 100644 --- a/libcli/util/tstream.h +++ b/libcli/util/tstream.h @@ -21,6 +21,22 @@ #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 * * This function is designed for simple PDUs and as compat layer @@ -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. |