Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
extract_kkk.c File Reference

Go to the source code of this file.

Macros

#define IS_ABSOLUTE_PATH(P)
 
#define IS_PATH_WITH_DIR(P)
 
#define e_free   free
 
#define e_malloc   malloc
 
#define ARCHIVE_LITERAL_LL(x)
 
#define ARCHIVE_LITERAL_ULL(x)
 
#define EPOC_TIME   ARCHIVE_LITERAL_ULL(116444736000000000)
 
#define WINTIME(sec, nsec)
 

Typedefs

typedef int(* tar_extractor_t) (char *file_name, int typeflag)
 

Functions

int __stdcall get_extraction_progress_information_ar (char *warning_ar, char *filename_ar, char *folder_feline)
 
void extract_archive (void)
 
bool contains_dot_dot (char const *name)
 
void trocadordebackslashtras (char *path)
 
int rspmakedir (char *path)
 
int ispathfolder (char *path)
 
int ispathreadonly (char *path)
 
int createtestfilename (char *path1)
 
char * strrstr (char *s1, char *s2)
 
int ispathfile (char *path)
 
int rspmakedir_v2 (char *path)
 
int stripfilenameandpath_unix_arp (char *path, char *onlypath, char *onlyfilename)
 
int stripfilenameandpath (char *path, char *onlypath, char *onlyfilename)
 
int __stdcall stripfilenameandpath_amanda_s_smart_ape (char *path, char *onlypath, char *onlyfilename)
 
char * strrstr_ends_with (char *str, char *substr)
 
bool __amandacall is_compressed_z (char *filename_in_z)
 
void __amandacall adjust_extension_z (char *filename_in_z, char *filename_out_z)
 
void __stdcall replace_extension_arp (char *whole_path_arp, char *new_extension_arp, char *out_data_arp)
 
int createtempfilename_and_keep_z (char *path1, char *out_z, WCHAR *signature_z)
 
bool is_encrypted_gnu_tar_arp (char *file_arp_utf_8)
 
int __fastcall ricardo_convert_m (int a_m, int b_m, SYSTEMTIME *smtime)
 
void TimetToFileTime (time_t t, LPFILETIME pft)
 

Variables

int encryption_detected_z = -1
 
GLOBAL bool absolute_names_option = false
 

Macro Definition Documentation

◆ ARCHIVE_LITERAL_LL

#define ARCHIVE_LITERAL_LL ( x)
Value:
x##ll

◆ ARCHIVE_LITERAL_ULL

#define ARCHIVE_LITERAL_ULL ( x)
Value:
x##ull

◆ e_free

#define e_free   free

◆ e_malloc

#define e_malloc   malloc

◆ EPOC_TIME

#define EPOC_TIME   ARCHIVE_LITERAL_ULL(116444736000000000)

◆ IS_ABSOLUTE_PATH

#define IS_ABSOLUTE_PATH ( P)
Value:
ISSLASH((P)[0])
#define ISSLASH(C)
Definition sparse_2_k.c:110
#define P(a, b, c, d, k, s, t)

◆ IS_PATH_WITH_DIR

#define IS_PATH_WITH_DIR ( P)
Value:
(strchr(P, '/') != NULL)
#define NULL
Definition getopt1.c:37

◆ WINTIME

#define WINTIME ( sec,
nsec )
Value:
((Int32x32To64(sec, 10000000) + EPOC_TIME) + \
(((nsec) / 1000) * 10))
#define EPOC_TIME
Definition extract_kkk.c:2431

Typedef Documentation

◆ tar_extractor_t

typedef int(* tar_extractor_t) (char *file_name, int typeflag)

Function Documentation

◆ adjust_extension_z()

void __amandacall adjust_extension_z ( char * filename_in_z,
char * filename_out_z )

It will just add to the filename_out_z the extension of the filename_in_z, because some compression formats like lzma and brotli needs always the correct extension to extrac or list process

Parameters
filename_in_zthe input filename
filename_out_zthe output file that will have the extension adjusted
Returns
void

◆ contains_dot_dot()

bool contains_dot_dot ( char const * name)

Tar related function, version 1.34 Return nonzero if NAME contains ".." as a file name component.

◆ createtempfilename_and_keep_z()

int createtempfilename_and_keep_z ( char * path1,
char * out_z,
WCHAR * signature_z )

It will just create a windows based temp file using the signature_z information

Parameters
path1the path where it will create
out_zthe utf-8 encoded temp file
signature_zthe 3 characters to be used as the initial data on the destination temp file
Returns
0 on error, 1 otherwise

◆ createtestfilename()

int createtestfilename ( char * path1)

It will create a test filename on the given path and delete it just to see if it is writable

