Main Page   Modules   Data Structures   File List   Data Fields   Globals  

libdarc.h

Go to the documentation of this file.
00001 /*
00002  * libdarc.h
00003  * Created on 13 Feb 2005
00004  * Authors:
00005  *    Wesley Leggette <wleggette@kaylix.net>
00006  * 
00007  * 
00008  * 
00009  * libdarc
00010  * 
00011  * 
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  * 
00026  * $Id: libdarc_8h-source.html 708 2005-03-21 12:30:37Z leggwes $
00027  */
00028 
00034 #ifndef LIBDARC_H
00035 #define LIBDARC_H
00036 
00037 
00038 #include "translations.h"
00039 #include "mask.h"
00040 #include "user_interaction.h"
00041 #include "path.h"
00042 #include "statistics.h"
00043 #include "tools.h"
00044 
00045 NAMESPACE_LIBDAR_START
00046 
00047 #ifdef __cplusplus
00048 extern "C"
00049 {
00050 #endif
00051 
00052 
00077 #define LIBDAR_XXXXXXXX
00078 #define LIBDAR_NOEXCEPT 0       
00079 #define LIBDAR_EMEMORY 1        
00080 #define LIBDAR_EBUG 2           
00081 #define LIBDAR_EINFININT 3      
00082 #define LIBDAR_ELIMITINT 4      
00083 #define LIBDAR_ERANGE 5         
00084 #define LIBDAR_EDECI 6          
00085 #define LIBDAR_EFEATURE 7       
00086 #define LIBDAR_EHARDWARE 8      
00087 #define LIBDAR_EUSER_ABORT 9    
00088 #define LIBDAR_EDATA 10         
00089 #define LIBDAR_ESCRIPT 11       
00090 #define LIBDAR_ELIBCALL 12      
00091 #define LIBDAR_UNKNOWN 13       
00092 #define LIBDAR_ECOMPILATION 14  
00104 #define LIBDAR_X_EINPUTSPEC 55  
00265 typedef enum 
00266 {
00267     dar_compression_none = 'n', 
00268     dar_compression_zip = 'p', 
00269     dar_compression_gzip = 'z', 
00270     dar_compression_bzip2 = 'y' 
00271 } dar_compression_algorithm;
00272 
00274 typedef enum 
00275 {
00276     dar_crypto_none = 0,        
00277     dar_crypto_scrambling = 1,  
00278     dar_crypto_blowfish = 2     
00279 } dar_encryption_algorithm;
00280 
00281 
00310 typedef struct /* dar_sup_libversion */
00311 {
00312     U_I major;  
00313     U_I minor; 
00314     U_I micro;  
00315     U_16 exception;     
00316     intptr_t   : 16;                /* reserved for future use  */
00317     intptr_t   : 32;                /* reserved for future use  */
00318     
00324     char* except_msg;   
00327     intptr_t   : __WORDSIZE;        /* reserved for future use */
00328     intptr_t   : __WORDSIZE;        /* reserved for future use */
00329 } dar_sup_libversion; /* assert sizeof() == (32) 32, (64) 44 */
00330 
00334 DLLIMPORT void dar_sup_libversion_destroy( dar_sup_libversion* ref );
00354 DLLIMPORT bool dar_op_library_init( dar_sup_libversion* inout );
00355 
00368 #define DAR_LIBRARY_INIT_MACRO(ref) \
00369 ref.major = LIBDARC_MAJOR_VERSION; \
00370 ref.minor = LIBDARC_MINOR_VERSION; \
00371 ref.micro = LIBDARC_MICRO_VERSION; \
00372 dar_op_library_init(&ref)                       
00373 
00374 
00375 
00378 typedef struct /* dar_sup_libfeature */
00379 {
00380     bool ea : 1;                
00381     bool largefile : 1;         
00382     bool nodump : 1;            
00383     bool special_alloc : 1;     
00384     bool thread_safe : 1;       
00386     intptr_t    : 7;                /* reserved for future use (flag value)     */
00387     
00388     bool libz : 1;              
00389     bool libbz2 : 1;            
00390     bool libcrypto : 1;         
00392     intptr_t    : 13;               /* reserved for future use (flag value)     */
00393     intptr_t    : 32;               /* reserved for future use (flag value)     */
00394     
00395     U_I os_bits;                
00396     intptr_t   : 32;                /* reserved for future use (integer value)  */
00397     intptr_t   : 32;                /* reserved for future use (integer value)  */
00398     intptr_t   : 32;                /* reserved for future use (integer value)  */
00399     
00400     intptr_t   : __WORDSIZE;        /* reserved for pointer (future expansion)  */
00401     
00402 } dar_sup_libfeature; /* assert sizeof() == (32) 28, (64) 32 */
00403 
00407 DLLIMPORT void dar_sup_libfeature_destroy( dar_sup_libfeature* ref );
00419 DLLIMPORT void dar_op_libfeature_query( dar_sup_libfeature* ref );
00420 
00421 
00428 struct _dar_archive;
00429 typedef struct  _dar_archive dar_archive;
00430 
00432 DLLIMPORT void dar_archive_destroy(dar_archive* ref);
00433 
00434 
00449 typedef struct /* dar_sup_spec */                   /* Rename of...             */
00450 {
00471     char*                       root_path;          /* fs_root                  */
00472     
00473     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00474     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00475     
00496     char*                       arc_path;           /* sauv_path or chem        */
00517     char*                       arc_name;           /* filename                 */
00538     char*                       arc_ext;            /* extension                */
00539     
00540     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00541     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00542 
00563     char*                       input_pipe;         /* input_pipe               */
00584     char*                       output_pipe;        /* output_pipe              */
00585     
00586     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00587     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00588     
00609     dar_mask*                   selection;          /* selection                */
00630     dar_mask*                   subtree;            /* subtree                  */
00631     
00632     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00633     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00634 } dar_sup_spec; /* assert sizeof() == (32) 64, (64) 128 */
00635 
00646 DLLIMPORT bool dar_sup_spec_defaults( dar_sup_spec* ref );
00651 DLLIMPORT void dar_sup_spec_destroy( dar_sup_spec* ref );
00652 
00659 typedef struct /* dar_sup_storage */                /* Rename of...             */
00660 {
00682     dar_compression_algorithm   compress_algo;      /* algo                     */
00703     U_I                         compress_level;     /* compression_level        */
00724     dar_mask*                   compress_mask;      /* compr_mask               */
00745     dar_infinint*               compress_min_size;  /* min_compr_size           */
00746     
00747     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00748     
00770     dar_encryption_algorithm    crypto_algo;        /* crypto                   */
00792     U_32                        crypto_size;        /* crypto_size              */  
00814     char*                       crypto_pass;        /* pass                     */
00815     
00816     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00817     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00818     
00840     dar_infinint*               file_size;          /* file_size                */
00863     dar_infinint*               first_file_size;    /* first_file_size          */
00864     
00865     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00866     intptr_t   : 32;                                /* reserved for future use  */
00867     intptr_t   : 32;                                /* reserved for future use  */
00868     
00897     char*                       slice_execute;      /* execute                  */
00922     dar_infinint*               hourshift;          /* hourshift                */
00923     
00924     intptr_t   : __WORDSIZE ;                       /* reserved for future use  */
00925 } dar_sup_storage; /* assert sizeof() == (32) 72, (64) 120 */
00926 
00937 DLLIMPORT bool dar_sup_storage_defaults( dar_sup_storage* ref );
00942 DLLIMPORT void dar_sup_storage_destroy( dar_sup_storage* ref );
00943 
00944 
00951 typedef struct /* dar_sup_flags */                      /* Rename of...             */
00952 {
00973     bool                        allow_overwrite : 1;    /* allow_over               */
00994     bool                        warn_overwrite : 1;     /* warn_over                */
01015     bool                        slice_pause : 1;        /* pause                    */
01036     bool                        create_empty_stubs : 1; /* empty_dir                */
01057     bool                        ea_system : 1;          /* root_ea                  */
01078     bool                        ea_user : 1;            /* user_ea                  */
01099     bool                        no_dump : 1;            /* nodump                   */
01120     bool                        ignore_owner : 1;       /* ignore_owner             */
01141     bool                        test_run : 1;           /* empty                    */
01165     bool                        alter_atime : 1;        /* alter_atime              */
01186     bool                        same_fs : 1;            /* same_fs                  */
01208     bool                        delete_marked : 1;      /* detruire                 */
01209     
01210     intptr_t     : 4;                                   /* reserved for future use  */
01211     intptr_t     : 16;                                  /* reserved for future use  */
01212     
01233     bool                        restore_flat : 1;       /* flat                     */
01255     bool                    warn_remove_no_match : 1;   /* warn_remove_no_match     */
01277     bool                        only_more_recent : 1;   /* only_more_recent         */
01278     
01279     intptr_t     : 13;                                  /* reserved for future use  */
01280     
01301     bool                        tar_format : 1;         /* tar_format               */
01322     bool                        filter_unsaved : 1;     /* filter_unsaved           */
01323     
01324     intptr_t     : 14;                                  /* reserved for future use  */
01325 } dar_sup_flags; /* assert sizeof() == 8 */
01326 
01331 DLLIMPORT void dar_sup_flags_defaults( dar_sup_flags* ref );
01332 
01361 typedef struct /* dar_sup_exception */
01362 {
01364     U_16 type;
01365     intptr_t  : 16; /* reserved for future use */
01369     char* message;
01370 } dar_sup_exception; /* assert sizeof() = (32) 8, (64) 12 */
01371 
01376 DLLIMPORT void dar_sup_exception_destroy( dar_sup_exception* ref );
01377 
01378 
01454 DLLIMPORT dar_archive*  dar_op_archive_create(  
01455                             dar_user_interaction_struct     dialog,
01456                             dar_archive*                    ref_archive,
01457                             dar_sup_spec                    archive_options,
01458                             dar_sup_storage                 format_options,
01459                             dar_sup_flags                   option_flags,
01460                             dar_statistics*                 operation_stats,
01461                             dar_sup_exception*              exception
01462                         );
01463 
01520 DLLIMPORT bool          dar_op_archive_get_children_of(
01521                             dar_user_interaction_struct     dialog,
01522                             dar_archive*                    archive,
01523                             char*                           directory,
01524                             dar_sup_exception*              exception
01525                         );
01526 
01584 DLLIMPORT dar_archive*  dar_op_archive_isolate(
01585                             dar_user_interaction_struct     dialog,
01586                             dar_archive*                    ref_archive,
01587                             dar_sup_spec                    archive_options,
01588                             dar_sup_storage                 format_options,
01589                             dar_sup_flags                   option_flags,
01590                             dar_sup_exception*              exception
01591                         );
01592 
01656 DLLIMPORT bool          dar_op_archive_diff(
01657                             dar_user_interaction_struct     dialog,
01658                             dar_archive*                    archive,
01659                             dar_sup_spec                    archive_options,
01660                             dar_sup_flags                   option_flags,
01661                             dar_statistics*                 operation_stats,
01662                             dar_sup_exception*              exception
01663                         );
01664 
01730 DLLIMPORT bool          dar_op_archive_extract(
01731                             dar_user_interaction_struct     dialog,
01732                             dar_archive*                    archive,
01733                             dar_sup_spec                    archive_options,
01734                             dar_sup_storage                 format_options,
01735                             dar_sup_flags                   option_flags,
01736                             dar_statistics*                 operation_stats,
01737                             dar_sup_exception*              exception
01738                         );
01739 
01795 DLLIMPORT bool          dar_op_archive_list(
01796                             dar_user_interaction_struct     dialog,
01797                             dar_archive*                    archive,
01798                             dar_sup_spec                    archive_options,
01799                             dar_sup_flags                   option_flags,
01800                             dar_sup_exception*              exception
01801                         );
01802 
01868 DLLIMPORT bool          dar_op_archive_test(
01869                             dar_user_interaction_struct     dialog,
01870                             dar_archive*                    archive,
01871                             dar_sup_spec                    archive_options,
01872                             dar_statistics*                 operation_stats,
01873                             dar_sup_exception*              exception
01874                         );
01875 
01930 DLLIMPORT bool          dar_op_archive_close(
01931                             dar_archive*                    archive,
01932                             dar_sup_exception*              exception
01933                         );
01934 
01987 DLLIMPORT dar_archive*  dar_op_archive_open(
01988                             dar_user_interaction_struct     dialog,
01989                             dar_sup_spec                    archive_options,
01990                             dar_sup_storage                 format_options,
01991                             dar_sup_exception*              exception
01992                         );
01993 
01994 
02002 #ifdef __cplusplus
02003 }
02004 #endif
02005 
02006 
02007 
02008 
02009 NAMESPACE_LIBDAR_END
02010 
02011 
02012 
02013 #endif /* end of LIBDARC_H */
02014 
02015 
02016 
02017 
02018