/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/sed/sed_hydrotrend.h

Go to the documentation of this file.
00001 //---
00002 //
00003 // This file is part of sedflux.
00004 //
00005 // sedflux is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // sedflux is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with sedflux; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //
00019 //---
00020 
00021 #ifndef _HYDROTREND_INCLUDED_
00022 # define _HYDROTREND_INCLUDED_
00023 
00024 #include <stdio.h>
00025 #include <glib.h>
00026 
00027 typedef struct
00028 {
00029    int    n_grains;
00030    int    n_seasons;
00031    int    n_samples;
00032    gchar* comment;
00033 }
00034 Sed_hydrotrend_header;
00035 
00036 typedef enum
00037 {
00038    SED_HYDROTREND_ERROR_BAD_HEADER
00039 }
00040 Sed_hydrotrend_error;
00041 
00042 #define SED_HYDROTREND_ERROR sed_hydrotrend_error_quark()
00043 
00044 #include <sed/sed_hydro.h>
00045 
00046 // Read and write HydroTend header information.
00047 Sed_hydrotrend_header* sed_hydrotrend_read_header( FILE *fp );
00048 Sed_hydrotrend_header* sed_hydrotrend_read_header_from_byte_order( FILE *fp , gint order );
00049 Sed_hydrotrend_header* sed_hydrotrend_header_destroy( Sed_hydrotrend_header* h );
00050 Sed_hydrotrend_header* sed_hydrotrend_join_header_from_byte_order( FILE** fp_list , gint order , GError** err );
00051 gssize                 sed_hydrotrend_write_header_to_byte_order( FILE*  fp        ,
00052                                                                   gint   n_grains  ,
00053                                                                   gint   n_seasons ,
00054                                                                   gint   n_samples ,
00055                                                                   gchar* comment_s ,
00056                                                                   gint   order );
00057 gssize                 sed_hydrotrend_write_header( FILE* fp       ,
00058                                                     gint n_grains  ,
00059                                                     gint n_seasons ,
00060                                                     gint n_samples ,
00061                                                     gchar* comment_s );
00062 
00063 gint sed_hydrotrend_byte_order( const gchar* file , GError** error );
00064 gint sed_hydrotrend_guess_byte_order( FILE* fp );
00065 
00066 // Read and write HydroTrend records
00067 Sed_hydro          sed_hydrotrend_read_next_rec( FILE* fp , int n_grains );
00068 Sed_hydro          sed_hydrotrend_read_next_rec_from_byte_order( FILE *fp , int n_grains , gint order );
00069 Sed_hydro*         sed_hydrotrend_read_recs( FILE* fp , gint rec_0 , gint n_recs , gint byte_order , GError** error );
00070 gssize             sed_hydrotrend_read_next_n_recs( FILE* fp , Sed_hydro* rec , int n_grains , int n_recs );
00071 
00072 Sed_hydro*         sed_hydrotrend_read       ( const gchar* file       ,
00073                                                gint         byte_order ,
00074                                                int*         n_seasons  ,
00075                                                GError**     error );
00076 Sed_hydro*         sed_hydrotrend_read_n_recs( const gchar* file       ,
00077                                                gint         n_recs     ,
00078                                                gint         byte_order ,
00079                                                int*         n_seasons  ,
00080                                                GError** error );
00081 
00082 gssize             sed_hydrotrend_write_record( FILE *fp , Sed_hydro rec );
00083 gssize             sed_hydrotrend_write_record_to_byte_order( FILE *fp , Sed_hydro rec , gint order );
00084 gssize             sed_hydrotrend_write( gchar* file , Sed_hydro* rec_a , gint n_seasons , gchar* comment_s , GError** error );
00085 gssize             sed_hydro_array_write_hydrotrend_records_to_byte_order( FILE* fp , Sed_hydro* rec_a , gint order );
00086 gssize             sed_hydro_array_write_hydrotrend_records( FILE* fp , Sed_hydro* rec_a );
00087 
00088 gint               sed_hydrotrend_fseek      ( FILE* fp , gint offset , gint whence , gint byte_order );
00089 gint               sed_hydrotrend_record_size( FILE* fp , gint byte_order , Sed_hydrotrend_header* h );
00090 gint               sed_hydrotrend_n_grains   ( FILE* fp , gint byte_order , Sed_hydrotrend_header* h );
00091 gint               sed_hydrotrend_data_start ( FILE* fp , gint byte_order , Sed_hydrotrend_header* h );
00092 
00093 #endif /* hydrotrend.h is included */

Generated on Fri Jan 4 18:04:15 2008 for sedflux by  doxygen 1.5.2