Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinos-Sk authored Aug 14, 2016
1 parent d05b7bf commit 22fe41b
Show file tree
Hide file tree
Showing 12 changed files with 1,579 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CXX=g++

CXXFLAGS=-c -O3 -w -DLINUX -I./amx
LDFLAGS=-Os -shared

all: nativechecker.so

nativechecker.so: amxplugin.o nativechecker.o
$(CXX) $(LDFLAGS) $? -o $@

clean:
rm -f *.o *.so
439 changes: 439 additions & 0 deletions amx/amx.h

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions amx/getch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Extremely inefficient but portable POSIX getch(), see getch.c */
#ifndef GETCH_H
#define GETCH_H

#if defined __cplusplus
extern "C" {
#endif
int getch(void);
int kbhit(void);

#if defined __cplusplus
}
#endif

#endif /* GETCH_H */
47 changes: 47 additions & 0 deletions amx/sclinux.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Things needed to compile under linux.
*
* Should be reworked totally to use GNU's 'configure'
*/
#ifndef SCLINUX_H
#define SCLINUX_H

/* getchar() is not a 'cool' replacement for MSDOS getch: Linux/unix depends on the features activated or not about the
* controlling terminal's tty. This means that ioctl(2) calls must be performed, for instance to have the controlling
* terminal tty's in 'raw' mode, if we want to be able to fetch a single character. This also means that everything must
* be put back correctly when the function ends. See GETCH.C for an implementation.
*
* For interactive use of SRUN/SDBG if would be much better to use GNU's readline package: the user would be able to
* have a complete emacs/vi like line editing system.
*/
#include "getch.h"

#define stricmp(a,b) strcasecmp(a,b)
#define strnicmp(a,b,c) strncasecmp(a,b,c)

/*
* WinWorld wants '\'. Unices do not.
*/
#define DIRECTORY_SEP_CHAR '/'
#define DIRECTORY_SEP_STR "/"

/*
* SC assumes that a computer is Little Endian unless told otherwise. It uses
* (and defines) the macros BYTE_ORDER and BIG_ENDIAN.
* For Linux, we must overrule these settings with those defined in glibc.
*/
#if !defined __BYTE_ORDER
# include <stdlib.h>
#endif

#if defined __OpenBSD__ || defined __FreeBSD__
# define __BYTE_ORDER BYTE_ORDER
# define __LITTLE_ENDIAN LITTLE_ENDIAN
# define __BIG_ENDIAN BIG_ENDIAN
#endif

#if !defined __BYTE_ORDER
# error "Can't figure computer byte order (__BYTE_ORDER macro not found)"
#endif

#endif /* SCLINUX_H */
Loading

0 comments on commit 22fe41b

Please sign in to comment.