fspec.h
Go to the documentation of this file.
1 // vim:set ft=c sw=2 sts=2 fenc=utf8:
2 
3 /*
4  * libasterix
5  * Copyright [2013-2020] SinoATC <http://www.sinoatc.com>.
6  * All Rights Reserved.
7  *
8  * NOTICE: All information contained herein is, and remains
9  * the property of SinoATC and its suppliers, if any.
10  * The intellectual and technical concepts contained herein
11  * are proprietary to Aerosys Corporation and its suppliers and may be
12  * covered by U.S. and Foreign Patents, patents in process,
13  * and are protected by trade secret or copyright law.
14  * Dissemination of this information or reproduction of this material
15  * is strictly forbidden unless prior written permission is obtained
16  * from SinoATC.
17  */
18 
25 #ifndef LIBASTERIX_FSPEC_H
26 #define LIBASTERIX_FSPEC_H
27 
28 #include <stddef.h>
29 #include <stdbool.h>
30 #include "platform.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct _ast_fspec_t
37 {
38  const unsigned char* data;
39  size_t size;
40  size_t count;
41  size_t count_set;
42  bool valid;
43 } ast_fspec_t;
44 
45 AST_API ast_fspec_t ast_fspec_decode(const unsigned char* const buffer, const size_t bufsize);
46 
47 //ast_fspec_t ast_fspec_encode(unsigned char* const buffer, const size_t bufsize, ast_datarecord_ex_t drx);
48 
49 AST_API ast_fspec_t ast_fspec_copy(unsigned char* const buffer, const size_t bufsize, const ast_fspec_t src);
50 
51 AST_API bool ast_fspec_is_set(const ast_fspec_t* fspec, const unsigned int frn);
52 
53 AST_API bool ast_fspec_set(unsigned char* const buffer, const size_t bufsize, const unsigned int frn, const bool set);
54 
55 #ifdef __cplusplus
56  }
57 #endif // extern "C"
58 
59 #endif //LIBASTERIX_FSPEC_H
60 
size_t count
Size of FSPEC field, number of bytes.
Definition: fspec.h:40
#define AST_API
Definition: platform.h:63
This file includes platform specific definitions.
ast_fspec_t ast_fspec_decode(const unsigned char *const buffer, const size_t bufsize)
size_t size
Address of FSPEC field.
Definition: fspec.h:39
bool ast_fspec_set(unsigned char *const buffer, const size_t bufsize, const unsigned int frn, const bool set)
size_t count_set
Number of data items in total.
Definition: fspec.h:41
Definition: fspec.h:36
bool ast_fspec_is_set(const ast_fspec_t *fspec, const unsigned int frn)
const unsigned char * data
Definition: fspec.h:38
bool valid
Number of data items set existance.
Definition: fspec.h:42
ast_fspec_t ast_fspec_copy(unsigned char *const buffer, const size_t bufsize, const ast_fspec_t src)