Skip to content

arclite plugin #2670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a3c85e9
hello arclite
anta999 Feb 16, 2025
33ce2d5
fix0
anta999 Feb 16, 2025
90a6428
fix1
anta999 Feb 16, 2025
63fe70b
fix2
anta999 Feb 16, 2025
fef2ce3
fix3
anta999 Feb 16, 2025
33e9d68
fix4
anta999 Feb 16, 2025
90ddee0
сommented out in CMakeLists.txt
anta999 Feb 16, 2025
8524649
fix extracting symlinks
anta999 Feb 17, 2025
5e8f1a6
uncomment cfg code
anta999 Feb 17, 2025
838adf4
Patch7zCP updated
anta999 Feb 25, 2025
54be11e
Merge branch 'master' of github.com:elfmz/far2l into arclite2
anta999 Feb 25, 2025
8beba59
fix0
anta999 Feb 25, 2025
52be14b
fix1
anta999 Feb 25, 2025
1009473
fix2
anta999 Feb 28, 2025
fb92852
winport for cp
anta999 Feb 28, 2025
89b5bdb
add ver2
anta999 Feb 28, 2025
636f8b7
fix9
anta999 Feb 28, 2025
4cd5b64
config update
anta999 Mar 3, 2025
0039a11
fix defaults
anta999 Mar 3, 2025
d98c9b7
Merge branch 'master' of github.com:elfmz/far2l into arclite2
anta999 Mar 3, 2025
1025890
fix stdf plugin order
anta999 Mar 14, 2025
0eae609
fix err
anta999 Mar 14, 2025
3be08d6
Support for nested tar archives
anta999 Mar 22, 2025
56398da
128 to 64
anta999 Mar 22, 2025
09e7ec0
Fixed process priority in ProgressMonitor
anta999 Mar 23, 2025
1c9e1d0
The patch is disabled by default, and the first patch method is disabled
anta999 Mar 23, 2025
c5f4304
fix progress bar
anta999 Apr 3, 2025
10b7afd
conflict fix
anta999 Apr 3, 2025
5351f6f
Do not show update dialog when 7s.so is absent
anta999 Apr 10, 2025
fddc241
Merge branch 'master' of github.com:elfmz/far2l into arclite2
anta999 Apr 10, 2025
b03f098
dateformat and def_button fix
anta999 Apr 14, 2025
22d5442
move to src dir
anta999 Apr 15, 2025
00858e9
mc fix
anta999 May 3, 2025
2f2a853
add p7zip support
anta999 May 8, 2025
222e91e
Merge branch 'master' of github.com:elfmz/far2l into arclite2
anta999 May 8, 2025
bd412b8
some fixes
anta999 May 8, 2025
668d0b0
Merge branch 'master' of github.com:elfmz/far2l into arclite2
anta999 May 21, 2025
aa0cf9a
F_ASYNC removed
anta999 May 31, 2025
3c46e4d
Merge branch 'master' of github.com:elfmz/far2l into arclite2
anta999 May 31, 2025
5e3f19c
sync with far3
anta999 Jun 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ else()
" COMPONENT system)
endif()

if (NOT DEFINED ARCLITE OR ARCLITE)
message(STATUS "ARCLITE plugin enabled")
add_subdirectory (arclite)
else()
message(STATUS "${ColorRed}ARCLITE plugin disabled due to ARCLITE=${ARCLITE}${ColorNormal}")
install(CODE "
execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_INSTALL_PREFIX}/lib/far2l/Plugins/arclite/plug/arclite.far-plug-wide)
" COMPONENT system)
endif()

if (NOT DEFINED MULTIARC OR MULTIARC)
message(STATUS "MULTIARC plugin enabled")

Expand Down
2 changes: 2 additions & 0 deletions WinPort/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ src/APIRegistry.cpp
src/APIStringCodepages.cpp
src/APIStringMap.cpp
src/APITime.cpp
src/APIThread.cpp
src/APIMemory.cpp
src/ConsoleBuffer.cpp
src/ConsoleInput.cpp
src/ConsoleOutput.cpp
Expand Down
80 changes: 74 additions & 6 deletions WinPort/WinCompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ typedef const wchar_t *LPCWSTR;
typedef wchar_t *LPWSTR;
typedef wchar_t *PWSTR;

#define LPCTSTR LPCWSTR
//#define LPCTSTR LPCWSTR
#define LPTSTR LPWSTR

typedef wchar_t WCHAR;
Expand All @@ -159,10 +159,21 @@ typedef SHORT *PSHORT;
typedef LONGLONG *PLONGLONG;
typedef ULONGLONG *PULONGLONG;

