Statistics
| Branch: | Revision:

streamers / input-dummy.c @ 4bb789ed

History | View | Annotate | Download (655 Bytes)

1 89e893e2 Luca
#include <stdint.h>
2
#include <stdio.h>
3
#include <string.h>
4
5
#include <chunk.h>
6
7
#include "input.h"
8 e64fc7e5 Luca
#include "dbg.h"
9 89e893e2 Luca
10 4bb789ed Luca
static struct input_desc {
11
} dummy_input;
12
13 709f774c Luca
struct input_desc *input_open(const char *fname)
14
{
15 4bb789ed Luca
  return &dummy_input;
16 709f774c Luca
}
17
18
void input_close(struct input_desc *s)
19
{
20
}
21
22
int input_get(struct input_desc *dummy, struct chunk *c)
23 89e893e2 Luca
{
24
  char buff[64];
25
  static int id;
26
27
  sprintf(buff, "Chunk %d", id);
28
  c->id = id;
29
  c->timestamp = 40 * id++;
30
  c->data = strdup(buff);
31
  c->size = strlen(c->data) + 1;
32
  c->attributes_size = 0;
33
  c->attributes = NULL;
34 c851d69c Luca Abeni
35 e64fc7e5 Luca
  dprintf("Generate Chunk[%d] (TS: %llu): %s\n", c->id, c->timestamp, c->data);
36 709f774c Luca
37
  return 1;
38 89e893e2 Luca
}