OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ias_odl.h
Go to the documentation of this file.
1 #ifndef IAS_ODL_H
2 #define IAS_ODL_H
3 
4 #include <stdio.h>
5 #include "ias_const.h"
6 
7 /* Warning status codes returned from ias_odl_get_field() */
8 #define IAS_ODL_NOT_ENOUGH_MEMORY_SUPPLIED 2
9 #define IAS_ODL_NOT_FOUND 3
10 #define IAS_ODL_INVALID_DATA_TYPE 4
11 
12 /* Forward reference a couple ODL structures to hide their definition from
13  the rest of the software */
14 typedef struct Object_Structure IAS_OBJ_DESC;
15 typedef struct Keyword_Structure IAS_ODL_KEYWORD;
16 
17 /* Flag indicating what function should be performed on the odl field,
18  add or replace it. */
19 typedef enum
20 {
24 
25 /* Flag passed to ias_odl_get_field() indicating the ODL keyword's expected
26  data type */
27 typedef enum
28 {
36 } IAS_ODL_TYPE;
37 
38 /* Type definition for a list of ODL parameters to read */
39 typedef struct
40 {
41  const char *group_name; /* group name to locate*/
42  char *attribute; /* attribute name */
43  void *parm_ptr; /* Location for attribute value */
44  int parm_size; /* Number of bytes at param_ptr */
45  IAS_ODL_TYPE parm_type; /* Type of parameter */
46  int parm_count; /* Number attribute values */
48 
49 
50 /***********************************************************************
51  Prototype functions for ODL utility library
52 ***********************************************************************/
53 
54 IAS_OBJ_DESC *ias_odl_create_tree
55 (
56 );
57 
59 (
60  IAS_OBJ_DESC *ODLTree, /* I: ODL Object Tree to save */
61  char *p_ODLFile /* I: ODL file name (full directory path) */
62 );
63 
64 IAS_OBJ_DESC *ias_odl_add_group
65 (
66  IAS_OBJ_DESC *ODLTree, /* I/O: ODL Object Tree to populate */
67  const char *p_ClassName /* I: Group/Object name */
68 );
69 
71 (
72  IAS_OBJ_DESC *ODLTree, /* I/O: ODL Object Tree to populate */
73  const char *p_LabelName, /* I: Field to add */
74  IAS_ODL_TYPE ValueType, /* I: What type the field is */
75  const int p_MemorySize, /* I: Total memory size of attribute values */
76  void *p_MemoryAddr, /* I: Pointer to the attribute information */
77  const int nelements /* I: Number of attribute values */
78 );
79 
81 (
82  IAS_OBJ_DESC *ODLTree, /* I/O: ODL Object Tree to populate */
83  const char *p_LabelName, /* I: Field to add */
84  IAS_ODL_TYPE ValueType, /* I: What type the field is */
85  const int p_MemorySize, /* I: Total memory size of attribute values */
86  void *p_MemoryAddr, /* I: Pointer to the attribute information */
87  const int nelements /* I: Number of attribute values */
88 );
89 
91 (
92  IAS_OBJ_DESC *p_ODLTree, /* I/O: ODL Object Tree to populate */
93  ODL_LIST_TYPE *p_ListParms, /* I: List of attibutes to add */
94  const int Count /* I: Number of items in the ODL_LIST_TYPE */
95 );
96 
97 IAS_OBJ_DESC *ias_odl_read_tree
98 (
99  const char *p_ODLFile /* I: ODL file name */
100 );
101 
103 (
104  IAS_OBJ_DESC *p_lp /* I: ODL tree */
105 );
106 
108 (
109  void *p_MemoryAddr, /* I: Pointer to the attribute information */
110  int MemorySize, /* I: Total memory size of attribute values */
111  IAS_ODL_TYPE ValueType, /* I: What type the field is */
112  IAS_OBJ_DESC *p_ODLTree, /* I: ODL tree */
113  const char *p_ClassName, /* I: Group/Object name */
114  const char *p_LabelName, /* I: Field to get */
115  int *p_Count /* O: Count the number of values in a array */
116 );
117 
119 (
120  IAS_OBJ_DESC *p_ODLTree, /* I: ODL Object Tree to parse */
121  ODL_LIST_TYPE *p_ListParms, /* I/O: List of attibutes to retrieve */
122  const int Count /* I: Number of items in the ODL_LIST_TYPE */
123 );
124 
125 IAS_OBJ_DESC *ias_odl_get_group
126 (
127  IAS_OBJ_DESC *ODLTree, /* I: ODL Object Tree root */
128  const char *p_ClassName /* I: Group/Object name to find */
129 );
130 
132 (
133  IAS_OBJ_DESC *p_ODLTree, /* I: ODL Object Tree to parse */
134  char ***p_ClassNames, /* O: ODL Group/Object names */
135  int *p_Count /* O: Number of group names returned */
136 );
137 
138 IAS_OBJ_DESC *ias_odl_parse_file
139 (
140  char *label_fname, /* I: File name to read */
141  FILE *label_fptr /* I: File pointer to read */
142 );
143 
144 IAS_OBJ_DESC *ias_odl_parse_label_string
145 (
146  char *odl_string /* I: ODL string to parse */
147 );
148 
150 (
151  IAS_OBJ_DESC *start_object, /* I: ODL tree to parse */
152  const char *object_class, /* I: class name to search for */
153  const char *keyword_name, /* I: keyword to search for */
154  char *keyword_value, /* I: keyword value to search for */
155  unsigned long object_position /* I: object position to search for */
156 );
157 
158 IAS_ODL_KEYWORD *ias_odl_find_keyword
159 (
160  IAS_OBJ_DESC *start_object, /* I: ODL tree to parse */
161  const char *keyword_name, /* I: keyword to search for */
162  char *keyword_value, /* I: keyword value to search for */
163  unsigned long keyword_position /* I: object position to search for */
164 );
165 
166 #endif
void ias_odl_free_tree(IAS_OBJ_DESC *p_lp)
IAS_OBJ_DESC * ias_odl_find_object_description(IAS_OBJ_DESC *start_object, const char *object_class, const char *keyword_name, char *keyword_value, unsigned long object_position)
IAS_ODL_TYPE parm_type
Definition: ias_odl.h:45
int parm_count
Definition: ias_odl.h:46
IAS_OBJ_DESC * ias_odl_parse_file(char *label_fname, FILE *label_fptr)
void * parm_ptr
Definition: ias_odl.h:43
IAS_OBJ_DESC * ias_odl_create_tree()
IAS_OBJ_DESC * ias_odl_get_group(IAS_OBJ_DESC *ODLTree, const char *p_ClassName)
@ IAS_ODL_Float
Definition: ias_odl.h:34
int ias_odl_add_field_list(IAS_OBJ_DESC *p_ODLTree, ODL_LIST_TYPE *p_ListParms, const int Count)
IAS_OBJ_DESC * ias_odl_add_group(IAS_OBJ_DESC *ODLTree, const char *p_ClassName)
int ias_odl_get_field_list(IAS_OBJ_DESC *p_ODLTree, ODL_LIST_TYPE *p_ListParms, const int Count)
@ IAS_ODL_REPLACE
Definition: ias_odl.h:22
@ IAS_ODL_Long
Definition: ias_odl.h:33
int ias_odl_get_group_names(IAS_OBJ_DESC *p_ODLTree, char ***p_ClassNames, int *p_Count)
IAS_OBJ_DESC * ias_odl_read_tree(const char *p_ODLFile)
IAS_ODL_FIELD_FUNCTION
Definition: ias_odl.h:19
int parm_size
Definition: ias_odl.h:44
IAS_ODL_KEYWORD * ias_odl_find_keyword(IAS_OBJ_DESC *start_object, const char *keyword_name, char *keyword_value, unsigned long keyword_position)
char * attribute
Definition: ias_odl.h:42
@ IAS_ODL_Double
Definition: ias_odl.h:29
int ias_odl_replace_field(IAS_OBJ_DESC *ODLTree, const char *p_LabelName, IAS_ODL_TYPE ValueType, const int p_MemorySize, void *p_MemoryAddr, const int nelements)
@ IAS_ODL_ArrayOfString
Definition: ias_odl.h:30
const char * group_name
Definition: ias_odl.h:41
int ias_odl_add_field(IAS_OBJ_DESC *ODLTree, const char *p_LabelName, IAS_ODL_TYPE ValueType, const int p_MemorySize, void *p_MemoryAddr, const int nelements)
@ IAS_ODL_ADD
Definition: ias_odl.h:21
void ias_odl_write_tree(IAS_OBJ_DESC *ODLTree, char *p_ODLFile)
@ IAS_ODL_Int
Definition: ias_odl.h:32
IAS_ODL_TYPE
Definition: ias_odl.h:27
int ias_odl_get_field(void *p_MemoryAddr, int MemorySize, IAS_ODL_TYPE ValueType, IAS_OBJ_DESC *p_ODLTree, const char *p_ClassName, const char *p_LabelName, int *p_Count)
@ IAS_ODL_Sci_Not
Definition: ias_odl.h:35
IAS_OBJ_DESC * ias_odl_parse_label_string(char *odl_string)
@ IAS_ODL_String
Definition: ias_odl.h:31