about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
* changed plus key to MODKEY-Shift-plus (US-layout restrictions ;)Anselm R. Garbe2007-01-053-3/+3
* I prefer two master windows by defaultAnselm R. Garbe2007-01-052-3/+3
* added MODKEY-{plus,minus} shortcuts (increasing/decreasing master clients)Anselm R. Garbe2007-01-054-15/+62
* experimental version which allows master clients being increased/decreasedAnselm R. Garbe2007-01-056-25/+45
* fixed comment of drawclient()Anselm R. Garbe2007-01-041-1/+1
* switching bakc to my previous color favoritAnselm R. Garbe2007-01-041-3/+3
* renamed drawtitle into drawclientAnselm R. Garbe2007-01-044-7/+7
* using more thinkpad compliant colorsarg@mig292007-01-021-1/+1
* changed arg's color schemearg@mig292007-01-022-6/+6
* correctionsarg@mig292007-01-0210-12/+12
* next version will contain updated copyright noticearg@mig292007-01-0213-15/+15
* Added tag 2.8 for changeset 107719a9ce3bd0c79f9f1f626596eb338a276561arg@mig292007-01-021-0/+1
* fixed cleanup, using clients instead of sel 2.8arg@mig292007-01-021-3/+3
* changed comment of updatesizehintsarg@mig292007-01-021-1/+1
* renamed updatesize into updatesizehints (thx to Sander for this hint)arg@mig292007-01-013-4/+4
* small simplification to dotile() (thx to Ross for this hint)arg@mig292006-12-201-6/+5
* migrated arg's config.h to new dmenu command line optionsarg@mig292006-12-191-2/+2
* added Solaris hintsarg@mig292006-12-181-1/+6
* Added tag 2.7 for changeset 21951c0dfbae5af68ed77821a4d87253ee91803farg@mig292006-12-141-0/+1
* applied Sanders patch 2.7arg@mig292006-12-131-3/+3
* fixed man page, status bar displays EOF instead of "broken pipe"arg@mig292006-12-131-1/+1
* added the java odyssee to CAVEATS sectionarg@mig292006-12-131-2/+10
* removed Client->gravarg@mig292006-12-122-5/+0
* removed gravitate for the momentarg@mig292006-12-113-57/+1
* disabling configure() during resizearg@mig292006-12-111-1/+1
* made gravitate effectless, waiting for complains ;)arg@mig292006-12-111-0/+1
* fixed diagnostic error messagearg@mig292006-12-081-1/+1
* removed the hardcoded fixed fallback, it is useless in non-Latin1 environmentsarg@mig292006-12-082-5/+2
* we don't use the term clients anymore, windows is the better termarg@mig292006-12-071-1/+1
* Added tag 2.6 for changeset 5308dd22b6ee8e3218c81d9e7e4125f235bb5778arg@mig292006-12-071-0/+1
* found compromise for fonts 2.6arg@mig292006-12-072-2/+2
* nah, people should define 'fixed' to be compatible with their localearg@mig292006-12-071-1/+1
* using a UTF-8 capable fixed fontarg@mig292006-12-071-1/+1
* switching to uxterm again, I get kretze from this urxvt craparg@mig292006-12-071-1/+1
* with this patch everything works fine for mearg@mig292006-12-072-5/+3
* don't use Xlocale crap, let's use locale.h insteadarg@mig292006-12-071-1/+1
* using the portable Xmb+UTF-8 way of life, will see if this works well...arg@mig292006-12-071-2/+4
* improved the memory leak preventionarg@mig292006-12-061-1/+4
* making terminus more explicit a regular font (otherwise olique font might be ...arg@mig292006-12-051-1/+1
* also setting LC_CTYPE onlyarg@mig292006-12-051-1/+1
* enforcing using fontsets even if they are incomplete for some encodingsarg@mig292006-12-052-5/+1
* Added tag 2.5.1 for changeset c7f84f23ec5aef29988dcdc4ec22a7352ee8f58earg@mig292006-12-041-0/+1
* hotfix of a serious crashing bug 2.5.1arg@mig292006-12-043-3/+5
* Added tag 2.5 for changeset dcbbfabc8ecc5f33a6cc950584de87da1a368045arg@mig292006-12-041-0/+1
* applied Manuel's regex patch 2.5arg@mig292006-12-031-3/+3
* made squares equally sized, and 1px biggerarg@mig292006-12-011-5/+5
* if client is focused, the emptysquare don't needs to be drawedarg@mig292006-12-011-3/+3
* and the winner isarg@mig292006-12-012-14/+20
* sander1 proposalarg@mig292006-12-011-7/+15
* doodarg@mig292006-12-011-8/+9
s="cm">__POCC__ __TINYC__ __clang__ */ #ifndef NIMBASE_H #define NIMBASE_H #if defined(__GNUC__) # define _GNU_SOURCE 1 #endif #if defined(__TINYC__) /*# define __GNUC__ 3 # define GCC_MAJOR 4 # define __GNUC_MINOR__ 4 # define __GNUC_PATCHLEVEL__ 5 */ # define __DECLSPEC_SUPPORTED 1 #endif /* calling convention mess ----------------------------------------------- */ #if defined(__GNUC__) || defined(__LCC__) || defined(__POCC__) \ || defined(__TINYC__) /* these should support C99's inline */ /* the test for __POCC__ has to come before the test for _MSC_VER, because PellesC defines _MSC_VER too. This is brain-dead. */ # define N_INLINE(rettype, name) inline rettype name #elif defined(__BORLANDC__) || defined(_MSC_VER) /* Borland's compiler is really STRANGE here; note that the __fastcall keyword cannot be before the return type, but __inline cannot be after the return type, so we do not handle this mess in the code generator but rather here. */ # define N_INLINE(rettype, name) __inline rettype name #elif defined(__DMC__) # define N_INLINE(rettype, name) inline rettype name #elif defined(__WATCOMC__) # define N_INLINE(rettype, name) __inline rettype name #else /* others are less picky: */ # define N_INLINE(rettype, name) rettype __inline name #endif #if defined(__POCC__) # define NIM_CONST /* PCC is really picky with const modifiers */ # undef _MSC_VER /* Yeah, right PCC defines _MSC_VER even if it is not that compatible. Well done. */ #elif defined(__cplusplus) # define NIM_CONST /* C++ is picky with const modifiers */ #else # define NIM_CONST const #endif #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) # define NIM_THREADVAR __declspec(thread) #else # define NIM_THREADVAR __thread #endif /* --------------- how int64 constants should be declared: ----------- */ #if defined(__GNUC__) || defined(__LCC__) || \ defined(__POCC__) || defined(__DMC__) || defined(_MSC_VER) # define IL64(x) x##LL #else /* works only without LL */ # define IL64(x) ((NI64)x) #endif /* ---------------- casting without correct aliasing rules ----------- */ #if defined(__GNUC__) # define NIM_CAST(type, ptr) (((union{type __x__;}*)(ptr))->__x__) #else # define NIM_CAST(type, ptr) ((type)(ptr)) #endif /* ------------------------------------------------------------------- */ #if defined(WIN32) || defined(_WIN32) /* only Windows has this mess... */ # define N_CDECL(rettype, name) rettype __cdecl name # define N_STDCALL(rettype, name) rettype __stdcall name # define N_SYSCALL(rettype, name) rettype __syscall name # define N_FASTCALL(rettype, name) rettype __fastcall name # define N_SAFECALL(rettype, name) rettype __safecall name /* function pointers with calling convention: */ # define N_CDECL_PTR(rettype, name) rettype (__cdecl *name) # define N_STDCALL_PTR(rettype, name) rettype (__stdcall *name) # define N_SYSCALL_PTR(rettype, name) rettype (__syscall *name) # define N_FASTCALL_PTR(rettype, name) rettype (__fastcall *name) # define N_SAFECALL_PTR(rettype, name) rettype (__safecall *name) # define N_LIB_EXPORT extern __declspec(dllexport) # define N_LIB_IMPORT extern __declspec(dllimport) #else # define N_CDECL(rettype, name) rettype name # define N_STDCALL(rettype, name) rettype name # define N_SYSCALL(rettype, name) rettype name # define N_FASTCALL(rettype, name) rettype name # define N_SAFECALL(rettype, name) rettype name /* function pointers with calling convention: */ # define N_CDECL_PTR(rettype, name) rettype (*name) # define N_STDCALL_PTR(rettype, name) rettype (*name) # define N_SYSCALL_PTR(rettype, name) rettype (*name) # define N_FASTCALL_PTR(rettype, name) rettype (*name) # define N_SAFECALL_PTR(rettype, name) rettype (*name) # define N_LIB_EXPORT extern # define N_LIB_IMPORT extern #endif #define N_NOCONV(rettype, name) rettype name /* specify no calling convention */ #define N_NOCONV_PTR(rettype, name) rettype (*name) #if defined(__GNUC__) || defined(__ICC__) # define N_NOINLINE(rettype, name) rettype __attribute__((noinline)) name #elif defined(_MSC_VER) # define N_NOINLINE(rettype, name) __declspec(noinline) rettype name #else # define N_NOINLINE(rettype, name) rettype name #endif #define N_NOINLINE_PTR(rettype, name) rettype (*name) #if defined(__BORLANDC__) || defined(__WATCOMC__) || \ defined(__POCC__) || defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) /* these compilers have a fastcall so use it: */ # define N_NIMCALL(rettype, name) rettype __fastcall name # define N_NIMCALL_PTR(rettype, name) rettype (__fastcall *name) # define N_RAW_NIMCALL __fastcall #else # define N_NIMCALL(rettype, name) rettype name /* no modifier */ # define N_NIMCALL_PTR(rettype, name) rettype (*name) # define N_RAW_NIMCALL #endif #define N_CLOSURE(rettype, name) N_NIMCALL(rettype, name) #define N_CLOSURE_PTR(rettype, name) N_NIMCALL_PTR(rettype, name) /* ----------------------------------------------------------------------- */ #include <limits.h> #include <stddef.h> /* C99 compiler? */ #if (defined(__STD_VERSION__) && (__STD_VERSION__ >= 199901)) # define HAVE_STDINT_H #endif #if defined(__LCC__) || defined(__DMC__) || defined(__POCC__) # define HAVE_STDINT_H #endif /* bool types (C++ has it): */ #ifdef __cplusplus # ifndef NIM_TRUE # define NIM_TRUE true # endif # ifndef NIM_FALSE # define NIM_FALSE false # endif # define NIM_BOOL bool # define NIM_NIL 0 struct NimException { NimException(struct Exception* exp, const char* msg): exp(exp), msg(msg) {} struct Exception* exp; const char* msg; }; #else # ifdef bool # define NIM_BOOL bool # else typedef unsigned char NIM_BOOL; # endif # ifndef NIM_TRUE # define NIM_TRUE ((NIM_BOOL) 1) # endif # ifndef NIM_FALSE # define NIM_FALSE ((NIM_BOOL) 0) # endif # define NIM_NIL ((void*)0) /* C's NULL is fucked up in some C compilers, so the generated code does not rely on it anymore */ #endif #if defined(__BORLANDC__) || defined(__DMC__) \ || defined(__WATCOMC__) || defined(_MSC_VER) typedef signed char NI8; typedef signed short int NI16; typedef signed int NI32; /* XXX: Float128? */ typedef unsigned char NU8; typedef unsigned short int NU16; typedef unsigned __int64 NU64; typedef __int64 NI64; typedef unsigned int NU32; #elif defined(HAVE_STDINT_H) # include <stdint.h> typedef int8_t NI8; typedef int16_t NI16; typedef int32_t NI32; typedef int64_t NI64; typedef uint64_t NU64; typedef uint8_t NU8; typedef uint16_t NU16; typedef uint32_t NU32; #else typedef signed char NI8; typedef signed short int NI16; typedef signed int NI32; /* XXX: Float128? */ typedef unsigned char NU8; typedef unsigned short int NU16; typedef unsigned long long int NU64; typedef long long int NI64; typedef unsigned int NU32; #endif #ifdef NIM_INTBITS # if NIM_INTBITS == 64 typedef NI64 NI; typedef NU64 NU; # elif NIM_INTBITS == 32 typedef NI32 NI; typedef NU32 NU; # elif NIM_INTBITS == 16 typedef NI16 NI; typedef NU16 NU; # elif NIM_INTBITS == 8 typedef NI8 NI; typedef NU8 NU; # else # error "invalid bit width for int" # endif #endif extern NI nim_program_result; typedef float NF32; typedef double NF64; typedef double NF; typedef char NIM_CHAR; typedef char* NCSTRING; #ifdef NIM_BIG_ENDIAN # define NIM_IMAN 1 #else # define NIM_IMAN 0 #endif static N_INLINE(NI, float64ToInt32)(double x) { /* nowadays no hack necessary anymore */ return x >= 0 ? (NI)(x+0.5) : (NI)(x-0.5); } static N_INLINE(NI32, float32ToInt32)(float x) { /* nowadays no hack necessary anymore */ return x >= 0 ? (NI32)(x+0.5) : (NI32)(x-0.5); } #define float64ToInt64(x) ((NI64) (x)) #define zeroMem(a, size) memset(a, 0, size) #define equalMem(a, b, size) (memcmp(a, b, size) == 0) #define STRING_LITERAL(name, str, length) \ static const struct { \ TGenericSeq Sup; \ NIM_CHAR data[(length) + 1]; \ } name = {{length, length}, str} typedef struct TStringDesc* string; /* declared size of a sequence/variable length array: */ #if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) # define SEQ_DECL_SIZE /* empty is correct! */ #else # define SEQ_DECL_SIZE 1000000 #endif #define ALLOC_0(size) calloc(1, size) #define DL_ALLOC_0(size) dlcalloc(1, size) #define GenericSeqSize sizeof(TGenericSeq) #define paramCount() cmdCount #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__i386__) # ifndef NAN static unsigned long nimNaN[2]={0xffffffff, 0x7fffffff}; # define NAN (*(double*) nimNaN) # endif #endif #ifndef NAN # define NAN (0.0 / 0.0) #endif #ifndef INF # ifdef INFINITY # define INF INFINITY # elif defined(HUGE_VAL) # define INF HUGE_VAL # elif defined(_MSC_VER) # include <float.h> # define INF (DBL_MAX+DBL_MAX) # else # define INF (1.0 / 0.0) # endif #endif typedef struct TFrame TFrame; struct TFrame { TFrame* prev; NCSTRING procname; NI line; NCSTRING filename; NI16 len; NI16 calldepth; }; #define nimfr(proc, file) \ TFrame F; \ F.procname = proc; F.filename = file; F.line = 0; F.len = 0; nimFrame(&F); #define nimfrs(proc, file, slots, length) \ struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; TVarSlot s[slots];} F; \ F.procname = proc; F.filename = file; F.line = 0; F.len = length; nimFrame((TFrame*)&F); #define nimln(n, file) \ F.line = n; F.filename = file; #define NIM_POSIX_INIT __attribute__((constructor)) #if defined(_MSCVER) && defined(__i386__) __declspec(naked) int __fastcall NimXadd(volatile int* pNum, int val) { __asm { lock xadd dword ptr [ECX], EDX mov EAX, EDX ret } } #endif #ifdef __GNUC__ # define likely(x) __builtin_expect(x, 1) # define unlikely(x) __builtin_expect(x, 0) /* We need the following for the posix wrapper. In particular it will give us POSIX_SPAWN_USEVFORK: */ # ifndef _GNU_SOURCE # define _GNU_SOURCE # endif #else # define likely(x) (x) # define unlikely(x) (x) #endif #if 0 // defined(__GNUC__) || defined(__clang__) // not needed anymore because the stack marking cares about // interior pointers now static inline void GCGuard (void *ptr) { asm volatile ("" :: "X" (ptr)); } # define GC_GUARD __attribute__ ((cleanup(GCGuard))) #else # define GC_GUARD #endif /* Test to see if nimrod and the C compiler agree on the size of a pointer. On disagreement, your C compiler will say something like: "error: 'assert_numbits' declared as an array with a negative size" */ typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; #endif #ifdef __cplusplus # define NIM_EXTERNC extern "C" #else # define NIM_EXTERNC #endif