Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

POST YOUR void.h EQUIVALENTS HERE

Name: Anonymous 2010-07-12 16:55

#ifndef GLOBAL_H
#define GLOBAL_H
#include <stdlib.h>
#include <stdio.h>

/* global.h - Stuff everyone likes
 */

#define BIT(n)        (1<<(n))

#define unless(a)    if(!(a))
#define    until(a)    while(!(a))
/* <3 Perl <3 */

#define    _QUOTE(x)    #x
#define QUOTE(x)    _QUOTE(x)
#define    _FILE_AND_LINE    __FILE__ ":" QUOTE(__LINE__) " "
#define printe(...)    fprintf( stderr, __VA_ARGS__ )
#define perror(...)    printe( _FILE_AND_LINE __VA_ARGS__ )
#define die(...)    printe( __VA_ARGS__ ), exit (1)
#define UNUSED(a)    (void) (a)

#ifdef    DEBUG_THINGS
#define DEBUG(...)    perror( __VA_ARGS__ )
#else
#define    DEBUG(...)
#endif

/* 32-BIT IS KING */
typedef unsigned int    uint;

typedef unsigned char    u8;
typedef signed char    s8;
typedef unsigned short    u16;
typedef signed short    s16;
typedef unsigned int    u32;
typedef signed int    s32;
/* long is for queers */

#endif /* GLOBAL_H */

Name: Anonymous 2010-07-12 17:22


/*Pure-C/gcc void.h 1.24 */
#include "stdio.h"
#include "io.h"
#include "stdlib.h"
#include "string.h"
#include "math.h"
#include "time.h"
//avoid:ASM,"limits.h"->unportable code.
#define tuni typedef union
#define tstr typedef struct
#define uint unsigned int
#define ulong unsigned long
#define uchar unsigned char
#define uquad unsigned long long
#define uword unsigned short int
#define filesz(x) filelength(fileno(x))
#define mainstart int main(int argc, char**argv, char**envp){;
#define mainend ;return 0;}
#define disp_env ;for(int ienvp=0;envp[ienvp];ienvp++){printf("%s\n",envp[ienvp]);};
#define noteq(x,y) ((x)^(y))
#define bitnum(x) (1<<x)
#define setbit(x,bitpos) (x|(1<<bitpos))
#define getbit(x,bitpos) (x&(1<<bitpos))
#define getbyte(x,bytenum)  (x&(0xFF<<(bytenum<<3)))
#define setbyte(x,bytenum)  (x|(0xFF<<(bytenum<<3)))

//Bithacks.n=numbyte, x=ULONG
#define haszero(v)  (~((((v & 0x7F7F7F7F) + 0x7F7F7F7F) | (v)) | 0x7F7F7F7F))
#define hasvalue(x,n) (haszero(((x)^((((~0UL)/255) * (n))))))
#define hasless(x,n) (((x)-(((~0UL)/255)*(n)))&(~(x))&(((~0UL)/255)*128))
#define countless(x,n)\
(((((~0UL)/255)*(127+(n))-((x)&(((~0UL)/255)*127)))&(~(x))&~0UL/255*128)/128%255)
#define hasbetween(x,m,n) ((~0UL/255*(127+(n))-((x)&~0UL/255*127)&~(x)&((x)&(~0UL/255*127))+(~0UL/255*(127-m)))&(~0UL/255*128))
#define countbetween(x,m,n) ((hasbetween(x,m,n)/128)%255)
//supplemental bithacks
#define unordered_match(num,chars) (hasvalue((num),(chars[0]))&&hasvalue((num),(chars[1]))&&hasvalue((num),(chars[2]))&&hasvalue((num),(chars[3])))
#define ordered_match(num,chars) !(((chars[0])|(chars[1]<<8)|(chars[2]<<16)|(chars[3]<<24))^num)

Name: Anonymous 2010-07-12 17:22

I don't have a void.h ...

