src/cmd/fsexam/src/file-validate.h
changeset 149 0014c9b031e9
parent 147 8c4ef02c14b8
equal deleted inserted replaced
148:91c620d9e52f 149:0014c9b031e9
       
     1 /*
       
     2  * CDDL HEADER START
       
     3  *
       
     4  * The contents of this file are subject to the terms of the
       
     5  * Common Development and Distribution License (the "License").
       
     6  * You may not use this file except in compliance with the License.
       
     7  *
       
     8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9  * or http://www.opensolaris.org/os/licensing.
       
    10  * See the License for the specific language governing permissions
       
    11  * and limitations under the License.
       
    12  *
       
    13  * When distributing Covered Code, include this CDDL HEADER in each
       
    14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15  * If applicable, add the following below this CDDL HEADER, with the
       
    16  * fields enclosed by brackets "[]" replaced with your own identifying
       
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
       
    18  *
       
    19  * CDDL HEADER END
       
    20  */
       
    21 
       
    22 /*
       
    23  * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
       
    24  * Use is subject to license terms.
       
    25  */
       
    26 
       
    27 #ifndef _FILE_VALIDATE_H
       
    28 #define _FILE_VALIDATE_H
       
    29 
       
    30 /*
       
    31  * file-validate.h
       
    32  *
       
    33  * Given a filename, determine whether it pass some criteria.
       
    34  *
       
    35  * Options:
       
    36  *      - '--follow': handle at preprocessing stage
       
    37  *      - '--symlink-target': handle at tree constructing stage
       
    38  * 
       
    39  * For filename conversion:
       
    40  *      - Filter only directory/reg/symbolic file out
       
    41  *      - Hidden flags
       
    42  *      - Forceful conversion
       
    43  *      - follow: this will be handled in fsexam-preprocessing.c
       
    44  *      - remote file
       
    45  *      - no-check-symlink-target
       
    46  *
       
    47  * For file content conversion:
       
    48  *      - Filter only dir/regular/symbolic file out
       
    49  *      - Hidden flags
       
    50  *      - Forceful conversion
       
    51  *      - Is plain text
       
    52  *      - Special file such as .tar, .zip
       
    53  *      - follow: this will be handled in fsexam-preprocessing.c
       
    54  *      - remote file
       
    55  */
       
    56 
       
    57 /*============================================================================
       
    58  *  Function Name:  file_validate_for_contentconv
       
    59  *
       
    60  *  Parameters:
       
    61  *      gchar *filename: the filename we will validate
       
    62  *      VALIDATE_flag *flag: struct contain flags used to validate file
       
    63  *
       
    64  *  Desc:
       
    65  *      file_validate_for_contentconv() determine whether fsexam will handling 
       
    66  *      its content or not.
       
    67  *
       
    68  *  Return value:
       
    69  *      True if fsexam will handle this file.
       
    70  *      Otherwise False.
       
    71  *
       
    72  *  Author:     Yandong Yao 2006/08/24
       
    73  ===========================================================================*/
       
    74 gboolean file_validate_for_contentconv(
       
    75                             const gchar *filename, 
       
    76                             FSEXAM_setting *setting);
       
    77 
       
    78 /*============================================================================
       
    79  *  Function Name:  file_validate_for_nameconv
       
    80  *
       
    81  *  Parameters:
       
    82  *      gchar *filename: the filename we will validate
       
    83  *      VALIDATE_flag *flag: struct contain flags used to validate file
       
    84  *
       
    85  *  Desc:
       
    86  *      file_validate_for_nameconv() will determine whether fsexam will 
       
    87  *      convert filename or not.
       
    88  *
       
    89  *  Return value:
       
    90  *      True if fsexam will handle this file's name, otherwise False
       
    91  *
       
    92  *  Author:     Yandong Yao 2006/08/24
       
    93  ==========================================================================*/
       
    94 gboolean file_validate_for_nameconv(const gchar *filename, 
       
    95                                     struct stat *statbuf, 
       
    96                                     FSEXAM_setting *setting);
       
    97 
       
    98 GList    *get_remote_paths ();
       
    99 gboolean is_remote_file (GList *remote_path, const gchar *filename);
       
   100 
       
   101 #endif //_FSEXAM_VALIDATE_H