#define TCHAR WCHAR

//#define TCHAR WCHAR
#define CONST const

//typedef const CHAR *LPCSTR;
//typedef CHAR TCHAR;
typedef WCHAR TCHAR;
typedef const TCHAR *LPCTSTR;

//typedef wchar_t WCHAR;
typedef WCHAR OLECHAR;
//typedef const WCHAR *LPCWSTR;
typedef OLECHAR *BSTR;
typedef const OLECHAR *LPCOLESTR;
typedef OLECHAR *LPOLESTR;

typedef int BOOL;
typedef UCHAR BOOLEAN;
typedef BOOL *LPBOOL, *PBOOL;
Expand All @@ -176,7 +187,6 @@ typedef ULONG LCID; // winnt
typedef PULONG PLCID; // winnt
typedef USHORT LANGID; // winnt


typedef HANDLE HKEY;
typedef struct _OVERLAPPED *LPOVERLAPPED;
typedef HKEY *PHKEY;
Expand All @@ -187,6 +197,16 @@ typedef ACCESS_MASK REGSAM;

typedef int HRESULT;

typedef ULONG PROPID;
typedef LONG SCODE;

typedef int EXECUTION_STATE;

#define ES_AWAYMODE_REQUIRED 0x00000040
#define ES_CONTINUOUS 0x80000000
#define ES_DISPLAY_REQUIRED 0x00000002
#define ES_SYSTEM_REQUIRED 0x00000001
#define ES_USER_PRESENT 0x00000004

#ifndef _T
# define _T(x) L##x
Expand Down Expand Up @@ -248,6 +268,14 @@ typedef struct _FILETIME {
#endif
} FILETIME, *PFILETIME, *LPFILETIME;

typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD64 nFileSize;
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;

