libmp3splt
src/input_output.h
00001 /**********************************************************
00002  *
00003  * libmp3splt -- library based on mp3splt,
00004  *               for mp3/ogg splitting without decoding
00005  *
00006  * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net>
00007  * Copyright (c) 2005-2011 Alexandru Munteanu - io_fx@yahoo.fr
00008  *
00009  * http://mp3splt.sourceforge.net
00010  *
00011  *********************************************************/
00012 
00013 /**********************************************************
00014  *
00015  * This program is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU General Public License
00017  * as published by the Free Software Foundation; either version 2
00018  * of the License, or (at your option) any later version.
00019  *
00020  * This program is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with this program; if not, write to the Free Software
00027  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00028  * 02111-1307,
00029  * USA.
00030  *
00031  *********************************************************/
00032 
00033 #ifndef MP3SPLT_IO_H
00034 
00035 int splt_io_check_if_directory(const char *fname);
00036 int splt_io_check_if_file(splt_state *state, const char *fname);
00037 
00038 int splt_io_input_is_stdin(splt_state *state);
00039 int splt_io_input_is_stdout(splt_state *state);
00040 
00041 #ifndef __WIN32__
00042 #define MAX_SYMLINKS 200
00043 char *splt_io_get_linked_fname(const char *fname, int *number_of_symlinks);
00044 #endif
00045 
00046 int splt_io_get_word (FILE *in, off_t offset, int mode, unsigned long *headw);
00047 off_t splt_io_get_file_length(splt_state *state, FILE *in, const char *filename, int *error);
00048 
00049 void splt_io_create_output_dirs_if_necessary(splt_state *state,
00050     const char *output_filename, int *error);
00051 
00052 int splt_io_create_directories(splt_state *state, const char *dir);
00053 
00054 int splt_io_stat(const char *path, mode_t *st_mode, off_t *st_size);
00055 FILE *splt_io_fopen(const char *filename, const char *mode);
00056 int splt_io_mkdir(splt_state *state, const char *path);
00057 unsigned char *splt_io_fread(FILE *file, int start, size_t size);
00058 size_t splt_io_fwrite(splt_state *state, const void *ptr,
00059     size_t size, size_t nmemb, FILE *stream);
00060 
00061 void splt_io_find_filenames(splt_state *state, const char *directory,
00062     char ***found_files, int *number_of_found_files, int *error);
00063 
00064 char *splt_io_readline(FILE *stream, int *error);
00065 
00066 #define MP3SPLT_IO_H
00067 
00068 #endif
00069