logs archiveBotHelp.net / Freenode / #2f30 / 2015 / August / 14 / 1
nuun
hmmm ... I don't know jack
stateless
morning
k0ga, can you explain again why all the old structs have their members prefixed? like tz_ or st_?
I missed that bit on #suckless
k0ga
stateless: because in k&r C struct members were stored in the identifier namespace
something similar to enum constants today
stateless
ah right
so if I have an array of two structs
how do I differentiate the identifiers in each?
is it at an offset?
also what if I have a global identifier outside a struct with the same name?
k0ga
it was only an offset
I think you could even apply them to any struct
not only in the struct were it was defined
but I am not sure about this
stateless
ok so let's say I referenced tbl[0].foo_bar and tbl[1].foo_bar
k0ga
stateless: and about the global identifier, you had a name collision
stateless
based on the index it would calculate the offset?
well based on the index + table symbol
so I would get a name collision if I had foo_bar also as a global? hm interesting
k0ga
offset from the beginning of the struct
imagine this in assembler:
STRFOO EQU 4
STRFOO.I EQU 0
STRFOO.J EQU 2
STRFOO.I and STRFOO.J can be used in any place
LD A,(IX+STRFOO.I)
(IX pointing to a STRFOO struct)
stateless
back
ok so what is .I and .J?
how do you generate those suffixes
k0ga
struct foo {short i, j;};
stateless
ah ok
ok so what if I had a second struct
at the same time
how can I have STRFOO.I appear twice?
k0ga
?
stateless
ah sorry
IX is pointing to STRFOO
ok
so that would be pointing to the 2nd struct
k0ga
this is the way how I have implemented struct in assembler always
and when they implemented structs in C did the same that is usally done in assembler
s/usally/usually/
it was a kind of enum, where each constant took the value depending of the size of the fields
stateless
yes
k0ga
(I don[t know all the details because I have not coded anything in k&r C)
s/\]/'/
Evil_Bob
\o/
FRIGN
good morning guys
Evil_Bob
morning FRIGN ! http://i.imgur.com/gxcQzVD.gif
FRIGN
#hiltjocat
Evil_Bob
you said it bi**h
stateless
Evil_Bob, cool added write support for tftp: http://sprunge.us/EIEE
it is essentially complete
so you can do sth like ./tftp -h localhost -c myfile < myfile to create the file on the server or -x myfile > myfile to extract the file from the server
FRIGN
stateless: very nice work!
stateless: so are we going to add it to sbase?
or is it unportable in some way?
stateless
it is totally portable
tried it on linux + various BSDs + solaris
lol
+ ipv6 support too
FRIGN
hehe :D
stateless: so why err.h?
stateless
the power of BSD sockets :)
FRIGN
:P
stateless
FRIGN, will remove that
FRIGN
kk
doo eet
stateless
later when I integrate it with sbase
FRIGN
yo
stateless
this was developed standalone
:)
FRIGN
will we integrate it before 0.1?
I mean, is it stable?
stateless
after I think
:)
it is stable yes but probably after
well the get path is stable
FRIGN
why? :P
stateless
the put path needs more testing
FRIGN
ok
stateless
so depends on when we do the release
FRIGN
I mean, let's just put it in
stateless
ok
FRIGN
twss
stateless
I will add it later today
with a manpage too
FRIGN
it's a 0.1
:P
not 1.0
^^
we are insane
stateless
hahaha yes
FRIGN
wth are we going to do in 0.2-1.0? :P
stateless
nothing :P
hahaha
last release 0.1
:P
« prev 1 2 3 4 5 next »