So, /prog/, I'm writing a general library in C, with the aim of being somewhat inspired by libraries such as glib, but far lighter and cleaner. So far, I have a linked list implementation and a Unicode string implementation (this is incomplete), totalling 670 SLOC. The build system is cmake, the code is fully documented with doxygen. Of course, the library is in its infancy and far from finished; what other things should I implement? Any data structures? OS abstractions?
Name:
Anonymous2011-09-13 10:29
ooc already has you beat by miles.
Name:
Anonymous2011-09-13 15:17
>>28
use keys that aren't numbers. They are just better.
hints you shouldn't be using a number for something: adding two of them doesn't make sense and is not useful.
>>42
...Care to explain? I can't see how i'd use anything else..
Yeah adding two keys doesn't make a lot of sense...
Being able to increment a key with X+=1; is kind of nice though...
>>46,48-49 Please stop decreasing the average quality of posts where the name field is equal to the string "n3n7i".
Thank you.
Name:
n3n7i2011-09-14 3:29
>>50 Technically, you could just about call it a linked list?
Except index isn't actually linked to the record it resides in...
It could easily be turned into a linked version though?
Name:
Anonymous2011-09-14 3:38
n3n7i is trying so hard, it's adorable
Name:
n3n7i2011-09-14 3:40
if Index is taken to represent a Next pointer
aStruct[1].Value = "B" // .Next = 4
aStruct[4].Value = "A" // .Next = 3
aStruct[3].Value = "D" // .Next = 2
aStruct[2].Value = "C" // .Next = 1 (Loop?)
...Sorted without even moving the array entries?
...Its a linked list Array =)
...This may be useful >> ? Co-ordinate systems in databases??
Eg. you use two ints to locate an entry, with one representing the TABLE!, and the other the position in that table?
Name:
n3n7i2011-09-15 23:13
=) ... hee hee =)
... Or I could use tries >> ? Then build an IA =)
... heeheehee =) play chess >> though? with Tries? ...
... like n=b >> b<n =)
Name:
n3n7i2011-09-15 23:19
... Sorry my bad, not Tries... Mean hash >> hash tables? =)
Or ... Just linked list for index, ...? =)
indexes with >> linked list
... Might try some libs ... =)
... heehee =)
>>65 + >>69 should be enough for a basic word-store, at least
//to clarify; how do i 'Define' a structure-variant on the fly, malloc-ing a hard-coded struct definition is no trouble, but can I 'soft-code' a struct?
ghioiod kliorud io'vm ghavmiobngh a seiotzrurue gherue
ctzghruklghru fjtzghaghbn
Name:
Anonymous2011-09-17 6:46
>>1
C should have all this in stdlib, but it sucks so it doesn't. Let's see...
- I hope the Unicode strings library is not zero-terminated.
- A similar non-zero-terminated strings library for binrary-safe octet streams without any specific character encoding should be useful too, unless your Unicode strings library can handle invalid data and be used for this.
- Cons lists (as in Lisp)
- Variable-length, dynamically allocated vectors (as in Python)
- Dictionaries (as they work Python)
- Utilities to deal with and convert these as necessary
- Optional garbage collector? Don't implement a new one, see if you can include any other project.
- I'd leave OS abstractions last as you can use POSIX functionality, but if you get to it, overflows and shit C is missing, common terminal handling, low-level I/O, common ioctls, files and directories, sockets, threads and common process launching, handling and signaling are my top preferences.