• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/home/pascal/depot/filedata/src/epr/epr_core.h

00001 /*
00002  * $Id: epr__core_8h_source.html,v 1.11 2013/02/14 16:57:53 pascal Exp $
00003  *
00004  * Copyright (C) 2002 by Brockmann Consult (info@brockmann-consult.de)
00005  *
00006  * This program is free software; you can redistribute it and/or modify it
00007  * under the terms of the GNU General Public License as published by the
00008  * Free Software Foundation. This program is distributed in the hope it will
00009  * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
00010  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011  * See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00016  */
00017 
00018 #ifndef EPR_CORE_H_INCL
00019 #define EPR_CORE_H_INCL
00020 
00021 #ifdef __cplusplus
00022 extern "C"
00023 {
00024 #endif
00025 
00026 
00027 #include <stdio.h> /* just to get the ANSI-C type FILE */
00028 
00029 #include "epr_ptrarray.h"
00030 
00031 struct EPR_API;
00032 struct EPR_Parameter;
00033 
00034 typedef struct EPR_API EPR_SAPI;
00035 typedef struct EPR_Parameter EPR_SParameter;
00036 
00037 
00038 #define EPR_ENVISAT_PRODUCT_MERIS        "MER"
00039 #define EPR_ENVISAT_PRODUCT_ASAR         "ASA"
00040 #define EPR_ENVISAT_PRODUCT_AATSR        "ATS"
00041 
00042 #define EPR_LONGI_BAND_NAME               "longitude"
00043 
00044 #define EPR_AATSR_LINES_PER_TIE_PT        32
00045 
00046 #define EPR_MPH_SIZE                      1247
00047 #define EPR_SPH_SIZE                      11622
00048 #define EPR_DSD_SIZE                      280
00049 
00050 #define EPR_PRODUCT_MPH_SIZE              1048 /*??????*/
00051 #define EPR_PRODUCT_MAGIC_STR             "PRODUCT=\""
00052 #define EPR_PRODUCT_ID_OFFSET             9
00053 
00054 #define EPR_PRODUCT_TYPE_ID_STRLEN        10
00055 #define EPR_LENGTH_NUM_DSD_IDENTIFIER     9
00056 #define EPR_COUNT_SEPARATOR_ARRAY         ",*"
00057 #define EPR_IRRELEVANCE_SYMBOL            '*'
00058 #define EPR_FIELD_SEPARATOR_ARRAY         "|"
00059 #define EPR_HEADER_SEPARATOR_ARRAY        "=<>"
00060 #define EPR_HEADER_EXCEPTIONS_ARRAY       "eE"
00061 
00062 #define EPR_LONGI_ABS_MAX                 180
00063 #define EPR_LONGI_ABS_MIN                 -180
00064 
00065 #define EPR_LINE_MAX_LENGTH               2000
00066 
00067 #define EPR_BE_MAGIC_NUMBER  1162761801UL
00068 #define EPR_LE_MAGIC_NUMBER  1230392901UL
00069 #define EPR_LE_MAGIC_BYTE_0  'E'
00070 #define EPR_LE_MAGIC_BYTE_1  'N'
00071 #define EPR_LE_MAGIC_BYTE_2  'V'
00072 #define EPR_LE_MAGIC_BYTE_3  'I'
00073 
00074 #define EPR_ATS_NUM_PER_POINT_ACROSS_LOCAT      23
00075 #define EPR_ATS_NUM_PER_POINT_ACROSS_SOLAR      11
00076 #define EPR_ATS_LINE_LENGTH                     512
00077 
00078 #define EPR_ASAR_NUM_PER_POINT_ACROSS_LOCAT     11
00079 
00086 struct EPR_API
00087 {
00091     boolean init_flag;
00092 
00099     int little_endian_order;
00100 
00104     ulong epr_head_size;
00105 
00109     /*char* db_dir_path;*/
00110 
00114     EPR_ELogLevel log_level;
00115 
00120     EPR_FLogHandler log_handler;
00121 
00125     EPR_EErrCode last_err_code;
00126 
00130     char* last_err_message;
00131 
00136     EPR_FErrHandler err_handler;
00137 };
00138 
00139 
00143 extern EPR_SAPI epr_api;
00144 
00145 
00146 /*
00147  * ======================================================================
00148  */
00149 
00159 void epr_free_product_id(EPR_SProductId* product_id);
00160 
00161 
00172 void epr_log(EPR_ELogLevel log_level, const char* log_message);
00173 
00181 void epr_set_err(EPR_EErrCode err_code, const char* err_message);
00182 
00191 EPR_SRecord* epr_read_mph(EPR_SProductId* product_id);
00192 
00201 EPR_SRecord* epr_read_sph(EPR_SProductId* product_id);
00202 
00211 EPR_EDataTypeId epr_str_to_data_type_id(const char* str);
00212 
00213 /*
00214  * Converts the given string into a field length.
00215  *
00216  * The string can represent a single integer value or a sequence
00217  * of integer value and parameter references (names). Integers
00218  * and value are expected to be separated by the asterisk
00219  * character ('*'). E.g. the string "3 * 4 * num_pixels_across"
00220  * is represents a valid field length as long as the parameter
00221  * name 'num_pixels_across' is found in the given parameter table.
00222  *
00223  * @param str the string to be converted
00224  * @param param_table the parameter table containing the values
00225  *                    for the parameter references in the string
00226  * @return the field length computed from the given string or
00227  *         <code>(uint)-1</code> if an error occured.
00228  */
00229 /*uint epr_str_to_field_length(const char* str, EPR_SParamTable* param_table);*/
00230 
00244 char* epr_build_db_file_istream_name(EPR_SProductId* product_id, char* what);
00245 FILE* epr_open_file(char* path_to_file);
00246 long epr_str_to_number(const char* str);
00247 uint epr_parse_value_count(EPR_SProductId* product_id, const char* str);
00248 uint epr_param_to_value(const char* str, EPR_SPtrArray* param_table);
00249 void epr_make_os_compatible_path(char* path);
00250 boolean epr_check_api_init_flag();
00251 
00252 /*
00253 void epr_make_image_header(EPR_SProductId* product_id, EPR_SDatasetId* dataset_id, EPR_SRecord* record);
00254 int epr_make_image(EPR_SProductId* product_id, EPR_SDatasetId* dataset_id, EPR_SRecord* record);
00255 */
00256 
00263 void epr_output_element(const EPR_SField* field, uint field_index, uint element_index, FILE* istream);
00264 
00265 #ifdef __cplusplus
00266 } /* extern "C" */
00267 #endif
00268 
00269 #endif /* #ifndef EPR_CORE_H_INCL */

Generated on Thu Feb 14 2013 17:59:03 for filedata.kdevelop by  doxygen 1.7.1