Debian Codegraph @

sbuffer.man

raw
1 .TH StringBuffer 3 local
2 .SH NAME
3 StringBuffer \- Handle strings like files
4 .SH SYNOPSIS
5 .nf
6 .B #include "sbuffer.h"
7
8 .B StringBuffer* sbopen()
9
10 .B int sbclose(sb)
11 .B StringBuffer* sb;
12
13 .B int sbputs(string,sb)
14 .B char* string;
15 .B StringBuffer* sb;
16
17 .B int sbputc(c,sb)
18 .B int c;
19 .B StringBuffer* sb;
20
21 .B int sbputchar(c,sb)
22 .B int c;
23 .B StringBuffer* sb;
24
25 .B char* sbflush(sb)
26 .B StringBuffer* sb;
27
28 .B int sbtell(sb)
29 .B StringBuffer* sb;
30
31 .B int sbrewind(sb)
32 .B StringBuffer* sb;
33
34 .B int sbseek(sb,pos)
35 .B StringBuffer* sb;
36 .B int pos;
37 .fi
38 .SH DESCRIPTION
39 The string buffer routines are a means to use strings like files. The
40 routines manage the allocation and freeing of memory internally.
41
42 .B sbopen()
43 returns a new string buffer. Memory is allocated to keep the
44 informations required.
45
46 .B sbclose()
47 frees the memory allocated for a string buffer. Any access to a part of
48 the string buffer is not save after this call.
49
50 .B sbputs()
51 put a string into the string buffer. The string is appended at the end
52 of existing contents. 0 is returned upon success.
53
54 .B sbputc()
55 put a character into the string buffer. The character is appended at the end
56 of existing contents. 0 is returned upon success. This is a function.
57 A macro with the same functionality is provided by
58 .B sbputchar()
59
60 .B sbputchar()
61 put a character into the string buffer. This is a macro with the same
62 functionality as
63 .B sbputc()
64
65 .B sbtell()
66 find the current position of the string buffer for later use with
67 .B sbseek()
68
69 .B sbseek()
70 set the writing position of the string buffer to the given value. If
71 value points beyond the current string size non null is returned.
72
73 .B sbrewind()
74 reset the writing position to the beginning of the string buffer.
75
76 .B sbflush()
77 close the string component of the string buffer and return a pointer
78 to a string containing the contents of the string buffer. The writing
79 position is not changed. Thus following calls to
80 .B sbputs()
81 or
82 .B sbputc()
83 continue adding characters. The string may not be properly terminated
84 after additional writing operations.
85
86 .SH FILES
87 sbuffer.h
88 .SH SEE ALSO
89 .BR fopen (3),
90 .BR fclose (3),
91 .BR fputs (3),
92 .BR fputc (3), ...
93
94 .SH DIAGNOSTICS
95 Usually 0 is returned to indicate success.
96 .SH BUGS
97 Missing a
98 .B printf()
99 variant for string buffer.
100 Horrible documentation.