Beispiel #1
0
line_t *
lineLink(line_t *line)
{
	assert(line != NULL);
	if((unsigned char)line[0] == (unsigned char)255) {
		cli_dbgmsg("lineLink: linkcount too large (%s)\n", lineGetData(line));
		return lineCreate(lineGetData(line));
	}
	line[0]++;
	/*printf("%d:\n\t'%s'\n", (int)line[0], &line[1]);*/
	return line;
}
Beispiel #2
0
static void
getLength(const line_t *line, void *arg)
{
    size_t *length = (size_t *)arg;

    if(line)
        *length += strlen(lineGetData(line)) + 1;
    else
        (*length)++;
}
Beispiel #3
0
static void
addToFileblob(const line_t *line, void *arg)
{
    fileblob *fb = (fileblob *)arg;

    if(line) {
        const char *l = lineGetData(line);

        fileblobAddData(fb, (const unsigned char *)l, strlen(l));
    }
    fileblobAddData(fb, (const unsigned char *)"\n", 1);
}
Beispiel #4
0
static void
addToBlob(const line_t *line, void *arg)
{
    blob *b = (blob *)arg;

    if(line) {
        const char *l = lineGetData(line);

        blobAddData(b, (const unsigned char *)l, strlen(l));
    }
    blobAddData(b, (const unsigned char *)"\n", 1);
}