OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
epr_msph.c
Go to the documentation of this file.
1 /*
2  * $Id: epr_msph.c,v 1.1.1.1 2004-10-28 19:22:23 norman Exp $
3  *
4  * Copyright (C) 2002 by Brockmann Consult (info@brockmann-consult.de)
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation. This program is distributed in the hope it will
9  * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16  */
17 
18 #include <assert.h>
19 #include <errno.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 
24 #include "epr_api.h"
25 #include "epr_core.h"
26 #include "epr_string.h"
27 #include "epr_ptrarray.h"
28 #include "epr_swap.h"
29 #include "epr_field.h"
30 #include "epr_record.h"
31 #include "epr_param.h"
32 #include "epr_dsd.h"
33 #include "epr_msph.h"
34 #include "epr_band.h"
35 #include "epr_bitmask.h"
36 
37 
47 EPR_SRecord* epr_read_mph(EPR_SProductId* product_id)
48 {
49  EPR_SRecord* record = NULL;
50  char* code_block;
51  int numread;
52 
53  epr_clear_err();
54 
55  code_block = epr_create_string(EPR_MPH_SIZE);
56  if (code_block == NULL)
57  {
59  "epr_read_mph: out of memory");
60  return NULL;
61  }
62  rewind(product_id->istream);
63  numread = fread(code_block, 1, EPR_MPH_SIZE, product_id->istream);
64 
65  if (numread != EPR_MPH_SIZE)
66  {
68  "epr_read_mph: wrong reading MPH from product data file");
69  return NULL;
70  }
71  record = epr_parse_header("mph", code_block);
72  if (record == NULL)
73  {
75  "epr_read_mph: can not recognize the correct MPH from product data file");
76  } else {
77  epr_add_ptr_array_elem(product_id->record_info_cache, record->info);
78  }
79 
80  epr_free_string(code_block);
81  return record;
82 }
83 
92 EPR_SRecord* epr_read_sph(EPR_SProductId* product_id)
93 {
94  EPR_SRecord* sph_record = NULL;
95  const EPR_SField* field;
96 
97  char* code_block;
98  int numread;
99  epr_uint sph_length = 0;
100  epr_uint sph_without_dsd_length = 0;
101  epr_uint dsd_number = 0;
102 
103  epr_clear_err();
104 
105  if (product_id->mph_record == NULL) {
106  product_id->mph_record = epr_read_mph(product_id);
107  if (product_id->mph_record == NULL) {
108  epr_set_err(e_err_file_read_error, "epr_read_sph: wrong MPH");
109  return NULL;
110  }
111  }
112 
113  field = epr_get_field(product_id->mph_record, "SPH_SIZE");
114  sph_length = ((epr_uint*) field->elems)[0];
115  if (sph_length == 0) {
117  "epr_read_sph: wrong MPH: SPH_SIZE must be > 0");
118  return NULL;
119  }
120  field = epr_get_field(product_id->mph_record, "NUM_DSD");
121  dsd_number = ((epr_uint*) field->elems)[0];
122  if (dsd_number == 0) {
124  "epr_read_sph: wrong MPH: NUM_DSD must be > 0");
125  return NULL;
126  }
127 
128  epr_api.epr_head_size = sph_length + EPR_MPH_SIZE;
129  if (fseek(product_id->istream, EPR_MPH_SIZE, SEEK_SET) != 0) {
131  "epr_read_sph: file seek failed");
132  return NULL;
133  }
134 
135  sph_without_dsd_length = sph_length - dsd_number * EPR_DSD_SIZE;
136 
137  code_block = epr_create_string(sph_without_dsd_length);
138  numread = fread(code_block, 1, sph_without_dsd_length, product_id->istream);
139  if ((epr_uint)numread != sph_without_dsd_length) {
141  "epr_read_sph: wrong reading SPH from product data file");
142  return NULL;
143  }
144 
145  sph_record = epr_parse_header("sph", code_block);
146  if (sph_record == NULL) {
148  "epr_read_sph: can not recognize the correct SPH from product data file");
149  } else {
150  epr_add_ptr_array_elem(product_id->record_info_cache, sph_record->info);
151  }
152 
153  epr_free_string(code_block);
154  return sph_record;
155 }
156 
157 void epr_store_header(const char* header_name, const char* ascii_source) {
158  FILE* os;
159  char fname[1024];
160  sprintf(fname, "%s.txt", header_name);
161  os=fopen(fname, "w");
162  fprintf(os,"%s", ascii_source);
163  fclose(os);
164 }
165 
166 
174 EPR_SRecord* epr_parse_header(const char* header_name, const char* ascii_source)
175 {
176  EPR_SRecordInfo* record_info;
177  EPR_SPtrArray* field_infos = NULL;
178  EPR_SFieldInfo* field_info;
179  EPR_SPtrArray* header_values = NULL;
180  EPR_SRecord* record = NULL;
182  char * code_block;
183  char seps[] = EPR_HEADER_SEPARATOR_ARRAY;
184  char * token_name;
185  char * token_value;
186  char * token_unit;
187  char * h_name;
188  int pos = 0;
189  int pos_ascii = 0;
190  epr_uint num_bytes = 0;
191  epr_uint num_elems = 0;
192 
193  epr_clear_err();
194 
195  /* uncomment for debugging purpose */
196  /* epr_store_header(header_name, ascii_source); */
197 
198  header_values = epr_create_ptr_array(16);
199  field_infos = epr_create_ptr_array(16);
200  h_name = epr_clone_string(header_name);
201 
202  while ((code_block = epr_str_tok(ascii_source, "\n", &pos_ascii)) != NULL) {
203  /*if EMPTY code_block*/
204  if ((strlen(code_block) > 0) && (code_block[0] == ' ')) {
205  /* epr_log(e_log_info, "code_block is empty"); */
206  if (code_block != NULL) {
207  epr_free_string(code_block);
208  code_block = NULL;
209  }
210  continue;
211  }
212  /*if '=' separator*/
213  pos = 0;
214  token_name = epr_str_tok(code_block, seps, &pos);
215  if (pos == 1) {
217  "epr_parse_header: invalid ascii header: keyword is empty");
218  epr_free_string(token_name);
219  if (code_block != NULL) {
220  epr_free_string(code_block);
221  code_block = NULL;
222  }
223  continue;
224  }
225  if (pos == (int)strlen(code_block) + 1) {
227  "epr_parse_header: invalid ascii header: keyword not found");
228  epr_free_string(token_name);
229  if (code_block != NULL) {
230  epr_free_string(code_block);
231  code_block = NULL;
232  }
233  continue;
234  }
235  /*if STRING value*/
236  if (code_block[pos] == '\"') {
237  pos ++;
238  /*
239  Note that strings always are considered as one single element,
240  so we get the total number of characters from tot_size.
241  Addidionally we reserve an extra character for the trailing zero (terminator),
242  */
243  token_value = epr_strip_string_r(epr_str_tok(code_block, "\"", &pos));
244  token_unit = NULL;
245  tp = e_tid_string;
246  num_bytes = (epr_uint)strlen(token_value);
247  num_elems = 1;
248  epr_add_ptr_array_elem(header_values, token_value);
249  } else {
250  token_value = epr_str_tok(code_block, seps, &pos);
251  if (token_value == NULL) {
253  "epr_parse_header: invalid ascii header: value not found");
254  token_value = epr_clone_string("");
255  token_unit = NULL;
256  tp = e_tid_uchar;
257  num_bytes = 0;
258  num_elems = 1;
259  epr_add_ptr_array_elem(header_values, token_value);
260  } else {
261  /*if FLOAT-DOUBLE value*/
262  if (strchr(token_value, '.') != NULL
263  || strchr(token_value, 'e') != NULL
264  || strchr(token_value, 'E') != NULL)
265  {
266  epr_parse_double_token(header_values, token_value, &num_elems, &num_bytes, &tp);
267  token_unit = epr_str_tok(code_block, seps, &pos);
268 
269  epr_free_string(token_value);
270  token_value = NULL;
271 
272  /*if INTEGER_LONG value*/
273  } else if ((strlen(token_value) > 1)) {
274 
275  epr_parse_int_token(header_values, token_value, &num_elems, &num_bytes, &tp);
276 
277  epr_free_string(token_value);
278  token_value = NULL;
279 
280  token_unit = epr_str_tok(code_block, seps, &pos);
281  } else {
282  /*if CHAR value*/
283  if (strlen(token_value) > 1) {
285  "epr_parse_header: invalid ascii header: illegal value");
286  token_value = epr_clone_string("");
287  token_unit = NULL;
288  tp = e_tid_uchar;
289  num_bytes = 0;
290  num_elems = 1;
291  epr_add_ptr_array_elem(header_values, token_value);
292  epr_free_string(token_name);
293  if (code_block != NULL) {
294  epr_free_string(code_block);
295  code_block = NULL;
296  }
297  continue;
298  } else {
299  token_unit = NULL;
300  tp = e_tid_uchar;
301  num_bytes = (epr_uint)strlen(token_value);
302  num_elems = 1;
303  epr_add_ptr_array_elem(header_values, token_value);
304  }
305  }
306  }
307  }
308  field_info = epr_create_field_info(tp, h_name, token_name, num_elems, num_bytes, 1, token_unit);
309  epr_add_ptr_array_elem(field_infos, field_info);
310  epr_free_string(token_name);
311  epr_free_string(token_unit);
312  epr_free_string(code_block);
313  }
314 
315  if (field_infos->length > 0) {
316  record_info = epr_create_record_info(h_name, field_infos);
317  record = epr_create_record_from_info(record_info);
318  epr_set_header_field_values(record, header_values);
319  }
320 
321  epr_free_char_ptr_array(header_values);
322 
323  epr_free_string(h_name);
324 
325  return record;
326 }
327 
328 
329 void epr_parse_string_token(EPR_SPtrArray* header_values, char* token_value, epr_uint* num_elems, epr_uint* num_bytes, EPR_EDataTypeId* tp)
330 {
331  char exceptions[] = EPR_HEADER_EXCEPTIONS_ARRAY;
332  char * token_value_o;
333  char * tmp;
334  epr_uint pos_value = 0;
335  int cyc = 0;
336 
337  pos_value = 0;
338  *num_elems = 0;
339  while ((tmp = epr_str_tok_tok(token_value + 1, "+-", exceptions, &pos_value)) != NULL) {
340  cyc ++;
341  token_value_o = epr_create_string(strlen(tmp) + 1);
342  if (strlen(tmp) == strlen(token_value) - 1) {
343  token_value_o[0] = token_value[0];
344  } else if (pos_value < (epr_uint)strlen(token_value) - 1) {
345  token_value_o[0] = token_value[pos_value - strlen(tmp) - 1];
346  } else {
347  token_value_o[0] = token_value[pos_value - strlen(tmp)];
348  }
349  strcat(token_value_o, tmp);
350  epr_add_ptr_array_elem(header_values, token_value_o);
352  }
353  *num_bytes = sizeof(double);
354  *tp = e_tid_double;
355  *num_elems = cyc;
356 }
357 
358 void epr_parse_double_token(EPR_SPtrArray* header_values, char* token_value, epr_uint* num_elems, epr_uint* num_bytes, EPR_EDataTypeId* tp)
359 {
360  char exceptions[] = EPR_HEADER_EXCEPTIONS_ARRAY;
361  char * token_value_o;
362  char * tmp;
363  epr_uint pos_value = 0;
364  int cyc = 0;
365 
366  pos_value = 0;
367  *num_elems = 0;
368  while ((tmp = epr_str_tok_tok(token_value + 1, "+-", exceptions, &pos_value)) != NULL) {
369  cyc ++;
370  token_value_o = epr_create_string(strlen(tmp) + 1);
371  if (strlen(tmp) == strlen(token_value) - 1) {
372  token_value_o[0] = token_value[0];
373  } else if (pos_value < (epr_uint)strlen(token_value) - 1) {
374  token_value_o[0] = token_value[pos_value - strlen(tmp) - 1];
375  } else {
376  token_value_o[0] = token_value[pos_value - strlen(tmp)];
377  }
378  strcat(token_value_o, tmp);
379  epr_add_ptr_array_elem(header_values, token_value_o);
381  }
382  *num_bytes = sizeof(double);
383  *tp = e_tid_double;
384  *num_elems = cyc;
385 }
386 
387 
388 void epr_parse_int_token(EPR_SPtrArray* header_values, char* token_value, epr_uint* num_elems, epr_uint* num_bytes, EPR_EDataTypeId* tp)
389 {
390  char * token_value_o;
391  char * tmp;
392  char * tmp_v;
393  char * stopstring;
394  int pos_value = 0;
395  epr_uint dlina;
396  epr_uint i;
397  char value_buffer[32];
398  int lmp;
399  epr_uint ulmp;
400  int flag_int = 0;
401  //int flag_negative = 0;
402  int cyc = 0;
403 
404  pos_value = 0;
405  *num_elems = 0;
406  flag_int = 0;
407  //flag_negative = 0;
408 
409  if (strchr(token_value, '-') != NULL) {
410  flag_int = 1;
411  *num_bytes = sizeof(int);
412  *tp = e_tid_int;
413  } else {
414  *num_bytes = sizeof(epr_uint);
415  *tp = e_tid_uint;
416  }
417 
418  while ((tmp = epr_str_tok(token_value + 1, "+-", &pos_value)) != NULL) {
419  if (epr_if_no_letters(tmp) == 0) {
421  "epr_parse_header: invalid ascii header: illegal value");
422  cyc ++;
423  tmp = epr_clone_string("-999999");
424  *num_bytes = sizeof(int);
425  *tp = e_tid_int;
426  epr_add_ptr_array_elem(header_values, tmp);
427  } else {
428  cyc ++;
429  token_value_o = epr_create_string(strlen(tmp) + 1);
430  if (strlen(tmp) == strlen(token_value) - 1) {
431  token_value_o[0] = token_value[0];
432  } else if (pos_value < (int)strlen(token_value) - 1) {
433  token_value_o[0] = token_value[pos_value - strlen(tmp) - 1];
434  } else if (strlen(tmp) == 1) {
435  if (cyc == 1)
436  token_value_o[0] = token_value[pos_value];
437  else
438  token_value_o[0] = token_value[pos_value - 1];
439  } else {
440  token_value_o[0] = token_value[pos_value - strlen(tmp)];
441  }
442  strcat(token_value_o, tmp);
443  dlina = (epr_uint)strlen(token_value_o);
444  tmp_v = epr_create_string(dlina);
445  /*if int*/
446  if (flag_int == 1) {
447  lmp = strtol(token_value_o, &stopstring, 10);
448  if (lmp != 0) {
449  tmp_v[0] = token_value_o[0];
450  for (i = 1; i < dlina; i ++) if (token_value_o[i] != '0') break;
451  if (token_value_o[0] == '+') strncpy(tmp_v + 0, token_value_o + i, dlina - i);
452  if (token_value_o[0] == '-') strncpy(tmp_v + 1, token_value_o + i, dlina - i);
453  sprintf(value_buffer, "%d", lmp);
454  /*if int value too large*/
455  if (strcmp(tmp_v, value_buffer) != 0)
456  epr_log(e_log_warning, "product header: int integer value out of range");
457  }
458  } else if (flag_int == 0) {
459  ulmp = strtoul(token_value_o, &stopstring, 10);
460  if (ulmp != 0UL) {
461  tmp_v[0] = token_value_o[0];
462  for (i = 1; i < dlina; i ++) if (token_value_o[i] != '0') break;
463  strncpy(tmp_v, token_value_o + i, dlina - i);
464  sprintf(value_buffer, "%u", ulmp);
465  /*if epr_uint value too large*/
466  if (strcmp(tmp_v, value_buffer) != 0)
467  epr_log(e_log_warning, "product header: unsigned int integer value out of range");
468  }
469  }
470  epr_free_string(tmp_v);
471  epr_add_ptr_array_elem(header_values, token_value_o);
473  }
474  }
475  *num_elems = cyc;
476 }
477 
478 
479 
487 void epr_set_header_field_values(EPR_SRecord* record, EPR_SPtrArray* header_values)
488 {
489  EPR_SFieldInfo* field_info;
490  EPR_SField* field;
491  epr_uint ptr_index = 0;
492  epr_uint field_index;
493  epr_uint field_info_index;
494  char * tmp;
495  char * stopstring;
496 
497  assert(header_values != NULL);
498 
499  for (field_index = 0; field_index < record->num_fields; field_index++) {
500  field = record->fields[field_index];
501  field_info = (EPR_SFieldInfo*)epr_get_ptr_array_elem_at(record->info->field_infos, field_index);
502 
503  for (field_info_index = 0; field_info_index < field->info->num_elems; field_info_index++) {
504  tmp = (char*)epr_get_ptr_array_elem_at(header_values, ptr_index);
505  switch (field_info->data_type_id) {
506  case e_tid_uchar:
507  *(((epr_uchar*)field->elems) + field_info_index) = (epr_uchar) tmp[field_info_index];
508  break;
509  case e_tid_int:
510  *(((int*)field->elems) + field_info_index) = strtol(tmp, &stopstring, 10);
511  break;
512  case e_tid_uint:
513  *(((epr_uint*)field->elems) + field_info_index) = strtoul(tmp, &stopstring, 10);
514  break;
515  case e_tid_string:;
516  /*epr_assign_string(&(char*)field->elems, tmp);*/
517  strncpy((char*)field->elems, tmp, field->info->tot_size);
518  break;
519  case e_tid_double:
520  *(((double*)field->elems) + field_info_index) = strtod(tmp, &stopstring);
521  break;
522  default:
524  "epr_set_header_field_values: internal error: illegal value type");
525  }
526  ptr_index ++;
527  }
528  }
529 }
530 
531 
533 {
534  EPR_SDSD* dsd;
535  epr_uint of;
536 
537  epr_clear_err();
538 
539  if (product_id == NULL) {
540  epr_set_err(e_err_invalid_product_id, "epr_compare_param: invalid product identifier");
541  return 0UL;
542  }
543 
544  of = epr_api.epr_head_size;
545  dsd = (EPR_SDSD*)epr_get_ptr_array_elem_at(product_id->dsd_array, 0);
546  if (dsd->ds_offset == epr_api.epr_head_size)
547  return of;
548 
549  return 0UL;
550 }
void epr_set_header_field_values(EPR_SRecord *record, EPR_SPtrArray *header_values)
Definition: epr_msph.c:487
void epr_free_char_ptr_array(EPR_SPtrArray *char_ptr_array)
Definition: epr_ptrarray.c:65
char * epr_strip_string_r(char *str)
Definition: epr_string.c:294
@ e_err_out_of_memory
Definition: epr_api.h:83
unsigned int epr_uint
Definition: epr_api.h:188
@ e_log_warning
Definition: epr_api.h:127
#define NULL
Definition: decode_rs.h:63
void epr_store_header(const char *header_name, const char *ascii_source)
Definition: epr_msph.c:157
epr_uint epr_compare_param(EPR_SProductId *product_id)
Definition: epr_msph.c:532
EPR_SAPI epr_api
Definition: epr_core.c:43
u5 which has been done in the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT production Changes from v6 which may affect scientific the sector rotation may actually occur during one of the scans earlier than the one where it is first reported As a the b1 values are about the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT to fill pixels affected by dead subframes with a special value Output the metadata of noisy and dead subframe Dead Subframe EV and Detector Quality Flag2 Removed the function call of Fill_Dead_Detector_SI to stop interpolating SI values for dead but also for all downstream products for science test only Changes from v5 which will affect scientific to conform to MODIS requirements Removed the Mixed option from the ScanType in the code because the L1A Scan Type is never Mixed Changed for ANSI C compliance and comments to better document the fact that when the HDF_EOS metadata is stricly the and products are off by and in the track respectively Corrected some misspelling of RCS swir_oob_sending_detector to the Reflective LUTs to enable the SWIR OOB correction detector so that if any of the sending detectors becomes noisy or non near by good detectors from the same sending band can be specified as the substitute in the new look up table Code change for adding an additional dimension of mirror side to the Band_21_b1 LUT to separate the coefficient of the two mirror sides for just like other thermal emissive so that the L1B code can calibrate Band scan to scan with mirror side dependency which leads better calibration result Changes which do not affect scientific when the EV data are not provided in this Crosstalk Correction will not be performed to the Band calibration data Changes which do not affect scientific and BB_500m in L1A Logic was added to turn off the or to spatial aggregation processes and the EV_250m_Aggr1km_RefSB and EV_500m_Aggr1km_RefSB fields were set to fill values when SDSs EV_250m and EV_500m are absent in L1A file Logic was added to skip the processing and turn off the output of the L1B QKM and HKM EV data when EV_250m and EV_500m are absent from L1A In this the new process avoids accessing and reading the and L1A EV skips and writing to the L1B and EV omits reading and subsampling SDSs from geolocation file and writing them to the L1B and omits writing metadata to L1B and EV and skips closing the L1A and L1B EV and SDSs Logic was added to turn off the L1B OBC output when the high resolution OBC SDSs are absent from L1A This is accomplished by skipping the openning of
Definition: HISTORY.txt:352
EPR_SRecord * epr_create_record_from_info(EPR_SRecordInfo *record_info)
Definition: epr_record.c:315
float32 * pos
Definition: l1_czcs_hdf.c:35
@ e_err_file_access_denied
Definition: epr_api.h:90
float tp[MODELMAX]
Definition: atrem_corl1.h:173
const EPR_SField * epr_get_field(const EPR_SRecord *record, const char *field_name)
Definition: epr_field.c:247
@ e_err_invalid_product_id
Definition: epr_api.h:98
char * epr_create_string(unsigned int length)
Definition: epr_string.c:37
@ e_tid_int
Definition: epr_api.h:58
@ e_err_invalid_record
Definition: epr_api.h:99
#define EPR_HEADER_SEPARATOR_ARRAY
Definition: epr_core.h:59
EPR_SRecordInfo * epr_create_record_info(const char *dataset_name, EPR_SPtrArray *field_infos)
Definition: epr_record.c:61
EPR_SRecord * epr_parse_header(const char *header_name, const char *ascii_source)
Definition: epr_msph.c:174
data_t tmp
Definition: decode_rs.h:74
char * epr_clone_string(const char *str)
Definition: epr_string.c:43
@ e_err_file_read_error
Definition: epr_api.h:91
subroutine os(tamoy, trmoy, pizmoy, tamoyp, trmoyp, palt, phirad, nt, mu, np, rm, gb, rp, xl)
Definition: 6sm1.f:5484
@ e_err_invalid_value
Definition: epr_api.h:108
@ e_tid_uint
Definition: epr_api.h:56
char * epr_str_tok_tok(const char *str, const char *seps, const char *exceptions, epr_uint *pos)
Definition: epr_string.c:177
What value is used by your function when the data value is bad Default is BAD_FLT l2prod product_id[0]
void epr_parse_double_token(EPR_SPtrArray *header_values, char *token_value, epr_uint *num_elems, epr_uint *num_bytes, EPR_EDataTypeId *tp)
Definition: epr_msph.c:358
void * epr_get_ptr_array_elem_at(const EPR_SPtrArray *ptr_array, unsigned int index)
Definition: epr_ptrarray.c:122
EPR_SFieldInfo * epr_create_field_info(EPR_EDataTypeId data_type_id, char *description, char *field_name, epr_uint num_elems, epr_uint num_bytes, epr_uint more_count, char *unit)
Definition: epr_field.c:52
integer, parameter double
int epr_add_ptr_array_elem(EPR_SPtrArray *ptr_array, void *elem)
Definition: epr_ptrarray.c:75
void epr_log(EPR_ELogLevel log_level, const char *log_message)
Definition: epr_core.c:199
void epr_clear_err()
Definition: epr_core.c:247
void epr_set_err(EPR_EErrCode err_code, const char *err_message)
Definition: epr_core.c:221
@ e_tid_double
Definition: epr_api.h:62
EPR_SRecord * epr_read_mph(EPR_SProductId *product_id)
Definition: epr_msph.c:47
#define EPR_MPH_SIZE
Definition: epr_core.h:46
void epr_parse_int_token(EPR_SPtrArray *header_values, char *token_value, epr_uint *num_elems, epr_uint *num_bytes, EPR_EDataTypeId *tp)
Definition: epr_msph.c:388
@ e_err_invalid_keyword_name
Definition: epr_api.h:109
#define EPR_DSD_SIZE
Definition: epr_core.h:48
@ e_tid_string
Definition: epr_api.h:64
char * epr_str_tok(const char *str, const char *seps, int *pos)
Definition: epr_string.c:122
EPR_SRecord * epr_read_sph(EPR_SProductId *product_id)
Definition: epr_msph.c:92
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
enum EPR_DataTypeId EPR_EDataTypeId
Definition: epr_api.h:161
unsigned char epr_uchar
Definition: epr_api.h:186
@ e_tid_uchar
Definition: epr_api.h:48
int i
Definition: decode_rs.h:71
void epr_parse_string_token(EPR_SPtrArray *header_values, char *token_value, epr_uint *num_elems, epr_uint *num_bytes, EPR_EDataTypeId *tp)
Definition: epr_msph.c:329
void epr_free_string(char *str)
Definition: epr_string.c:100
#define EPR_HEADER_EXCEPTIONS_ARRAY
Definition: epr_core.h:60
int epr_if_no_letters(const char *str)
Definition: epr_string.c:322
EPR_SPtrArray * epr_create_ptr_array(unsigned int capacity)
Definition: epr_ptrarray.c:29