#include <config.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
Go to the source code of this file.
|
long | fsgetn (FILE *p, size_t n) |
|
Ulong | fugetn (FILE *p, size_t n) |
|
long | msgetn (const Uchar *p, size_t n) |
|
Ulong | mugetn (const Uchar *p, size_t n) |
|
char * | read_string (FILE *in, int s, char *buffer, size_t len) |
|
size_t | read_bcpl (FILE *in, char *buffer, size_t maxlen, size_t wanted) |
|
char * | read_alloc_bcpl (FILE *in, size_t maxlen, size_t *size) |
|
void | buff_free (Buffer *buf) |
|
void | buff_init (Buffer *buf) |
|
size_t | buff_add (Buffer *buf, const char *data, size_t len) |
|
char * | buff_gets (Buffer *buf, size_t *length) |
|
size_t buff_add |
( |
Buffer * |
buf, |
|
|
const char * |
data, |
|
|
size_t |
len |
|
) |
| |
void buff_free |
( |
Buffer * |
buf) | |
|
char* buff_gets |
( |
Buffer * |
buf, |
|
|
size_t * |
length |
|
) |
| |
Definition at line 147 of file common.c.
157 len = ptr - buf->
data;
165 if(length) *length = len;
void buff_init |
( |
Buffer * |
buf) | |
|
long fsgetn |
( |
FILE * |
p, |
|
|
size_t |
n |
|
) |
| |
Ulong fugetn |
( |
FILE * |
p, |
|
|
size_t |
n |
|
) |
| |
long msgetn |
( |
const Uchar * |
p, |
|
|
size_t |
n |
|
) |
| |
char* read_alloc_bcpl |
( |
FILE * |
in, |
|
|
size_t |
maxlen, |
|
|
size_t * |
size |
|
) |
| |
Definition at line 98 of file common.c.
104 if(maxlen && i > maxlen)
106 buffer = (
char *)malloc(i + 1);
109 if(fread(buffer, i, 1, in) != 1) {
size_t read_bcpl |
( |
FILE * |
in, |
|
|
char * |
buffer, |
|
|
size_t |
maxlen, |
|
|
size_t |
wanted |
|
) |
| |
Definition at line 83 of file common.c.
88 if(maxlen && i > maxlen)
90 if(fread(buffer, i, 1, in) != 1)
char* read_string |
( |
FILE * |
in, |
|
|
int |
s, |
|
|
char * |
buffer, |
|
|
size_t |
len |
|
) |
| |
Definition at line 67 of file common.c.
73 if((str = buffer) == NULL || n + 1 > len)
75 if(fread(str, 1, n, in) != n) {