| 1 |
#ifndef CARYLL_cff_FDSELECT_H |
| 2 |
#define CARYLL_cff_FDSELECT_H |
| 3 |
|
| 4 |
#include <stdint.h> |
| 5 |
#include <stdio.h> |
| 6 |
#include <stdlib.h> |
| 7 |
#include <string.h> |
| 8 |
#include "support/util.h" |
| 9 |
#include "cff-util.h" |
| 10 |
#include "cff-value.h" |
| 11 |
|
| 12 |
enum { |
| 13 |
cff_FDSELECT_FORMAT0, |
| 14 |
cff_FDSELECT_FORMAT3, |
| 15 |
cff_FDSELECT_UNSPECED, |
| 16 |
}; |
| 17 |
|
| 18 |
typedef struct { |
| 19 |
uint8_t format; |
| 20 |
uint8_t *fds; |
| 21 |
} cff_FDSelectFormat0; |
| 22 |
|
| 23 |
typedef struct { |
| 24 |
uint16_t first; |
| 25 |
uint8_t fd; |
| 26 |
} cff_FDSelectRangeFormat3; |
| 27 |
|
| 28 |
typedef struct { |
| 29 |
uint8_t format; |
| 30 |
uint16_t nranges; |
| 31 |
cff_FDSelectRangeFormat3 *range3; |
| 32 |
uint16_t sentinel; |
| 33 |
} cff_FDSelectFormat3; |
| 34 |
|
| 35 |
typedef struct { |
| 36 |
uint32_t t; |
| 37 |
uint32_t s; |
| 38 |
union { |
| 39 |
cff_FDSelectFormat0 f0; |
| 40 |
cff_FDSelectFormat3 f3; |
| 41 |
}; |
| 42 |
} cff_FDSelect; |
| 43 |
|
| 44 |
void cff_close_FDSelect(cff_FDSelect fds); |
| 45 |
void cff_extract_FDSelect(uint8_t *data, int32_t offset, uint16_t nchars, cff_FDSelect *fdselect); |
| 46 |
caryll_Buffer *cff_build_FDSelect(cff_FDSelect fd); |
| 47 |
|
| 48 |
#endif |