~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/stringbuf.h

Tags: upstream-0.60
ImportĀ upstreamĀ versionĀ 0.60

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        stringbuf: mimicking a bit of C++ to more safely handle strings
 
3
 
 
4
        copyright 2006 by the mpg123 project - free software under the terms of the LGPL 2.1
 
5
        see COPYING and AUTHORS files in distribution or http://mpg123.de
 
6
        initially written by Thomas Orgis
 
7
*/
 
8
#ifndef MPG123_STRINGBUF_H
 
9
#define MPG123_STRINGBUF_H
 
10
 
 
11
#include <string.h>
 
12
 
 
13
struct stringbuf
 
14
{
 
15
        char* p;
 
16
        size_t size;
 
17
        size_t fill;
 
18
};
 
19
 
 
20
void init_stringbuf(struct stringbuf* sb);
 
21
void free_stringbuf(struct stringbuf* sb);
 
22
/* returning 0 on error, 1 on success */
 
23
int resize_stringbuf(struct stringbuf* sb, size_t new);
 
24
int copy_stringbuf(struct stringbuf* from, struct stringbuf* to);
 
25
int add_to_stringbuf(struct stringbuf* sb, char* stuff);
 
26
 
 
27
#endif