"Fossies" - the Fresh Open Source Software Archive

Member "gnuastro-0.8/lib/gnuastro/txt.h" (4 Nov 2018, 2744 Bytes) of package /linux/privat/gnuastro-0.8.tar.lz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "txt.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.7_vs_0.8.

    1 /*********************************************************************
    2 txt -- functions to deal with plain text files.
    3 This is part of GNU Astronomy Utilities (Gnuastro) package.
    4 
    5 Original author:
    6      Mohammad Akhlaghi <mohammad@akhlaghi.org>
    7 Contributing author(s):
    8 Copyright (C) 2015-2018, Free Software Foundation, Inc.
    9 
   10 Gnuastro is free software: you can redistribute it and/or modify it
   11 under the terms of the GNU General Public License as published by the
   12 Free Software Foundation, either version 3 of the License, or (at your
   13 option) any later version.
   14 
   15 Gnuastro is distributed in the hope that it will be useful, but
   16 WITHOUT ANY WARRANTY; without even the implied warranty of
   17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18 General Public License for more details.
   19 
   20 You should have received a copy of the GNU General Public License
   21 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
   22 **********************************************************************/
   23 #ifndef __GAL_TXT_H__
   24 #define __GAL_TXT_H__
   25 
   26 /* Include other headers if necessary here. Note that other header files
   27    must be included before the C++ preparations below */
   28 
   29 #include <gnuastro/list.h>
   30 
   31 
   32 
   33 /* C++ Preparations */
   34 #undef __BEGIN_C_DECLS
   35 #undef __END_C_DECLS
   36 #ifdef __cplusplus
   37 # define __BEGIN_C_DECLS extern "C" {
   38 # define __END_C_DECLS }
   39 #else
   40 # define __BEGIN_C_DECLS                /* empty */
   41 # define __END_C_DECLS                  /* empty */
   42 #endif
   43 /* End of C++ preparations */
   44 
   45 
   46 
   47 
   48 
   49 /* Actual header contants (the above were for the Pre-processor). */
   50 __BEGIN_C_DECLS  /* From C++ preparations */
   51 
   52 
   53 
   54 
   55 /* Macros.*/
   56 #define GAL_TXT_DELIMITERS     " ,\t\f\v"
   57 #define GAL_TXT_MAX_FMT_LENGTH 20
   58 
   59 
   60 
   61 
   62 
   63 /* Status of a line: */
   64 enum gal_txt_line_status_enums
   65 {
   66   GAL_TXT_LINESTAT_INVALID,
   67 
   68   GAL_TXT_LINESTAT_BLANK,
   69   GAL_TXT_LINESTAT_COMMENT,
   70   GAL_TXT_LINESTAT_DATAROW,
   71 };
   72 
   73 
   74 
   75 
   76 
   77 /* Functions */
   78 int
   79 gal_txt_line_stat(char *line);
   80 
   81 gal_data_t *
   82 gal_txt_table_info(char *filename, gal_list_str_t *lines, size_t *numcols,
   83                    size_t *numrows);
   84 
   85 gal_data_t *
   86 gal_txt_image_info(char *filename, gal_list_str_t *lines, size_t *numimg,
   87                    size_t *dsize);
   88 
   89 gal_data_t *
   90 gal_txt_table_read(char *filename, gal_list_str_t *lines, size_t numrows,
   91                    gal_data_t *colinfo, gal_list_sizet_t *indexll,
   92                    size_t minmapsize);
   93 
   94 gal_data_t *
   95 gal_txt_image_read(char *filename, gal_list_str_t *lines, size_t minmapsize);
   96 
   97 gal_list_str_t *
   98 gal_txt_stdin_read(long timeout_microsec);
   99 
  100 void
  101 gal_txt_write(gal_data_t *input, gal_list_str_t *comment, char *filename,
  102               uint8_t colinfoinstdout);
  103 
  104 
  105 
  106 __END_C_DECLS    /* From C++ preparations */
  107 
  108 #endif           /* __GAL_TXT_H__ */