Statistics
| Branch: | Revision:

streamers / input-dummy.c @ 4bb789ed

History | View | Annotate | Download (655 Bytes)

1
#include <stdint.h>
2
#include <stdio.h>
3
#include <string.h>
4

    
5
#include <chunk.h>
6

    
7
#include "input.h"
8
#include "dbg.h"
9

    
10
static struct input_desc {
11
} dummy_input;
12

    
13
struct input_desc *input_open(const char *fname)
14
{
15
  return &dummy_input;
16
}
17

    
18
void input_close(struct input_desc *s)
19
{
20
}
21

    
22
int input_get(struct input_desc *dummy, struct chunk *c)
23
{
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

    
35
  dprintf("Generate Chunk[%d] (TS: %llu): %s\n", c->id, c->timestamp, c->data);
36

    
37
  return 1;
38
}