summaryrefslogtreecommitdiffstats
path: root/src/include/k5-ipc_stream.h
blob: 71bbaa1e77126afade09ea8aad6ea19ca358e352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * $Header$
 *
 * Copyright 2006 Massachusetts Institute of Technology.
 * All Rights Reserved.
 *
 * Export of this software from the United States of America may
 * require a specific license from the United States Government.
 * It is the responsibility of any person or organization contemplating
 * export to obtain such a license before exporting.
 *
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
 * distribute this software and its documentation for any purpose and
 * without fee is hereby granted, provided that the above copyright
 * notice appear in all copies and that both that copyright notice and
 * this permission notice appear in supporting documentation, and that
 * the name of M.I.T. not be used in advertising or publicity pertaining
 * to distribution of the software without specific, written prior
 * permission.  Furthermore if you modify this software you must label
 * your software as modified software and not distribute it in such a
 * fashion that it might be confused with the original M.I.T. software.
 * M.I.T. makes no representations about the suitability of
 * this software for any purpose.  It is provided "as is" without express
 * or implied warranty.
 */

#ifndef K5_IPC_STREAM_H
#define K5_IPC_STREAM_H

#include "k5-platform.h"

struct k5_ipc_stream_s;
typedef struct k5_ipc_stream_s *k5_ipc_stream;


int32_t k5_ipc_stream_new (k5_ipc_stream *out_stream);

uint32_t k5_ipc_stream_release (k5_ipc_stream io_stream);

uint64_t k5_ipc_stream_size (k5_ipc_stream in_stream);

const char *k5_ipc_stream_data (k5_ipc_stream in_stream);

uint32_t k5_ipc_stream_read (k5_ipc_stream  in_stream, 
                             void          *io_data,
                             uint64_t       in_size);
uint32_t k5_ipc_stream_write (k5_ipc_stream  in_stream, 
                              const void    *in_data,
                              uint64_t       in_size);

uint32_t k5_ipc_stream_read_string (k5_ipc_stream   io_stream, 
                                    char          **out_string);
uint32_t k5_ipc_stream_write_string (k5_ipc_stream  io_stream, 
                                     const char    *in_string);
void k5_ipc_stream_free_string (char *in_string);

uint32_t k5_ipc_stream_read_int32 (k5_ipc_stream  io_stream, 
                                   int32_t       *out_int32);
uint32_t k5_ipc_stream_write_int32 (k5_ipc_stream io_stream, 
                                    int32_t       in_int32);

uint32_t k5_ipc_stream_read_uint32 (k5_ipc_stream  io_stream, 
                                    uint32_t      *out_uint32);
uint32_t k5_ipc_stream_write_uint32 (k5_ipc_stream io_stream, 
                                     uint32_t      in_uint32);

uint32_t k5_ipc_stream_read_int64 (k5_ipc_stream  io_stream, 
                                   int64_t       *out_int64);
uint32_t k5_ipc_stream_write_int64 (k5_ipc_stream io_stream, 
                                    int64_t       in_int64);

uint32_t k5_ipc_stream_read_uint64 (k5_ipc_stream  io_stream, 
                                    uint64_t      *out_uint64);
uint32_t k5_ipc_stream_write_uint64 (k5_ipc_stream io_stream, 
                                     uint64_t      in_uint64);

#endif /* K5_IPC_STREAM_H */