Name: Anonymous 2010-07-12 17:23

i use a customer std c library that i wrote when i was 12 that incorporates all my custom additions automatically

Name: Anonymous 2010-07-12 17:25

>>3
Just put your defines and includes in one file.
Now when you need them #include "void.h" and you're set

Name: Anonymous 2010-07-12 17:31

i have a .h file with one empty comment.

Name: Anonymous 2010-07-12 17:57

>>6
is this some kind of joke

Name: Anonymous 2010-07-12 18:19

>>7
He achieved satori and now writes program in his own mind.
The comment is the view that emptiness is the final optimization.

Name: Anonymous 2010-07-12 21:19

>>8
Nah, just ported to Racket.

Name: Anonymous 2010-07-12 22:04

#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#if defined(_WIN32)
  #include "contrib/pstdint.h"
#else
  #include <stdint.h>
  #include <inttypes.h>
  #include <stdbool.h>
#endif

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdarg.h>
#include <memory.h>

#if defined(_WIN32)
  #include <malloc.h>
#else
  #include <alloca.h>
#endif

#define alloct(T)    ((T*)malloc(sizeof(T)))
#define allocn(T, n) ((T*)malloc(sizeof(T) * (n)))

#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
  #if defined(_WIN32)
    #define restrict __restrict
  #else
    #define restrict __restrict__
  #endif
#endif

#ifdef DEBUG
  void _assertf_fail(const char* file, unsigned int line, const char* function, const char* assertion, ...) {
    fprintf(stderr, "\nassertion failed at: %s:%u in %s()\n", file, line, function);
    va_list args;
    va_start(args, assertion);
    vfprintf(stderr, assertion, args);
    va_end(args);
    fprintf(stderr, "\n\n");
    abort();
  }
  #define assertf(x, ...) ((x) ? ((void)0) : _assertf_fail(__FILE__, __LINE__, __func__, #x "\n" __VA_ARGS__))
#else
  #define assertf(x, ...) ((void)0)
#endif

Name: Anonymous 2010-07-13 7:05

Name: Anonymous 2010-07-13 7:29

>>11
fascinating, its like FV tried to design an OS
[edit] Javascript

Uses Firebug.

/* Complex parts */
var CPU = function () {};
CPU.prototype = {
  freeze: function () {
    console.log('CPU: freeze');
  },
  jump: function (position) {
    console.log('CPU: jump to ' + position);
  },
  execute: function () {
    console.log('CPU: execute');
  }
};
 
var Memory = function () {};
Memory.prototype = {
  load: function (position, data) {
    console.log('Memory: load "' + data + '" at ' + position);
  }
};
 
var HardDrive = function () {};
HardDrive.prototype = {
  read: function (lba, size) {
    console.log('HardDrive: read sector ' + lba + '(' + size + ' bytes)');
    return 'hdd data';
  }
};
 
 
/* Facade */
var Computer = function () {
  var cpu, memory, hardDrive;
 
  cpu = new CPU();
  memory = new Memory();
  hardDrive = new HardDrive();
 
  var constant = function (name) {
    var constants = {
      BOOT_ADDRESS: 0,
      BOOT_SECTOR: 0,
      SECTOR_SIZE: 512
    };
 
    return constants[name];
  };
 
  this.startComputer = function () {
    cpu.freeze();
    memory.load(constant('BOOT_ADDRESS'), hardDrive.read(constant('BOOT_SECTOR'), constant('SECTOR_SIZE')));
    cpu.jump(constant('BOOT_ADDRESS'));
    cpu.execute();
  }
 
};
 
/* Client */
var facade = new Computer();
facade.startComputer();

Name: Anonymous 2010-07-13 8:46

>>11
This is jarring as hell as it looks like "fackard" without the ç.

Name: air max shoes 2010-07-23 10:57