typedef union _LARGE_INTEGER {
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
struct {
Expand Down Expand Up @@ -297,7 +325,19 @@ typedef union _ULARGE_INTEGER {
typedef ULARGE_INTEGER *PULARGE_INTEGER;

typedef struct _SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;

typedef ULONGLONG DWORDLONG, *PDWORDLONG;

typedef struct _MEMORYSTATUSEX {
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;

typedef struct _SYSTEMTIME {
WORD wYear;
Expand Down Expand Up @@ -344,6 +384,16 @@ typedef struct _WIN32_FIND_DATAW {
WCHAR cFileName[ MAX_NAME ];
} WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW, WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;

typedef struct _BY_HANDLE_FILE_INFORMATION {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD dwVolumeSerialNumber;
DWORD64 nFileSize;
DWORD nNumberOfLinks;
DWORD64 nFileIndex;
} BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION;

//////////////////

Expand Down Expand Up @@ -955,6 +1005,7 @@ typedef void *HMODULE;
#define FILE_SHARE_READ 0x00000001
#define FILE_SHARE_WRITE 0x00000002
#define FILE_SHARE_DELETE 0x00000004

#define FILE_ATTRIBUTE_READONLY 0x00000001
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
Expand All @@ -970,8 +1021,12 @@ typedef void *HMODULE;
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
#define FILE_ATTRIBUTE_INTEGRITY_STREAM 0x00008000
#define FILE_ATTRIBUTE_VIRTUAL 0x00010000
#define FILE_ATTRIBUTE_VIRTUAL 0x00010000 // ======
#define FILE_ATTRIBUTE_NO_SCRUB_DATA 0x00020000
#define FILE_ATTRIBUTE_EA 0x00040000
#define FILE_ATTRIBUTE_PINNED 0x00080000
#define FILE_ATTRIBUTE_UNPINNED 0x00100000

#define FILE_ATTRIBUTE_BROKEN 0x00200000
#define FILE_ATTRIBUTE_EXECUTABLE 0x00400000
#define FILE_ATTRIBUTE_DEVICE_CHAR 0x00800000
Expand Down Expand Up @@ -1499,6 +1554,19 @@ typedef BOOL (*WINPORT_HANDLER_ROUTINE)( DWORD CtrlType );
#ifndef OCCASIONAL_WINDOWS_H
#define HINSTANCE HANDLE

#define THREAD_BASE_PRIORITY_LOWRT 15 // value that gets a thread to LowRealtime-1
#define THREAD_BASE_PRIORITY_MAX 2 // maximum thread base priority boost
#define THREAD_BASE_PRIORITY_MIN (-2) // minimum thread base priority boost
#define THREAD_BASE_PRIORITY_IDLE (-15) // value that gets a thread to idle

#define THREAD_PRIORITY_NORMAL 0
#define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
#define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
#define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)

#define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE

typedef WINPORT_HANDLER_ROUTINE PHANDLER_ROUTINE;
typedef WINPORT_THREAD_START_ROUTINE LPTHREAD_START_ROUTINE, PTHREAD_START_ROUTINE;

Expand Down
10 changes: 10 additions & 0 deletions WinPort/WinPortDecl.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
WINPORT_DECL_DEF(FindNextFile, BOOL, (HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData))
WINPORT_DECL_DEF(FindClose, BOOL, (HANDLE hFindFile))

WINPORT_DECL_DEF(GetTempFileName, UINT,( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR buffer ))
WINPORT_DECL_DEF(GetFullPathName, DWORD, (LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR *lpFilePart))

#if 0
// not implemented
WINPORT_DECL_DEF(GetDriveType, UINT, (LPCWSTR lpRootPathName))
Expand Down Expand Up @@ -220,3 +223,10 @@
WINPORT_DECL_DEF(VkKeyScan, SHORT, (WCHAR ch))
WINPORT_DECL_DEF(ToUnicodeEx, int, (UINT wVirtKey, UINT wScanCode, CONST BYTE *lpKeyState,
LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl))

//mem
WINPORT_DECL_DEF(GlobalMemoryStatusEx, BOOL, (LPMEMORYSTATUSEX lpBuffer))

// thread
WINPORT_DECL_DEF(SetThreadExecutionState, EXECUTION_STATE, (EXECUTION_STATE es))
WINPORT_DECL_DEF(SetThreadPriority, BOOL, (int nPriority))
95 changes: 95 additions & 0 deletions WinPort/src/APIFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,4 +972,99 @@ extern "C"
return TRUE;
}

WINPORT_DECL(GetTempFileName, UINT,( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR buffer ))
{
static const WCHAR formatW[] = {'%','x','.','t','m','p',0};
int i;
LPWSTR p;
DWORD attr;

if ( !path || !buffer )
{
WINPORT(SetLastError)( ERROR_INVALID_PARAMETER );
return 0;
}

/* ensure that the provided directory exists */
attr = WINPORT(GetFileAttributes)(path);
if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
{
WINPORT(SetLastError)( ERROR_DIRECTORY );
return 0;
}

size_t path_len = wcslen(path);
if (path_len>=MAX_PATH) {
WINPORT(SetLastError)( ERROR_INVALID_NAME);
return 0;
}
wcscpy( buffer, path );
p = buffer + path_len;

/* add a \, if there isn't one */
if ((p == buffer) || (p[-1] !=GOOD_SLASH)) *p++ = GOOD_SLASH;

if (prefix)
for (i = 3; (i > 0) && (*prefix); i--) *p++ = *prefix++;

unique &= 0xffff;

if (unique) swprintf( p, MAX_PATH - 1 - (p - buffer), formatW, unique );
else
{
/* get a "random" unique number and try to create the file */
UINT num = WINPORT(GetTickCount)() & 0xffff;
static UINT last;

/* avoid using the same name twice in a short interval */
if (last - num < 10) num = last + 1;
if (!num) num = 1;
unique = num;
std::string path_mb;
do {
swprintf( p, MAX_PATH - 1 - (p - buffer), formatW, unique );
Wide2MB(buffer, path_mb);
int fd = sdc_open(path_mb.c_str(), O_RDWR | O_CREAT | O_EXCL, 0640);
if (fd != -1) {
/* We created it */
sdc_close(fd);
last = unique;
break;
}
int err = errno;
if (err != EEXIST && err != EBUSY && err != ETXTBSY)
break; /* No need to go on */
if (!(++unique & 0xffff)) unique = 1;
} while (unique != num);
}

return unique;
}

WINPORT_DECL(GetFullPathName, DWORD,
(LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR *lpFilePart))
{
std::wstring full_name;
if (*lpFileName!=GOOD_SLASH) {
WCHAR cd[MAX_PATH+1] = {0};
WINPORT(GetCurrentDirectory)( MAX_PATH, cd);
full_name = cd;
if (*lpFileName!='.') {
full_name+=GOOD_SLASH;
full_name+= lpFileName;
} else
full_name+= lpFileName + 1;
} else
full_name = lpFileName;
if (nBufferLength<=full_name.size())
return full_name.size() + 1;

memcpy(lpBuffer, full_name.c_str(), (full_name.size() + 1) * sizeof(WCHAR));
if (lpFilePart) {
WCHAR *slash = wcsrchr(lpBuffer, GOOD_SLASH);
*lpFilePart = slash ? slash + 1 : lpBuffer;
}
return full_name.size();
}

}
Loading