Revision 59e03a8f

View differences:

include/chunkiser_attrib.h
1
/** @file chunkiser_attrib.h
2
 *
3
 */
4
 
5
#ifndef CHUNKISER_ATTRIB_H
6
#define CHUNKISER_ATTRIB_H
7

  
8
#include<stdint.h>
9

  
10
struct chunk_attributes_chunker {
11
  uint8_t magic;
12
  uint8_t priority;
13
} __attribute__((packed));
14

  
15
inline void chunk_attributes_chunker_init(struct chunk_attributes_chunker *ca);
16

  
17
inline int chunk_attributes_chunker_verify(void *attr, int attr_size);
18

  
19
#endif	/* CHUNKISER_ATTRIB_H */
src/Chunkiser/Makefile
16 16
       output-stream-dummy.o 
17 17

  
18 18
ifdef FFDIR
19
OBJS += input-stream-avf.o input-stream-ipb.o output-stream-avf.o
19
OBJS += input-stream-avf.o input-stream-ipb.o output-stream-avf.o chunkiser_attrib.o
20 20
endif
21 21

  
22 22
all: libchunkiser.a
src/Chunkiser/chunkiser_attrib.c
1
/** @file chunkiser_attrib.c
2
 *
3
 */
4
 
5
#include "chunkiser_attrib.h"
6

  
7
inline void chunk_attributes_chunker_init(struct chunk_attributes_chunker *ca)
8
{
9
  ca->magic = 0x11;
10
}
11

  
12
inline int chunk_attributes_chunker_verify(void *attr, int attr_size)
13
{
14
  struct chunk_attributes_chunker *ca = attr;
15

  
16
  if (attr_size != sizeof(*ca)) {
17
    return 0;
18
  }
19
  if (ca->magic != 0x11) {
20
    return 0;
21
  }
22

  
23
  return 1;
24
}

Also available in: Unified diff