Check-in [73ad0dee58]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:removed some old todos
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:73ad0dee589a5d748701c0d63c74a7a94cfda8e211d454a93060ef718534fd57
User & Date: grable 2018-10-31 22:37:43
Context
2018-10-31
22:50
added struct arguments and results to callbacks as well check-in: f21b191cf5 user: grable tags: trunk
22:37
removed some old todos check-in: 73ad0dee58 user: grable tags: trunk
22:34
added struct types as defined in ffcall, as 't' and 'T' based on pointers with explicit size. !! only for imported functions currently. check-in: d91d2ed686 user: grable tags: trunk
Changes

Changes to jimff.c.

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
 * jimff misc
 */

#include "strrpbrk.c"
// macro for getting file name component of a path
#define jimff_path_name(s) ({ const char* _n = strrpbrk( (s), "\\/"); if(_n) _n++; else _n = (s); _n; })

//TODO: now that pointers are up and running, add structs as supported by ffcall... 't' and 'T' maybe?
//TODO: should be mostly a straight copy of 'p' and 'P' with same optional size, but with its own storage.

//TODO: since we are already preprocessing the typetags, maybe add some additional typing to callbacks...
//TODO: as of now, they are untyped and will crash if wrong callback is called.
//TODO: so instead of 'x', something like:		vp(vp) -> void (*)( void*, void (*)(void*))
//TODO: or maybe keep 'x' internally, but use ':'  and a name of an already defined callback:	vp:cb1 -> void (*)( void*, cb1)
//TODO: or just use 'x' as it is now and require a name afterwards... this would require sticking to standard ident characters though.
//TODO: unless adding quoting of some kind to the mix :/
//TODO: i still want this to be typeable without any whitespace or seperator characters, so it seams the last option without quoting should work best. 

/****************************************************************************************************
 * jimff typetags
 *
 *		char		c type							jimff type							-	notes
 * ------------------------------------------------------------------------------------------------------------------------------
 *		v			void							JIMFF_TYPE_VOID
 *		b			unsigned char				JIMFF_TYPE_UCHAR
................................................................................
		case 'Z':	return JIMFF_TYPE_VOIDP;
		case 't':
		case 'T':	return JIMFF_TYPE_STRUCT;
		default:	return 0;
	}
}

//NOTE: checks if a typetag  string is valid, compresses it in the process and stores it in result, allso stores the returntype, returns 1=success or 0=failure
static int jimff_validate_typetag( const char* typetag, struct jimff_typeinfo* typeinfo) {
	assert( typetag );
	assert( typeinfo );
	
	int argc = 0;
	int gotrtype = 0;
	int type;







<
<
<
<
<
<
<
<
<
<
<







 







|







35
36
37
38
39
40
41











42
43
44
45
46
47
48
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
 * jimff misc
 */

#include "strrpbrk.c"
// macro for getting file name component of a path
#define jimff_path_name(s) ({ const char* _n = strrpbrk( (s), "\\/"); if(_n) _n++; else _n = (s); _n; })












/****************************************************************************************************
 * jimff typetags
 *
 *		char		c type							jimff type							-	notes
 * ------------------------------------------------------------------------------------------------------------------------------
 *		v			void							JIMFF_TYPE_VOID
 *		b			unsigned char				JIMFF_TYPE_UCHAR
................................................................................
		case 'Z':	return JIMFF_TYPE_VOIDP;
		case 't':
		case 'T':	return JIMFF_TYPE_STRUCT;
		default:	return 0;
	}
}

//NOTE: preprocesses a typetag string into a typeinfo structure
static int jimff_validate_typetag( const char* typetag, struct jimff_typeinfo* typeinfo) {
	assert( typetag );
	assert( typeinfo );
	
	int argc = 0;
	int gotrtype = 0;
	int type;