nuke the repo
This commit is contained in:
@@ -1,199 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* dirent.h - dirent API for Microsoft Visual Studio
|
||||
*
|
||||
* Copyright (C) 2006 Toni Ronkko
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* ``Software''), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Dec 15, 2009, John Cunningham
|
||||
* Added rewinddir member function
|
||||
*
|
||||
* Jan 18, 2008, Toni Ronkko
|
||||
* Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string
|
||||
* between multi-byte and unicode representations. This makes the
|
||||
* code simpler and also allows the code to be compiled under MingW. Thanks
|
||||
* to Azriel Fasten for the suggestion.
|
||||
*
|
||||
* Mar 4, 2007, Toni Ronkko
|
||||
* Bug fix: due to the strncpy_s() function this file only compiled in
|
||||
* Visual Studio 2005. Using the new string functions only when the
|
||||
* compiler version allows.
|
||||
*
|
||||
* Nov 2, 2006, Toni Ronkko
|
||||
* Major update: removed support for Watcom C, MS-DOS and Turbo C to
|
||||
* simplify the file, updated the code to compile cleanly on Visual
|
||||
* Studio 2005 with both unicode and multi-byte character strings,
|
||||
* removed rewinddir() as it had a bug.
|
||||
*
|
||||
* Aug 20, 2006, Toni Ronkko
|
||||
* Removed all remarks about MSVC 1.0, which is antiqued now. Simplified
|
||||
* comments by removing SGML tags.
|
||||
*
|
||||
* May 14 2002, Toni Ronkko
|
||||
* Embedded the function definitions directly to the header so that no
|
||||
* source modules need to be included in the Visual Studio project. Removed
|
||||
* all the dependencies to other projects so that this very header can be
|
||||
* used independently.
|
||||
*
|
||||
* May 28 1998, Toni Ronkko
|
||||
* First version.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "dirent.h"
|
||||
|
||||
/* Use the new safe string functions introduced in Visual Studio 2005 */
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
|
||||
#else
|
||||
# define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Open directory stream DIRNAME for read and return a pointer to the
|
||||
* internal working area that is used to retrieve individual directory
|
||||
* entries.
|
||||
*/
|
||||
DIR *opendir(const char *dirname)
|
||||
{
|
||||
DIR *dirp;
|
||||
assert (dirname != NULL);
|
||||
assert (strlen (dirname) < MAX_PATH);
|
||||
|
||||
/* construct new DIR structure */
|
||||
dirp = (DIR*) malloc (sizeof (struct DIR));
|
||||
if (dirp != NULL) {
|
||||
char *p;
|
||||
|
||||
/* take directory name... */
|
||||
STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
|
||||
dirp->patt[MAX_PATH] = '\0';
|
||||
|
||||
/* ... and append search pattern to it */
|
||||
p = strchr (dirp->patt, '\0');
|
||||
if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
|
||||
*p++ = '\\';
|
||||
}
|
||||
*p++ = '*';
|
||||
*p = '\0';
|
||||
|
||||
/* open stream and retrieve first file */
|
||||
dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
|
||||
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
|
||||
/* invalid search pattern? */
|
||||
free (dirp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* there is an un-processed directory entry in memory now */
|
||||
dirp->cached = 1;
|
||||
}
|
||||
|
||||
return dirp;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Read a directory entry, and return a pointer to a dirent structure
|
||||
* containing the name of the entry in d_name field. Individual directory
|
||||
* entries returned by this very function include regular files,
|
||||
* sub-directories, pseudo-directories "." and "..", but also volume labels,
|
||||
* hidden files and system files may be returned.
|
||||
*/
|
||||
struct dirent *readdir(DIR *dirp)
|
||||
{
|
||||
assert (dirp != NULL);
|
||||
|
||||
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
|
||||
/* directory stream was opened/rewound incorrectly or ended normally */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get next directory entry */
|
||||
if (dirp->cached != 0) {
|
||||
/* a valid directory entry already in memory */
|
||||
dirp->cached = 0;
|
||||
} else {
|
||||
/* read next directory entry from disk */
|
||||
if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) {
|
||||
/* the very last file has been processed or an error occured */
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* copy as a multibyte character string */
|
||||
STRNCPY ( dirp->current.d_name,
|
||||
dirp->current.data.cFileName,
|
||||
sizeof(dirp->current.d_name) );
|
||||
dirp->current.d_name[MAX_PATH] = '\0';
|
||||
|
||||
return &dirp->current;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Close directory stream opened by opendir() function. Close of the
|
||||
* directory stream invalidates the DIR structure as well as any previously
|
||||
* read directory entry.
|
||||
*/
|
||||
int closedir(DIR *dirp)
|
||||
{
|
||||
assert (dirp != NULL);
|
||||
|
||||
/* release search handle */
|
||||
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
/* release directory handle */
|
||||
free (dirp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Resets the position of the directory stream to which dirp refers to the
|
||||
* beginning of the directory. It also causes the directory stream to refer
|
||||
* to the current state of the corresponding directory, as a call to opendir()
|
||||
* would have done. If dirp does not refer to a directory stream, the effect
|
||||
* is undefined.
|
||||
*/
|
||||
void rewinddir(DIR* dirp)
|
||||
{
|
||||
/* release search handle */
|
||||
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
|
||||
FindClose (dirp->search_handle);
|
||||
dirp->search_handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
/* open new search handle and retrieve first file */
|
||||
dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
|
||||
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
|
||||
/* invalid search pattern? */
|
||||
free (dirp);
|
||||
return;
|
||||
}
|
||||
|
||||
/* there is an un-processed directory entry in memory now */
|
||||
dirp->cached = 1;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#ifndef DIRENT_H
|
||||
#define DIRENT_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
typedef struct dirent
|
||||
{
|
||||
char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */
|
||||
WIN32_FIND_DATAA data; /* file attributes */
|
||||
} dirent;
|
||||
|
||||
typedef struct DIR
|
||||
{
|
||||
dirent current; /* Current directory entry */
|
||||
int cached; /* Indicates un-processed entry in memory */
|
||||
HANDLE search_handle; /* File search handle */
|
||||
char patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
|
||||
} DIR;
|
||||
|
||||
/* Forward declarations */
|
||||
DIR *opendir (const char *dirname);
|
||||
struct dirent *readdir (DIR *dirp);
|
||||
int closedir (DIR *dirp);
|
||||
void rewinddir(DIR* dirp);
|
||||
|
||||
#endif /*DIRENT_H*/
|
||||
@@ -1,45 +0,0 @@
|
||||
include "..\makeinc.mak"
|
||||
|
||||
COMMON_OBJECTS = \
|
||||
cfgfiles.obj \
|
||||
chanopt.obj \
|
||||
ctcp.obj \
|
||||
dcc.obj \
|
||||
dirent.obj \
|
||||
history.obj \
|
||||
ignore.obj \
|
||||
inbound.obj \
|
||||
modes.obj \
|
||||
network.obj \
|
||||
notify.obj \
|
||||
outbound.obj \
|
||||
plugin.obj \
|
||||
plugin-timer.obj \
|
||||
proto-irc.obj \
|
||||
server.obj \
|
||||
servlist.obj \
|
||||
ssl.obj \
|
||||
text.obj \
|
||||
thread.obj \
|
||||
tree.obj \
|
||||
url.obj \
|
||||
userlist.obj \
|
||||
util.obj \
|
||||
wdkutil.obj \
|
||||
xchat.obj
|
||||
|
||||
all: $(COMMON_OBJECTS) xchatcommon.lib dirent.lib
|
||||
|
||||
xchatcommon.lib: $(COMMON_OBJECTS)
|
||||
lib /nologo /out:xchatcommon.lib $(COMMON_OBJECTS)
|
||||
|
||||
dirent.lib: dirent.obj
|
||||
lib /nologo /out:dirent.lib dirent.obj
|
||||
|
||||
.c.obj::
|
||||
$(CC) $(CFLAGS) $(GLIB) $<
|
||||
|
||||
clean:
|
||||
@del *.obj
|
||||
@del xchatcommon.lib
|
||||
@del dirent.lib
|
||||
@@ -1,33 +0,0 @@
|
||||
#include <fcntl.h>
|
||||
#include "thread.h"
|
||||
|
||||
thread *
|
||||
thread_new (void)
|
||||
{
|
||||
thread *th;
|
||||
|
||||
th = calloc (1, sizeof (*th));
|
||||
if (!th)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (_pipe (th->pipe_fd, 4096, _O_BINARY) == -1)
|
||||
{
|
||||
free (th);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return th;
|
||||
}
|
||||
|
||||
int
|
||||
thread_start (thread *th, void *(*start_routine)(void *), void *arg)
|
||||
{
|
||||
DWORD id;
|
||||
|
||||
CloseHandle (CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, (DWORD *)&id));
|
||||
th->threadid = id;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
#include <windows.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD threadid;
|
||||
int pipe_fd[2];
|
||||
} thread;
|
||||
|
||||
thread *thread_new (void);
|
||||
int thread_start (thread *th, void *(*start_routine)(void *), void *arg);
|
||||
@@ -1,27 +0,0 @@
|
||||
#include <io.h>
|
||||
|
||||
int
|
||||
portable_mode ()
|
||||
{
|
||||
if ((_access( "portable-mode", 0 )) != -1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
xtray_mode ()
|
||||
{
|
||||
if ((_access( "plugins/xtray.dll", 0 )) != -1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
int portable_mode ();
|
||||
int xtray_mode ();
|
||||
@@ -1,60 +0,0 @@
|
||||
include "..\makeinc.mak"
|
||||
|
||||
FEGTK_OBJECTS = \
|
||||
about.obj \
|
||||
ascii.obj \
|
||||
banlist.obj \
|
||||
chanlist.obj \
|
||||
chanview.obj \
|
||||
custom-list.obj \
|
||||
dccgui.obj \
|
||||
editlist.obj \
|
||||
fe-gtk.obj \
|
||||
fkeys.obj \
|
||||
gtkutil.obj \
|
||||
ignoregui.obj \
|
||||
joind.obj \
|
||||
maingui.obj \
|
||||
menu.obj \
|
||||
notifygui.obj \
|
||||
palette.obj \
|
||||
pixmaps.obj \
|
||||
plugingui.obj \
|
||||
plugin-tray.obj \
|
||||
rawlog.obj \
|
||||
search.obj \
|
||||
servlistgui.obj \
|
||||
setup.obj \
|
||||
sexy-spell-entry.obj \
|
||||
textgui.obj \
|
||||
urlgrab.obj \
|
||||
userlistgui.obj \
|
||||
xtext.obj
|
||||
|
||||
!ifdef X64
|
||||
MACHINE_FLAG = /MACHINE:X64
|
||||
!else
|
||||
MACHINE_FLAG = /MACHINE:X86
|
||||
!endif
|
||||
|
||||
COMLIB = ..\common\xchatcommon.lib
|
||||
PROG = xchat.exe
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
.c.obj::
|
||||
$(CC) $(CFLAGS) -I..\..\plugins $(GLIB) $(GTK) $<
|
||||
|
||||
$(PROG): $(FEGTK_OBJECTS) $(COMLIB) xchat-icon.obj
|
||||
$(LINK) /out:$(PROG) /entry:mainCRTStartup $(LDFLAGS) $(LIBS) $(FEGTK_OBJECTS) $(COMLIB) xchat-icon.obj
|
||||
|
||||
xchat.res: xchat.rc ../../xchat.ico
|
||||
rc /nologo /r xchat.rc
|
||||
|
||||
xchat-icon.obj: xchat.res
|
||||
cvtres /nologo $(MACHINE_FLAG) /OUT:xchat-icon.obj xchat.res
|
||||
|
||||
clean:
|
||||
@del *.obj
|
||||
@del $(PROG)
|
||||
@del xchat.res
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef SSIZE_T_DEFINED
|
||||
#ifdef ssize_t
|
||||
#undef ssize_t
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
typedef __int64 ssize_t;
|
||||
#else
|
||||
typedef _W64 int ssize_t;
|
||||
#endif
|
||||
#define SSIZE_T_DEFINED
|
||||
#endif
|
||||
@@ -1,22 +0,0 @@
|
||||
#include <winver.h>
|
||||
#include "../../config.h"
|
||||
|
||||
XC_ICON ICON "../../xchat.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
|
||||
VALUE "FileDescription", "XChat-WDK IRC Client"
|
||||
VALUE "ProductName", "XChat-WDK"
|
||||
VALUE "ProductVersion", PACKAGE_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
@@ -1,20 +0,0 @@
|
||||
include "..\makeinc.mak"
|
||||
|
||||
COMLIB = ..\common\xchatcommon.lib
|
||||
PROG = xchat-text.exe
|
||||
|
||||
!ifdef X64
|
||||
PLATOBJ = msvcrt_win2003.obj
|
||||
!else
|
||||
PLATOBJ = msvcrt_winxp.obj
|
||||
!endif
|
||||
|
||||
all: fe-text.obj
|
||||
link /out:$(PROG) /subsystem:console /nologo $(PLATOBJ) $(LIBS) $(COMLIB) fe-text.obj
|
||||
|
||||
fe-text.obj: fe-text.c makefile.mak
|
||||
cl $(CFLAGS) $(GLIB) fe-text.c
|
||||
|
||||
clean:
|
||||
@del *.obj
|
||||
@del $(PROG)
|
||||
@@ -1,17 +0,0 @@
|
||||
all:
|
||||
@cd common
|
||||
@-$(MAKE) /nologo /s /f makefile.mak $@
|
||||
@cd ..\fe-gtk
|
||||
@-$(MAKE) /nologo /s /f makefile.mak $@
|
||||
@cd ..\fe-text
|
||||
@-$(MAKE) /nologo /s /f makefile.mak $@
|
||||
|
||||
clean:
|
||||
@del common\*.obj
|
||||
@del common\xchatcommon.lib
|
||||
@del fe-gtk\*.obj
|
||||
@del fe-gtk\xchat.exe
|
||||
@del fe-gtk\xchat.res
|
||||
@del fe-text\*.obj
|
||||
@del fe-text\xchat-text.exe
|
||||
@del pixmaps\*.h
|
||||
@@ -1,44 +0,0 @@
|
||||
CC = cl
|
||||
LINK = link
|
||||
CFLAGS = $(CFLAGS) /Ox /c /MD /MP2 /W0 /nologo
|
||||
CFLAGS = $(CFLAGS) /DWIN32 /DG_DISABLE_CAST_CHECKS /DG_DISABLE_DEPRECATED /DGDK_PIXBUF_DISABLE_DEPRECATED /DGDK_DISABLE_DEPRECATED /DUSE_IPV6 /DHAVE_STRTOULL /Dstrtoull=_strtoui64 /Dstrcasecmp=stricmp /Dstrncasecmp=strnicmp /DUSE_OPENSSL
|
||||
CFLAGS = $(CFLAGS) /I$(DEV)\include
|
||||
CPPFLAGS = /c /MD /W0 /nologo /DWIN32
|
||||
LDFLAGS = /subsystem:windows /nologo
|
||||
LIBS = $(LIBS) gdi32.lib shell32.lib user32.lib advapi32.lib imm32.lib ole32.lib winmm.lib ws2_32.lib wininet.lib comdlg32.lib libeay32.lib ssleay32.lib
|
||||
|
||||
GLIB = /I$(DEV)\include\glib-2.0 /I$(DEV)\lib\glib-2.0\include
|
||||
GTK = /I$(DEV)\include\gtk-2.0 /I$(DEV)\lib\gtk-2.0\include /I$(DEV)\include\atk-1.0 /I$(DEV)\include\cairo /I$(DEV)\include\pango-1.0 /I$(DEV)\include\gdk-pixbuf-2.0
|
||||
LIBS = $(LIBS) /libpath:$(DEV)\lib gtk-win32-2.0.lib gdk-win32-2.0.lib atk-1.0.lib gio-2.0.lib gdk_pixbuf-2.0.lib pangowin32-1.0.lib pangocairo-1.0.lib pango-1.0.lib cairo.lib gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib intl.lib
|
||||
|
||||
LUALIB = lua51
|
||||
LUAOUTPUT = xclua.dll
|
||||
|
||||
PERL510LIB = perl510
|
||||
PERL510OUTPUT = xcperl-510.dll
|
||||
PERL512LIB = perl512
|
||||
PERL512OUTPUT = xcperl-512.dll
|
||||
|
||||
PYTHONLIB = python27
|
||||
PYTHONOUTPUT = xcpython.dll
|
||||
|
||||
TCLLIB = tcl85
|
||||
TCLOUTPUT = xctcl.dll
|
||||
|
||||
!ifdef X64
|
||||
CFLAGS = $(CFLAGS) /favor:AMD64 /D_WIN64
|
||||
CPPFLAGS = $(CPPFLAGS) /favor:AMD64 /D_WIN64
|
||||
LDFLAGS = $(LDFLAGS) msvcrt_win2003.obj
|
||||
|
||||
PERL510PATH = c:\mozilla-build\perl-5.10-x64\lib\CORE
|
||||
PERL512PATH = c:\mozilla-build\perl-5.12-x64\lib\CORE
|
||||
PYTHONPATH = c:\mozilla-build\python-2.7-x64
|
||||
TCLPATH = c:\mozilla-build\tcl-8.5-x64
|
||||
!else
|
||||
LDFLAGS = $(LDFLAGS) msvcrt_winxp.obj
|
||||
|
||||
PERL510PATH = c:\mozilla-build\perl-5.10-x86\lib\CORE
|
||||
PERL512PATH = c:\mozilla-build\perl-5.12-x86\lib\CORE
|
||||
PYTHONPATH = c:\mozilla-build\python-2.7-x86
|
||||
TCLPATH = c:\mozilla-build\tcl-8.5-x86
|
||||
!endif
|
||||
@@ -1,18 +0,0 @@
|
||||
CONV = gdk-pixbuf-csource
|
||||
|
||||
LIST = bookpng book.png \
|
||||
hoppng hop.png \
|
||||
oppng op.png \
|
||||
purplepng purple.png \
|
||||
redpng red.png \
|
||||
trayfilepng fileoffer.png \
|
||||
trayhilightpng highlight.png \
|
||||
traymsgpng message.png \
|
||||
voicepng voice.png \
|
||||
xchatpng ..\..\xchat.png
|
||||
|
||||
all:
|
||||
@$(CONV) --build-list $(LIST) > inline_pngs.h
|
||||
|
||||
clean:
|
||||
@del *.h
|
||||
Reference in New Issue
Block a user