Skip to content

Instantly share code, notes, and snippets.

@ecere
ecere / gist:5772494
Last active December 18, 2015 10:59
public int Tokenize(char * string, int maxTokens, char* tokens[], BackSlashEscaping esc)
{
#ifdef __WIN32__
//define windowsFileNameCharsNeedEscaping = " !%&'()+,;=[]^`{}~"; // "#$-.@_" are ok
const char * escChars = " !%&'()+,;=[]^`{}~\""; // windowsFileNameCharsNeedEscaping;
const char * escCharsQuoted = "\"";
#else
//define linuxFileNameCharsNeedEscaping = " !\"$&'()*:;<=>?[\\`{|"; // "#%+,-.@]^_}~" are ok
const char * escChars = " -!\"$&'()*:;<=>?[\\`{|"; // linuxFileNameCharsNeedEscaping;
const char * escCharsQuoted = "\"()$";
@ecere
ecere / gist:5772090
Last active December 18, 2015 10:59
public char * PassArg(char * output, const char * input)
{
#ifdef __WIN32__
//define windowsFileNameCharsNeedEscaping = " !%&'()+,;=[]^`{}~"; // "#$-.@_" are ok
const char * escChars = " !%&'()+,;=[]^`{}~\""; // windowsFileNameCharsNeedEscaping;
const char * escCharsQuoted = "\"";
#else
//define linuxFileNameCharsNeedEscaping = " !\"$&'()*:;<=>?[\\`{|"; // "#%+,-.@]^_}~" are ok
const char * escChars = " -!\"$&'()*:;<=>?[\\`{|"; // linuxFileNameCharsNeedEscaping;
const char * escCharsQuoted = "\"()$";
public char * PassArg(char * output, const char * input)
{
#ifdef __WIN32__
//define windowsFileNameCharsNeedEscaping = " !%&'()+,;=[]^`{}~"; // "#$-.@_" are ok
const char * escChars = " !%&'()+,;=[]^`{}~\""; // windowsFileNameCharsNeedEscaping;
const char * escCharsQuoted = "\"";
#else
//define linuxFileNameCharsNeedEscaping = " !\"$&'()*:;<=>?[\\`{|"; // "#%+,-.@]^_}~" are ok
const char * escChars = " !\"$&'()*:;<=>?[\\`{|"; // linuxFileNameCharsNeedEscaping;
#endif
public int Tokenize(char * string, int maxTokens, char* tokens[], BackSlashEscaping esc)
{
int count = 0;
bool quoted = false;
byte * start = null;
bool escaped = false;
char * output = string;
for(; *string && count < maxTokens; string++, output++)
{
E:\sdk\compiler\libec>mingw32-make --debug=b obj/release.win32/expression.c
GNU Make 3.82
Built for i686-w64-mingw32
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
File `obj/release.win32/expression.c' does not exist.
@ecere
ecere / gist:5523569
Last active December 17, 2015 00:49
#include <stdlib.h>
#include <stdio.h>
#include <sqlite3.h>
int main()
{
sqlite3_stmt * stmt = NULL;
sqlite3 * db = NULL;
sqlite3_open_v2("test.sqlite", &db, SQLITE_OPEN_READWRITE, NULL);
if(db)
#include <stdint.h>
typedef uint64_t uint64;
typedef unsigned int uintsize;
struct Class;
typedef struct Class * Class;
typedef unsigned int bool;
static char * UInt64Hex_OnGetString(Class _class, uint64 * data, char * string, void * fieldData, bool * needClass)
{
static char * UInt64Hex_OnGetString(Class _class, uint64 * data, char * string, void * fieldData, bool * needClass)
{
}
static char * UIntegerHex_OnGetString(Class _class, unsigned int * data, char * string, void * fieldData, bool * needClass)
{
}
-exec-next
^running
*running,thread-id="all"
(gdb)
=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040157a",func="main",file="obj/debug.win32/ide.main.ec",fullnam
e="E:\\\\sdk\\\\ide\\\\obj\\\\debug.win32\\\\ide.main.ec",line="1666",times="1",original-location="obj\\\\debug.win32\\\\ide.main.ec:1666"}
*stopped,reason="breakpoint-hit",disp="keep",bkptno="2",frame={addr="0x000000000040157a",func="main",args=[{name="_argc",value="2"},{name="_argv",value="0x33562
0"}],file="obj/debug.win32/ide.main.ec",fullname="E:\\sdk\\ide\\obj\\debug.win32\\ide.main.ec",line="1666"},thread-id="1",stopped-threads="all"
(gdb)
-break-insert WinMain
import "ecere"
class SlidingPanel : Window
{
bool dragging;
Point startScroll, startDrag;
bool OnCreate()
{
group.size = { scrollArea.w - 20, scrollArea.h - 20 };