1 /*
2 Copyright (C) 2015-2021, Dirk Krause
3 SPDX-License-Identifier: BSD-3-Clause
4 */
5 
6 /*
7 	WARNING: This file was generated by the dkct program (see
8 	http://dktools.sourceforge.net/ for details).
9 	Changes you make here will be lost if dkct is run again!
10 	You should modify the original source and run dkct on it.
11 	Original source: dk4membs.ctr
12 */
13 
14 #ifndef DK4MEMBS_H_INCLUDED
15 /** Avoid multiple inclusions. */
16 #define DK4MEMBS_H_INCLUDED 1
17 
18 
19 /**	@file	dk4membs.h	Save buffer data to stream.
20 */
21 
22 #ifndef	DK4CONF_H_INCLUDED
23 #if DK4_BUILDING_DKTOOLS4
24 #include "dk4conf.h"
25 #else
26 #include <dktools-4/dk4conf.h>
27 #endif
28 #endif
29 
30 #ifndef	DK4MEMBUF_H_INCLUDED
31 #if DK4_BUILDING_DKTOOLS4
32 #include <libdk4c/dk4membuf.h>
33 #else
34 #include <dktools-4/dk4membuf.h>
35 #endif
36 #endif
37 
38 #ifndef	DK4STRM_H_INCLUDED
39 #if DK4_BUILDING_DKTOOLS4
40 #include <libdk4c/dk4strm.h>
41 #else
42 #include <dktools-4/dk4strm.h>
43 #endif
44 #endif
45 
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /**	Save buffer contents to file.
52 	@param	strm	Output stream.
53 	@param	mbptr	Buffer containing data to write.
54 	@param	erp	Error report, may be NULL.
55 	@return	1 on success, 0 on error.
56 
57 	Error codes:
58 	- DK4_E_INVALID_ARGUMENTS<br>
59 	  if strm or mbptr is NULL,
60 	- DK4_E_WRITE_FAILED<br>
61 	  if writing one ore multiple bytes to the stream failed,
62 	- DK4_E_FLUSH_FAILED<br>
63 	  if flusing data downwards failed.
64 */
65 int
66 dk4membuf_to_stream(
67 	dk4_stream_t		*strm,
68 	dk4_membuf_t	const	*mbptr,
69 	dk4_er_t		*erp
70 );
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 
77 
78 
79 #endif
80