src/cmd/fsexam/src/fsexam-convname.h
author yz157939@agc105
Fri, 25 Apr 2008 17:13:57 +0800
changeset 149 0014c9b031e9
parent 147 8c4ef02c14b8
permissions -rw-r--r--
add fsexam 0.8.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
147
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     1
/*
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     2
 * CDDL HEADER START
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     3
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     5
 * Common Development and Distribution License (the "License").
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     6
 * You may not use this file except in compliance with the License.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     7
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    11
 * and limitations under the License.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    12
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    18
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    19
 * CDDL HEADER END
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    20
 */
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    21
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    22
/*
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    23
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    24
 * Use is subject to license terms.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    25
 */
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    26
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    27
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    28
#ifndef _FSEXAM_CONVNAME_H
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    29
#define _FSEXAM_CONVNAME_H
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    30
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    31
/*===================================================================
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    32
 *  Function Name:  fsexam_convert_single_filename
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    33
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    34
 *  Parameters:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    35
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    36
 *  Desc:   
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    37
 *      Convert single full file path, don't care any other flags, such
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    38
 *      as symlink, recursive etc.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    39
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    40
 *  Return value:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    41
 *      TRUE if success, FALSE if error occured
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    42
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    43
 *  Author:     Yandong Yao 2007/02/06
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    44
 =====================================================================*/
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    45
gboolean fsexam_convert_single_filename (FSEXAM_setting *setting,
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    46
                                         const gchar *filename,
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    47
                                         gchar **result_name);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    48
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    49
/*============================================================================
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    50
 *  Function Name:  fsexam_convert_filename
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    51
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    52
 *  Parameters:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    53
 *      FSEXAM_setting *setting: struct contain all information
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    54
 *      gchar * filename:   the filename which will be converted
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    55
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    56
 *  Desc:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    57
 *      Convert one filename, but maybe convert more than one file, if 
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    58
 *      has follow or recursive options.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    59
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    60
 *  Return value:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    61
 *      True for success otherwise fail
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    62
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    63
 *  Author:     Yandong Yao 2006/08/22
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    64
 ===========================================================================*/ 
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    65
gboolean fsexam_convert_filename (FSEXAM_setting *setting, 
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    66
                                  const gchar *filename);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    67
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    68
/*===========================================================================
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    69
 *  Function Name:  fsexam_convert_filelist 
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    70
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    71
 *  Parameters:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    72
 *      FSEXAM_setting *setting: the all-in-one struct
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    73
 *      GList *list: The list contain file names
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    74
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    75
 *  Desc:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    76
 *      Convert the whole tree structure for list.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    77
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    78
 *  Return value:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    79
 *      TRUE for success, otherwise fail
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    80
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    81
 *  Author:     Yandong Yao 2006/08/22
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    82
 ============================================================================*/
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    83
gboolean fsexam_convert_filename_batch (FSEXAM_setting *setting, GList *list);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    84
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    85
/*====================================================================
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    86
 *  Function Name:  fsexam_convert_scenario
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    87
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    88
 *  Parameters:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    89
 *      FSEXAM_setting *setting: contain the setting 
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    90
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    91
 *  Desc:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    92
 *      Scenario base conversion.  fsexam_dryrun_convert_filename() will convert
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    93
 *      based on dryrun result.
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    94
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    95
 *  Return value:
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    96
 *      TRUE if success, otherwise fail
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    97
 *
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    98
 *  Author:     Yandong Yao 2006/08/31
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
    99
 ========================================================================*/ 
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   100
gboolean fsexam_convert_scenario (FSEXAM_setting *);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   101
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   102
gboolean fsexam_restore (FSEXAM_setting *, GList *list, ConvType restore_type);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   103
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   104
gchar   *find_non_exist_name (const gchar *name);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   105
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   106
/* --------- Default handler ----------------- */
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   107
gint get_index_default (GList *encoding_list, gboolean forname);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   108
void display_msg_default (const gchar *filename, const gchar *msg);
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   109
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   110
8c4ef02c14b8 replace new version of fsexam, old version 0.3.1 is not used any more
yz157939@agc105
parents:
diff changeset
   111
#endif //_FSEXAM_CONVNAME_H