remove externs

master
leitner 23 years ago
parent 5589008c77
commit 8c8b5262c5

@ -4,7 +4,7 @@ stralloc_0 \- append \\0 to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_0\fP(stralloc* \fIsa\fR);
int \fBstralloc_0\fP(stralloc* \fIsa\fR);
.SH DESCRIPTION
stralloc_0 appends \\0 to a stralloc.

@ -4,7 +4,7 @@ stralloc_append \- append a character to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_append\fP(stralloc* \fIsa\fR,const char* \fIin\fR);
int \fBstralloc_append\fP(stralloc* \fIsa\fR,const char* \fIin\fR);
.SH DESCRIPTION
stralloc_append appends the byte from *\fIbuf\fR to the
string stored in \fIsa\fR, allocating space if necessary, and

@ -4,7 +4,7 @@ stralloc_cat \- append data to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_cat\fP(stralloc* \fIsato\fR,stralloc* \fIsafrom\fR);
int \fBstralloc_cat\fP(stralloc* \fIsato\fR,stralloc* \fIsafrom\fR);
.SH DESCRIPTION
stralloc_cat appends the string stored in \fIsafrom\fR to \fIsa\fR. It
is the same as

@ -4,7 +4,7 @@ stralloc_catb \- append data to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_catb\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR,unsigned int \fIlen\fR);
int \fBstralloc_catb\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR,unsigned int \fIlen\fR);
.SH DESCRIPTION
stralloc_catb adds the string \fIbuf\fR[0], \fIbuf\fR[1], ... \fIbuf\fR[\fIlen\fR-1] to the
end of the string stored in \fIsa\fR, allocating space if necessary, and

@ -4,7 +4,7 @@ stralloc_catlong0 \- append an integer to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_catlong0\fP(stralloc* \fIsa\fR, unsigned long \fIin\fR, unsigned int \fIn\fR);
int \fBstralloc_catlong0\fP(stralloc* \fIsa\fR, unsigned long \fIin\fR, unsigned int \fIn\fR);
.SH DESCRIPTION
stralloc_catlong0 converts in to a string using \fBfmt_long0\fR and
appends the result to \fIsa\fR, allocating memory as necessary.

@ -4,7 +4,7 @@ stralloc_cats \- append data to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_cats\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR);
int \fBstralloc_cats\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR);
.SH DESCRIPTION
stralloc_cats appends a \\0-terminated string from \fIbuf\fR to the
end of the string stored in \fIsa\fR, allocating space if necessary, and

@ -4,7 +4,7 @@ stralloc_catulong0 \- append an integer to a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_catulong0\fP(stralloc* \fIsa\fR, unsigned long \fIin\fR, unsigned int \fIn\fR);
int \fBstralloc_catulong0\fP(stralloc* \fIsa\fR, unsigned long \fIin\fR, unsigned int \fIn\fR);
.SH DESCRIPTION
stralloc_catulong0 converts in to a string using \fBfmt_ulong0\fR and
appends the result to \fIsa\fR, allocating memory as necessary.

@ -4,7 +4,7 @@ stralloc_chomp \- remove trailing CR, LF or CRLF
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_chomp\fP(stralloc* \fIsa\fR);
int \fBstralloc_chomp\fP(stralloc* \fIsa\fR);
.SH DESCRIPTION
stralloc_chomp removes trailing CRLF, CR or LF from \fIsa\fR and returns
the number of removed characters (i.e. 0, 1 or 2).

@ -4,7 +4,7 @@ stralloc_chop \- remove and return last char
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_chop\fP(stralloc* \fIsa\fR);
int \fBstralloc_chop\fP(stralloc* \fIsa\fR);
.SH DESCRIPTION
stralloc_chop removes the last char in the stralloc (if it is empty,
stralloc_chop does nothing and returns -1). This character is cast to

@ -4,7 +4,7 @@ stralloc_copy \- copy data into a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_copy\fP(stralloc* \fIsato\fR,stralloc* \fIsafrom\fR);
int \fBstralloc_copy\fP(stralloc* \fIsato\fR,stralloc* \fIsafrom\fR);
.SH DESCRIPTION
stralloc_copy copies the string stored in \fIsafrom\fR into \fIsa\fR. It
is the same as

@ -4,7 +4,7 @@ stralloc_copyb \- copy data into a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_copyb\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR,unsigned int \fIlen\fR);
int \fBstralloc_copyb\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR,unsigned int \fIlen\fR);
.SH DESCRIPTION
stralloc_copyb makes sure that \fIsa\fR has enough space allocated to hold
\fIlen\fR bytes. Then it copies the first \fIlen\fR bytes from

@ -4,7 +4,7 @@ stralloc_copys \- copy data into a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_copys\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR);
int \fBstralloc_copys\fP(stralloc* \fIsa\fR,const char* \fIbuf\fR);
.SH DESCRIPTION
stralloc_copys copies a \\0-terminated string from \fIbuf\fR into
\fIsa\fR, without the \\0. It is the same as

@ -4,7 +4,7 @@ stralloc_free \- free storage associated with a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_free\fP(stralloc* \fIsa\fR);
int \fBstralloc_free\fP(stralloc* \fIsa\fR);
.SH DESCRIPTION
stralloc_free returns the storage associated with \fIsa\fR to the
system. Afterwards, the stralloc is unallocated.

@ -0,0 +1,15 @@
.TH stralloc_init 3
.SH NAME
stralloc_init \- initialize a stralloc
.SH SYNTAX
.B #include <stralloc.h>
int \fBstralloc_init\fP(stralloc* \fIsa\fR);
.SH DESCRIPTION
stralloc_init initializes a stralloc to the empty string.
It does not free any memory previously associated with a stralloc. Use
stralloc_free(3) for that. If you just want to empty a stralloc, use
stralloc_copys(sa,"") instead.
.SH "SEE ALSO"
stralloc_free(3), stralloc_copys(3)

@ -0,0 +1,6 @@
#include "stralloc.h"
void stralloc_init(stralloc* sa) {
sa->s=0;
sa->len=sa->a=0;
}

@ -4,7 +4,7 @@ stralloc_ready \- provide space in a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_ready\fP(stralloc* \fIsa\fR,unsigned int \fIlen\fR);
int \fBstralloc_ready\fP(stralloc* \fIsa\fR,unsigned int \fIlen\fR);
.SH DESCRIPTION
stralloc_ready makes sure that \fIsa\fR has enough space allocated to hold
\fIlen\fR bytes: If \fIsa\fR is not allocated, stralloc_ready allocates at least

@ -4,7 +4,7 @@ stralloc_readyplus \- provide space in a stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_readyplus\fP(stralloc* \fIsa\fR,unsigned int \fIlen\fR);
int \fBstralloc_readyplus\fP(stralloc* \fIsa\fR,unsigned int \fIlen\fR);
.SH DESCRIPTION
stralloc_readyplus makes sure that \fIsa\fR has enough space allocated
to hold an additional \fIlen\fR bytes: If \fIsa\fR is not allocated,

@ -4,7 +4,7 @@ stralloc_starts \- check if string is prefix of stralloc
.SH SYNTAX
.B #include <stralloc.h>
extern int \fBstralloc_starts\fP(stralloc* \fIsa\fR,const char* \fIin\fR);
int \fBstralloc_starts\fP(stralloc* \fIsa\fR,const char* \fIin\fR);
.SH DESCRIPTION
stralloc_starts returns 1 if the \\0-terminated string in \fIbuf\fR, without
the terminating \\0, is a prefix of the string stored in \fIsa\fR. Otherwise

Loading…
Cancel
Save