http://www.cheapairmaxs.com air max
http://www.cheapairmaxs.com air max shoes
http://www.cheapairmaxs.com/nike-air-max-2012-c-111.html nike air max 2012
http://www.cheapairmaxs.com/mens-air-max-2010-c-93.html mens nike air max 2010
http://www.cheapairmaxs.com/womens-air-max-2010-c-96.html womens nike air max 2010
http://www.cheapairmaxs.com/mens-air-max-2009-c-95.html mens nike air max 2009
http://www.cheapairmaxs.com/womens-air-max-2009-c-98.html womens nike air max 2009
http://www.cheapairmaxs.com/nike-air-max-2003-c-101.html nike air max 2003
http://www.cheapairmaxs.com/nike-air-max-97-c-94.html nike air max 97
http://www.cheapairmaxs.com/mens-air-max-95-c-102.html mens nike air max 95
http://www.cheapairmaxs.com/womens-air-max-95-c-103.html womens nike air max 95
http://www.cheapairmaxs.com/nike-air-max-93-c-106.html nike air max 93
http://www.cheapairmaxs.com/mens-air-max-91-c-104.html mens nike air max 91
http://www.cheapairmaxs.com/womens-air-max-91-c-105.html womens nike air max 91
http://www.cheapairmaxs.com/nike-air-max-89-c-121.html nike air max 89
http://www.cheapairmaxs.com/nike-air-max-88-c-112.html nike air max 88
http://www.cheapairmaxs.com/mens-air-max-87-c-108.html mens nike air max 87
http://www.cheapairmaxs.com/womens-air-max-87-c-109.html womens nike air max 87
http://www.cheapairmaxs.com/nike-air-max-180-c-123.html nike air max 180
http://www.cheapairmaxs.com/nike-air-max-360-c-124.html nike air max 360
http://www.cheapairmaxs.com/mens-air-max-ltd-c-122.html mens air max ltd
http://www.cheapairmaxs.com/womens-air-max-ltd-c-116.html womens air max ltd
http://www.cheapairmaxs.com/nike-air-max-bw-c-117.html nike air max bw
http://www.cheapairmaxs.com/air-max-premium-c-118.html air max premium
http://www.cheapairmaxs.com/air-max-skyline-c-114.html air max skyline
http://www.cheapairmaxs.com/air-max-zenyth-c-125.html air max zenyth
http://www.cheapairmaxs.com/nike-air-max-tn-c-115.html nike air max tn
http://www.cheapairmaxs.com/kids-air-max-90-c-119.html kids air max 90
http://www.cheapairmaxs.com/kids-air-max-bw-c-120.html kids air max bw

Name: Anonymous 2010-08-12 15:00

>>11
Jesus the code portions of Wikipedia entries are getting worse and worse.

Name: Anonymous 2010-12-23 16:21

Name: Anonymous 2011-02-03 4:08

Name: Anonymous 2011-02-03 6:46

Name: Anonymous 2011-02-04 14:01

Name: Anonymous 2011-02-18 14:03

<-- check 'em

Name: Anonymous 2011-11-30 12:25

void.h
Enjoying your non-portable code, `faggots'??

Name: Anonymous 2011-11-30 12:31

>>23
Lisp is shit.

Name: Anonymous 2011-11-30 15:32

>>23
You need your code to work with compilers that don't support header files?

Name: Anonymous 2011-11-30 17:56

>>25
My compiler that I wrote only supports the C89 headers.
I keep my programs short and sweet that get to the point in an efficient manner.
My programs are not bloatware and do their task and only theirs.
If I need a complex program then ill break it up into smaller programs that do a single job and are efficient at it and not bloated as fuck [see GNU for bloat]

I hold true to the unix way.

Name: Anonymous 2011-11-30 22:21

>>26
Lisp is da shite, mang.

Name: Anonymous 2011-11-30 22:41

>>26
implying GNU is not unix

Don't change these.
Name: Email:
Entire Thread Thread List