streamers / input.c @ c851d69c
History | View | Annotate | Download (444 Bytes)
1 |
#include <stdint.h> |
---|---|
2 |
#include <stdio.h> |
3 |
#include <string.h> |
4 |
|
5 |
#include <chunk.h> |
6 |
|
7 |
#include "input.h" |
8 |
|
9 |
void input_get(struct chunk *c) |
10 |
{ |
11 |
char buff[64]; |
12 |
static int id; |
13 |
|
14 |
sprintf(buff, "Chunk %d", id);
|
15 |
c->id = id; |
16 |
c->timestamp = 40 * id++;
|
17 |
c->data = strdup(buff); |
18 |
c->size = strlen(c->data) + 1;
|
19 |
c->attributes_size = 0;
|
20 |
c->attributes = NULL;
|
21 |
|
22 |
fprintf(stderr, "Generate Chunk[%d] (TS: %llu): %s\n", c->id, c->timestamp, c->data);
|
23 |
} |