"Fossies" - the Fresh Open Source Software Archive

Member "shake-1.0/executive.h" (15 Nov 2014, 2855 Bytes) of package /linux/privat/shake-1.0.tar.gz:


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 "executive.h" see the Fossies "Dox" file reference documentation.

    1 /***************************************************************************/
    2 /*  Copyright (C) 2006-2011 Brice Arnould.                                 */
    3 /*                                                                         */
    4 /*  This file is part of ShaKe.                                            */
    5 /*                                                                         */
    6 /*  ShaKe is free software; you can redistribute it and/or modify          */
    7 /*  it under the terms of the GNU General Public License as published by   */
    8 /*  the Free Software Foundation; either version 3 of the License, or      */
    9 /*  (at your option) any later version.                                    */
   10 /*                                                                         */
   11 /*  This program is distributed in the hope that it will be useful,        */
   12 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of         */
   13 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
   14 /*  GNU General Public License for more details.                           */
   15 /*                                                                         */
   16 /*  You should have received a copy of the GNU General Public License      */
   17 /*  along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   18 /***************************************************************************/
   19 
   20 #ifndef FCOPY_H
   21 # define FCOPY_H
   22 # include "judge.h"
   23 
   24 /*  Copy the content of file referenced by in_fd to out_fd
   25  *  Make file sparse if there's more than gap consecutive '\0',
   26  * and if gap != 0
   27  *  Return -1 and set errno if failed, -2 if canceled, anything else
   28  *  if succeded
   29  *  This part is crucial as it is the one which do the job and
   30  * which can break file, it have been carfully read and tested
   31  * so it would be dangerous to rewrite it... however it's
   32  * big and ugly -_-.
   33  */
   34 int fcopy (int in_fd, int out_fd, size_t gap, bool stop_if_input_unlocked);
   35 
   36 /*  Make a backup of a file, truncate original to 0, then copy
   37  * the backup over it.
   38  * This can be called only when the file is *read* locked. It will
   39  * take a write lock while operating.
   40  * This can be called only when in NORMAL mode. It internally set the
   41  * CRITICAL mode but goes back in NORMAL mode before returning.
   42  */
   43 int shake_reg (struct accused *a, struct law *l);
   44 
   45 
   46 /* Return an array containing file names in the named directory,
   47  * excepted "." and "..".
   48  * Return NULL in case of error.
   49  * If sort is true, file names are sorted by atime.
   50  * LIMIT : INT_MAX files
   51  */
   52 char **list_dir (char *name, int sort);
   53 
   54 /* Return an array containing file names given in stdin
   55  * excepted "." and "..".
   56  * File names are sorted by atime.
   57  * LIMIT : INT_MAX files
   58  */
   59 char **list_stdin (void);
   60 
   61 /* Free arrays allocated by list_dir()
   62  */
   63 void close_list (char **flist);
   64 #endif