actf 0.0.1
An acute CTF reader
Loading...
Searching...
No Matches
/home/adwe/code/actf/types.h File Reference

Basic types used by ACTF. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  actf_uuid
 A UUID. More...
struct  actf_it
 An iterator. More...

Macros

#define ACTF_OK   0
 OK.
#define ACTF_ERROR   -1
 Error.
#define ACTF_INTERNAL   -2
 Internal logic error.
#define ACTF_OOM   -3
 Failed to allocate memory.
#define ACTF_NOT_FOUND   -4
 The queried property does not exist.
#define ACTF_JSON_PARSE_ERROR   -5
 An error occurred when parsing the JSON data.
#define ACTF_JSON_ERROR   -6
 Incompatible JSON content.
#define ACTF_JSON_WRONG_TYPE   -7
 A JSON object is of the wrong type.
#define ACTF_JSON_NOT_GTEZ   -8
 A value is not greater than or equal to zero.
#define ACTF_JSON_NOT_GTZ   -9
 A value is not greater than zero.
#define ACTF_INVALID_ALIGNMENT   -10
 An alignment is not a power of two.
#define ACTF_INVALID_BYTE_ORDER   -11
 An invalid byte order is specified.
#define ACTF_INVALID_BIT_ORDER   -12
 An invalid bit order is specified.
#define ACTF_INVALID_RANGE   -13
 An invalid range is specified.
#define ACTF_INVALID_RANGE_SET   -14
 An invalid range set is specified.
#define ACTF_INVALID_UUID   -15
 An invalid uuid is specified.
#define ACTF_INVALID_FLD_LOC   -16
 An invalid field location is specified.
#define ACTF_INVALID_FLD_CLS   -17
 An invalid field class is specified.
#define ACTF_INVALID_FLAGS   -18
 An invalid set of bit map field class flags is specified.
#define ACTF_INVALID_ROLE   -19
 An invalid role is specified.
#define ACTF_INVALID_BASE   -20
 An invalid base is specified.
#define ACTF_UNSUPPORTED_LENGTH   -21
 An invalid or unsupported length is specified.
#define ACTF_INVALID_ENCODING   -22
 An invalid encoding is specified.
#define ACTF_INVALID_ENVIRONMENT   -23
 An invalid environment is specified.
#define ACTF_INVALID_VARIANT   -24
 An invalid variant is specified.
#define ACTF_CC_GTE_FREQ_ERROR   -25
 The cycle offest is greater than or equal to the frequency of a clock class.
#define ACTF_NO_SUCH_ALIAS   -26
 Referring to an alias which does not exist.
#define ACTF_MISSING_PROPERTY   -27
 A required property is not available.
#define ACTF_UNSUPPORTED_EXTENSION   -28
 An extension is enabled which is not supported.
#define ACTF_NO_SUCH_ORIGIN   -29
 A clock origin which does not exist is specified.
#define ACTF_NO_DEFAULT_CLOCK   -30
 A default-clock-timestamp role is specified without the data-stream having a default clock.
#define ACTF_INVALID_UUID_ROLE   -31
 A "metadata-stream-uuid" role is specified, but it is invalid.
#define ACTF_INVALID_MAGIC_ROLE   -32
 A "packet-magic-number" role is specified, but it is invalid.
#define ACTF_NOT_A_STRUCT   -33
 A field class which is required to be a struct is in fact not a struct.
#define ACTF_DUPLICATE_ERROR   -34
 A duplicate of an id, name or field class is specified in the metadata.
#define ACTF_NO_SUCH_ID   -35
 An id referring to a field class is specified but no such id exists.
#define ACTF_UNSUPPORTED_VERSION   -36
 The metadata stream has an unsupported version.
#define ACTF_NO_PREAMBLE   -37
 No preamble is specified.
#define ACTF_WRONG_FLD_TYPE   -38
 Wrong type of field.
#define ACTF_MISSING_FLD_LOC   -39
 Field location is not found.
#define ACTF_NOT_ENOUGH_BITS   -40
 Trying to read more bits than what's available in the packet.
#define ACTF_MID_BYTE_ENDIAN_SWAP   -41
 The byte-order is changed in the middle of a byte.
#define ACTF_INVALID_STR_LEN   -42
 A string length is encountered which is not compatible with its encoding.
#define ACTF_MAGIC_MISMATCH   -43
 The packet magic number is incorrect.
#define ACTF_UUID_MISMATCH   -44
 The data stream UUID does not match the metadata UUID.
#define ACTF_NO_SELECTOR_FLD   -45
 A selector field is not found for an optional or variant.
#define ACTF_INVALID_CONTENT_LEN   -46
 A packet's content length is larger than total length of packet.
#define ACTF_INVALID_METADATA_PKT   -47
 A metadata packet is invalid.
#define ACTF_LUA_WRONG_RET_TYPE   -48
 A lua function returned the wrong type.
#define ACTF_LUA_RUN_ERROR   -49
 A lua function failed to run.
#define ACTF_UUID_N_BYTES   16
 Number of bytes in a UUID.

Typedefs

typedef struct actf_fld actf_fld
 A field.
typedef struct actf_fld_cls actf_fld_cls
 A field class.
typedef struct actf_it actf_it
 An iterator.

Enumerations

enum  actf_byte_order { ACTF_LIL_ENDIAN , ACTF_BIG_ENDIAN }
 Byte orders.
enum  actf_bit_order { ACTF_FIRST_TO_LAST , ACTF_LAST_TO_FIRST }
 Bit orders.
enum  actf_encoding {
  ACTF_ENCODING_UTF8 , ACTF_ENCODING_UTF16BE , ACTF_ENCODING_UTF16LE , ACTF_ENCODING_UTF32BE ,
  ACTF_ENCODING_UTF32LE , ACTF_N_ENCODINGS
}
 Character encodings.
enum  actf_base { ACTF_BASE_BINARY = 2 , ACTF_BASE_OCTAL = 8 , ACTF_BASE_DECIMAL = 10 , ACTF_BASE_HEXADECIMAL = 16 }
 Bases.

Functions

const char * actf_errstr (int rc)
 Convert a return code into an error string.

Detailed Description

Basic types used by ACTF.

Typedef Documentation

◆ actf_it

typedef struct actf_it actf_it

An iterator.

Must be zero-initialized on the first call to an iterator function.

Function Documentation

◆ actf_errstr()

const char * actf_errstr ( int rc)

Convert a return code into an error string.

Parameters
rcthe return code
Returns
the error string