Parameters
path1the folder where the file need to be created
Returns
0 on error, 1 otherwise

◆ extract_archive()

void extract_archive ( void )

Tar related function, version 1.34 Extract a file from the archive.

◆ get_extraction_progress_information_ar()

int __stdcall get_extraction_progress_information_ar ( char * warning_ar,
char * filename_ar,
char * folder_feline )

It will retrieve the extraction information for each call, see the sample project to see how to use it correctly

Parameters
warning_arthe warning information if any
filename_arthe filename that was just extracted
folder_felineif it was a folder
Returns
always 0

◆ is_compressed_z()

bool __amandacall is_compressed_z ( char * filename_in_z)

It will read the extension to detect whether the file is a valid compressed file, wide path capable my ric...

Parameters
filename_in_zthe filename
Returns
0 if not compressed, 1 otherwise

◆ is_encrypted_gnu_tar_arp()

bool is_encrypted_gnu_tar_arp ( char * file_arp_utf_8)

Wide path capable, only for Tar files, it will check to see if in the file the information stored during the encryption is available, and if yes what is the encryption used, notice that for the moment the only software capable of using these encryption methods is the Parolin project, loading these encrypted files with tar.exe or Winrar or 7zip will only report an invalid Tar file

Parameters
file_arp_utf_8the file to test, utf-8 based
Returns
false if not encrypted, true otherwise

◆ ispathfile()

int ispathfile ( char * path)

It will test the utf-8 encoded path to see if it do exist and is a file

Parameters
pathutf-8 encoded path to test
Returns
0 if the path is not a file or valid, 1 if it is a readable file

◆ ispathfolder()

int ispathfolder ( char * path)

To know whether the path is valid and a folder

Parameters
paththe path to test
Returns
0, if invalid or not a folder, 1 if it is a folder

◆ ispathreadonly()

int ispathreadonly ( char * path)

To know whether the path is read-only

Parameters
paththe path to test
Returns
1 if the path is read-only, -1 on error and 0 otherwise (if not read-only)

◆ replace_extension_arp()

void __stdcall replace_extension_arp ( char * whole_path_arp,
char * new_extension_arp,
char * out_data_arp )

It will replace the extension with a new one provided

Parameters
whole_path_arpthe input path
new_extension_arpthe new extension
out_data_arpthe output file

◆ ricardo_convert_m()

int __fastcall ricardo_convert_m ( int a_m,
int b_m,
SYSTEMTIME * smtime )

◆ rspmakedir()

int rspmakedir ( char * path)

Function to recursively create a path, it will try to create each subfolder since the first one and not only the last subfolder

Parameters
paththe path to create, cannot be relative (remember it)
Returns
0 if ok, an error otherwise

◆ rspmakedir_v2()

int rspmakedir_v2 ( char * path)

Function to create the whole path, it will try to create each subfolder until the end recursively

Parameters
paththe path to create, cannot be relative (remember it)
Returns
0 if ok, an error otherwise

◆ stripfilenameandpath()

int stripfilenameandpath ( char * path,
char * onlypath,
char * onlyfilename )

It will split the path in folder and file (Windows based), UNC capable too

Parameters
paththe input path
onlypathonly the path, can be NULL if not required
onlyfilenameonly the filename, can be NULL if not required
Returns
always 0

◆ stripfilenameandpath_amanda_s_smart_ape()

int __stdcall stripfilenameandpath_amanda_s_smart_ape ( char * path,
char * onlypath,
char * onlyfilename )

◆ stripfilenameandpath_unix_arp()

int stripfilenameandpath_unix_arp ( char * path,
char * onlypath,
char * onlyfilename )

It will split the path in folder and file (Unix based)

Parameters
paththe input path
onlypathonly the path, can be NULL if not required
onlyfilenameonly the filename, can be NULL if not required
Returns
always 0

◆ strrstr()

char * strrstr ( char * s1,
char * s2 )

It will return the last occurrence of a string inside the string

Parameters
s1the string to search
s2the input string
Returns
a pointer if the string was found or NULL otherwise

◆ strrstr_ends_with()

char * strrstr_ends_with ( char * str,
char * substr )

◆ TimetToFileTime()

void TimetToFileTime ( time_t t,
LPFILETIME pft )

It will convert a time_t unix time to FILETIME

◆ trocadordebackslashtras()

void trocadordebackslashtras ( char * path)

It will replace character '/' with '\' on the given path, very useful to programmers converting code from Unix to Windows... not using cygwin

Parameters
paththe path to replace the character
Returns
void

Variable Documentation

◆ absolute_names_option

GLOBAL bool absolute_names_option = false

◆ encryption_detected_z

int encryption_detected_z = -1