fspec.h
Go to the documentation of this file.
1/*
2 * $COPYRIGHT-BEGIN$
3 * libasterix
4 * Copyright [2013-2026] SinoATC <http://www.sinoatc.com>.
5 * All Rights Reserved.
6 *
7 * NOTICE: All information contained herein is, and remains
8 * the property of SinoATC and its suppliers, if any.
9 * The intellectual and technical concepts contained herein
10 * are proprietary to SinoATC and its suppliers and may be
11 * covered by U.S. and Foreign Patents, patents in process,
12 * and are protected by trade secret or copyright law.
13 * Dissemination of this information or reproduction of this material
14 * is strictly forbidden unless prior written permission is obtained
15 * from SinoATC.
16 * $COPYRIGHT-END$
17 */
18
28
29#ifndef LIBASTERIX_FSPEC_H
30#define LIBASTERIX_FSPEC_H
31
32#include <stddef.h>
33#include <stdbool.h>
34#include "platform.h"
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
53
55typedef struct _ast_fspec_t
56{
57 const unsigned char* data;
58 size_t size;
59 size_t count;
60 size_t count_set;
61 bool valid;
63
77AST_API ast_fspec_t ast_fspec_decode(const unsigned char* const buffer, const size_t bufsize);
78
79//ast_fspec_t ast_fspec_encode(unsigned char* const buffer, const size_t bufsize, ast_datarecord_ex_t drx);
80
95AST_API ast_fspec_t ast_fspec_copy(unsigned char* const buffer, const size_t bufsize, const ast_fspec_t src);
96
105AST_API bool ast_fspec_is_set(const ast_fspec_t* fspec, const unsigned int frn);
106
120AST_API bool ast_fspec_set(unsigned char* const buffer, const size_t bufsize, const unsigned int frn, const bool set);
121 /* end of group fs_fspec */
123
124#ifdef __cplusplus
125 }
126#endif // extern "C"
127
128#endif //LIBASTERIX_FSPEC_H
129
130// vim:set ft=c.doxygen sw=2 sts=2 fenc=utf8:
ast_fspec_t ast_fspec_decode(const unsigned char *const buffer, const size_t bufsize)
FSPEC decode function.
bool ast_fspec_is_set(const ast_fspec_t *fspec, const unsigned int frn)
Test whether a data item is present.
bool ast_fspec_set(unsigned char *const buffer, const size_t bufsize, const unsigned int frn, const bool set)
Set or clear the presence bit of a data item.
ast_fspec_t ast_fspec_copy(unsigned char *const buffer, const size_t bufsize, const ast_fspec_t src)
FSPEC copy function.
This file includes platform specific definitions.
#define AST_API
Definition platform.h:63
Field Specification (FSPEC).
Definition fspec.h:56
bool valid
True, if FSPEC is correctly decoded.
Definition fspec.h:61
const unsigned char * data
Address of FSPEC field.
Definition fspec.h:57
size_t count
Number of data items in total.
Definition fspec.h:59
size_t count_set
Number of data items set existence.
Definition fspec.h:60
size_t size
Size of FSPEC field, number of bytes.
Definition fspec.h:58