in other languages a pointer or reference is different when you print it it always prints what it refers to instead
is stdbool.h a standard header?
i tried including it, but vs says it cant find
it’s c99 iirc
hmm
How can I malloc space for something strtok returns?
rretzbach, strtok returns a pointer doesnt it?
strdup ?
is it possible to have more than 65535 TCP connection with the same interface ? or do I have to create aliases to have more ?
TCP port space is limited to 65536 ports, so no
per IP address that is
I keep getting an error in fgets, while the pointer to my buffer isn’t NULL, and the buffer should be large enough for the string I’m reading…
are there any other possible reasons for a SIGSEGV in fgetsN?
boegel, code?
kind of hard to show, because it involves several functions from a rather large framework… I didn’t write the code myself, I’m just trying to figure out why a benchmark fails with a Segmentation fault on some particular input
if you really want to check it, see http://www.bioperf.org/BioPerf.zip and check the Source-codes/Predator/prdread.c file at line 451, that’s the fgets which fails
=/
hehe
I know, probably not worth the hassle…
oe, coming closer… I slightly adjusted the input, and now it does work fine…
boe, coming closer… I slightly adjusted the input, and now it does work fine…/b
ok solved, the program didn’t handle the input well…
I still don’t know why the fgets crashed, but atleast now my problem is solved
Morning.
rad
Howdy!
just had breakfast, found out local university has NO books on Octave it’s a mathamatical programming language. Kinda c-like too
ujust had breakfast, found out local university has NO books on Octave it’s a mathamatical programming language. Kinda c-like too/u
Octave is the Linux Matlab clone, right?
I want a modern 2.9x version of the manual in pdf.
try searching for books on Matlab
Linux/win32. it has some compatibility with matlab, yes
For only being 11mb, it’s amazing.
(and 12 dependencies in linux
never ever use fgets
char str[32]; fgets(str); what happens when the user inputs more than 31 characters?
zid`: you are on crack. go to sleep.
yes
you are talking about gets(), not fgets()
yes I am
I am?
awesome, I SHOULD go to bed
is fgets the nice one?
fgets requires three arguments.
yea
yes
mm, how long have I been awake now
both they both have overrun issues?
s/both/dont
fgets() is fine as long as you correctly specify the size limit
don’t forget the
fgets(s, sizeof s, stdin); is fine, assuming s is an array.
fgets reads at most 1 less than the size parameters, to take into account the ”
s/meters/meter/
so fgets is actually safe in that it will cut you off… whether file or stdin.
yes
you of course want to check if you’ve been “cut off”
and act appropriately
zid`: I didn’t, the benchmark people did
It will wait for an ENTER before proceeding of course.
fgets doesn’t wait for anything
but it will stop reading if it sees a newline
or reaches the EOF condition
yea it doesn’t chop newlines, that’s what annoys me about it
If I type 80 characters into fgets expecting 80 characters, you’re saying it will automatically move on?
I tend to write one that does
what is this “move on”?
execute next statement
fgets() reads from a stream until newline or EOF or size-1 chars.
and how do you know if it chopped a newline, or just didn’t see one yet?
Right.
which can have interesting possibilities.
cus of how many characters it reads
if it reads limit characters?
where limit is the specified size
it just puts the over the \n at the end if one exists
Thats an interesting test:
zidfgets(buf, 6, stdin); if that produces “Hello”, how do you know if there was a \n?
I don’t care
then you fail to read input properly
fill a string with a single character, pass it to fgets up to say half, and what do you actually get
why?
because perhaps the user entered “hello world”
or perhaps the user entered “hello\n”
you don’t know.
it always ends with a \n if it fits inside
it’s from a keyboard not a file
it doesn’t matter if it’s from a keyboard or a file.
no, it shouldn’t matter.
yea it does, you have to hit enter to enter the command
so what if they do “hello world\n”
so I get EXTRA \n on the end that I do not need
uso I get EXTRA \n on the end that I do not need/u
so you leave the \n on when you want to parse input?
so, if the size parameter is 6, your function will return first “hello”, then “world” then “”
so you can’t tell if they sent “hello world\n” or “hello\n” then “world\n” then “\n”
‘my’ function will will it?
the one you propose that just removes \n
I tend to write one that does
I’m curious about this function
ie, how it would behave in such a situation.
do { a = getchar(); while(a != ‘\n’ && a != EOF); or something
with an array in there somewhere
nevermind.
what’s so hard to understand about wanting user inputted strings not to have trailing newlins?
I agree that you would not want a newline.
then I don’t see the problem
using fgets in Win32/”dos” causes the newline to be retained
fgets() retains newline everywhere, it’s a feature
zid`: how will you communicate a full buffer vs full line accepted? you might setup a flag, fgets uses the newline.
that behavior isn’t necessarily guaranteed in gcc linux I believe
why would I need to?
the newline is retained if there’s room, and one is read.
It’s a mixed blessing.
printf(“Please enter your 8 digit ID code”); zgets(str, 9);
if I DO care, I won’t use that function
i’d use.. fgets
I wish there were a version thats DIDN’T
make one.
Although its easy enuff to truncate it out (newline(s))
well, that’s fine as long as you flag the condition of “didn’t read a newline”
which behavior isn’t retained with GCC/Linux?
unline fread you _would_ expect it to retain all up to size of buffer
^unlike
it’s one line of code to truncate a newline from fgets() if needed.
I was under the impression, somewhere, fgets doesn’t always retain newline
it doesn’t.
well
it does, provided a newline was read
Ok. I guess thats clear now.
if it’s yet to reach a newline, because size-1 characters have been read, or the stream is EOF, then there will be no newline, naturally.
int zget(char *str, int len){ char t; int a; for(a = 0; alen; a++){ t = getchar(); if(t != ‘\n’) str[a]=t; return a+1;}
something like that
Anyways, I have a sick computer expecting a ram transplant. Later good folks
A ram transplant? It’s run out of free slots?
yop
you fail to take into account EOF, and t should be an int
that’s why I said something
and not exactly that
can stdin even return EOF?
getchar() can return EOF
zid`: Yes you can put an EOF into stdin.
and getchar() only works on stdin
you don’t put an EOF into stdin, EOF is not a character.
foo “EOF”
yea
hence me saying something like that and not exactly that
I typed that all out in on go on IRC
examples aren’t very useful if they’re broken
it worked 99% of the time
it also returns after only reading one character
i’m sure it does
I meant to have an else break
at least
Mornin’
morning PoppaVic
lo
morning
if(sscanf(sp, “keysym=%d”, &num) == 1 || sscanf(sp, “keysym=0x%x”, &num) == 1) == is that a sensible way to do it?
with strncmp then do strtol on sp+7 with a base of 0
but yours seems reasonable also
strtol has the advantage of pointing out where it failed
Hmm… true I guess
and accepting octal and hex and decimal
I’d usually get the return from sscanf, and cascade them
Oh.. strtol automatically does the oct/decimal/hex ?
Hmm?
yes, with base 0
yeah, strtol has basic base-support
Ahh yes.. I forgot that
a very simple question… while stepping through a code in gdb, does it show the line it has executed, or is going to execute?
cascading.. such that n=sscanf(); then if(n…) … for each tidbit form.
about to
Keeping them in a “cascade” lets you avoid messy, nasty multiple-if
fifo_fq = (fq *)malloc(sizeof(fq)); …. gdb shows this line… on pressing enter (next)… memory corruption signal!
why can’t I do a simple malloc?
well, stop casting malloc and then see what you are asking it for size as well
because you smashed your heap earlier on
what type is fq?
maybe you should run this through valgrind
fq is a structure
well, remove the cast.
other than that, there’s nothing worng with it, you may’ve corrupted stuff elsewhere.
no benefit even after removing cast, same error at the same place!
then you have undefined behaviour elsewhere, try valgrind as wcstock suggested
er.. wcstok
But there’s a free() call after those statements… the free() call is successful on first run through the loop,
If I remove that free call, the whole program runs smoothly!
Should I really care about freeing stuff?
free is totally useless
do you care about ensuring your program is correct?
yes I do
I don’t know what valgrind is (googling)
you should always free what you malloc
if it crashes on (what looks to be a correct free()) then you have other issues, which may show up as random failures 3 months from now
and you should never free something you didn’t malloc
though free on a null pointer does nothing.
ah well, I am freeing up something I am damn sure that I malloc’ed it!!
its not even a free on a null pointer
then you’ve corrupted malloc/free’s state, probably
free(NULL); is harmless
why are you still here and not valgrinding that program yet
if this program is relatively short, you might show us
because I’ve to know what valgrind is…
google knows
you started googling for it 2 minutes ago, you should know by now
i m learning
hell I bet even msn knows
lol,… but just a question, how do I fix malloc/free’s state?
hehe
by not breaking it in the first place?
don’t corrupt it
heh, http://www.valgrind.org/ is ECONNREFUSED
(for me, anyway)
yeah, same…isn’t that just about the worst timing ever
yeah
maybe they corrupted their heap
a little while earlier, I found out that I am using same structure in two different link lists…. so things are mixing up! I fixed them by creating copies…
CONNREFUSED here, too
well, feel free to http://rafb.net/paste/
what platform are you on?
linux, x86
okay, which linux?
its not really big, but must be confusing for you… I am a bad programmer…
Ubuntu Feisty Fawn
got htons?
sudo apt-get install valgrind
the life of a bad programmer is a confused one
heh
I doubt it would confuse me
possibly a short one if some maintenance programmer ever finds your whereabouts too
of course it may make me want to gauge out my eyeballs, but I’ll take that risk
er.. gouge
besides, you’d kill him _first_ – then maim yerself
403 lines in all .. in 3 files
ah
huge!
well, let’s see what valgrind says
http://rafb.net/p/ZmqJhp88.html http://rafb.net/p/JAvWuC31.html http://rafb.net/p/d2ffCg68.html
Hi, what is the correct name for things like %d %s %c I just call them place-holders, but what is the correct name?
format-strings
well i am installing valgrind.. almost done
format specifers?
er, specs – right
Thanks!
if you are still reading my code, then let me tell that read test.c first, and that this is a simulation of paging/virtual memory… (no real process etc. are created, no real memory either)
why are you including .c files?
first multi-file program… forgive me… should I make headers and link a library?
well, you should put prototypes in your headers and definitions in your C source files
I promise to fix that
are you using gcc?
if so, I suggest using -Wall
if you are already using -Wall, I suggest you pay attention to the warnings
code-by-guessing in action?
Let me try to use -Wall
haven’t looked closely enough yet
I tried to look – my eyes crossed
does fopen() and family exist on windows?
I doubt it
yes
(what family?)
fopen exist whereever is a sane stdio implementation
yes it does
ah
is there a way I can tell if I’m on windows? Like checking a #define or something?
why do you care what OS you’re running under
there are probably some #defines set by your compiler. But use them as little as possible
thinks like sockets (winsock vs sockets API)
yes… try to write and execute a virus
what compiler are you using?
I don’t think you mean
what?
_WIN32_ is a fairly common define for windows compilers
for (ptr = *dpq; ptr; ptr = ptr-next) { if (ptr-frame = frame)
==?
wow, you are great!
gcc -Wall told me that
cool thanks
would you happen to know if gcc for win32 defines _WIN32_
and yes Wall is great too, just like you!
!warnings
warnings is http://www.iso-9899.info/wiki/WarningFlags
for the second time in this week, I felt silly
thanks a lot!
that’s not often enough
it’s probably not the only bug…
looks like my installation of mingw defines WIN32, _WIN32, __WIN32, and __WIN32__
well thanks a lot.. now I’ve installed valgrind too… let me try myself… if stuck I will ask for help
oka
still the memory corruption is at the same place
yeah, other bugs then
it’s too big and complicated for that to be obvious
how can I print “hello” to the screen every ten seconds say?
(I’m in linux)
Every ten seconds, exactly? 360 times per hour?
while(1) { print hello; wait 10 seconds }
sleep(10); and a loop
In suitable pseudocode
Ah, but that’ll drift.
Chris, thanks
and yeah, it might take more than 10 seconds
s/might/will/
Chris, is that 10 user seconds?
sleep() is defined by POSIX, not C.
it’s 10 wall clock seconds, at least, man 3 sleep
unless a signal arrives..
Chris, ok.. then why will it take more than 10 seconds?
for a good program, should valgrind show no errors?
because sleep(10) guarantees to sleep for _at least_ 10 seconds, not exactly 10 seconds
kazim59, yes but hard to achieve :
Chris, eek
well.. umm.. iirc, sleep() will also tell the system to pass around time to other processes too.
in practice, it will probably be pretty close to 10 seconds
there can be some ‘unimportant’ errors, usually in system libs …
yes, sleep will ket other processes run
kazim59, not as hard as getting a program to have no errors/warnings in splint… which is basically impossible
it’s not that hard
184 errors… ?
heh
184 is a big number, or a small?
kazim59, do they look serious?
big.
Oddly, calling sleep increases your priority. Fun, that.
yes.. all of them refer to addresses in my program
kazim59, get debugging
Not sure I followed that.
it could be that one bug is causing all 184
kaz
or not
kazim59, how long is the code?
400 lines
I have 10k line programs with zero valgrind errors
Chris, you could try splint
calling sleep is ‘nice’ for other processes (so the system may consider giving you cpu time later)
I use splint
Chris, how do you stand the number of warnings? Do you turn most of them off?
some, yeah
its giving errors in things as simple as list traversal… !?!?
try to understand the errors
you are suggesting that the sleeper may get a slightly better chance to run again soon because you are deliberately passing off the timeslice, yes?
I guess. Actually I was just passing by, but..
kazim59, are you double allocating/failing to free things?
heh
I’d never thought of it as other than “well, shit – go ahead guys.. I need a brisk nap”
like sched_yield
failing to free things yes… but not double allocation
kazim59, ok.. well there is a bug already
invalid read size of 4 means?
I _told_ you to check that sizeof ;-
except http://valgrind.org/ .. oops
I think his sizeof’s are okay, actually
valgrind web site is dead?
I’ve not looked since the very initial bit. But, he’s got 2 tons of issues to resolve.
yes right now
yep
valgrind.org does not respond
it responds with a RST
death of an apache?
sizeof in the malloc? what can be wrong there?
looks like it
what line does valgrind give that error for?
I’d run your program with valgrind myself, but i’m scared it will turn my computer into a pumpkin or something.
ah, you are dereferencing a pointer after free()
that’s bad.
ouchies! *poof*
no that has been fixed.
okay
well, keep fixing
1 down, 183 to go
heh
valgrind runs the program completely…. and the results are exactly what is expected
and every single fix suggests a recompile to see new warnings/errors ;-
also that if I remove the single free() call, my program works fully!
do you still get valgrind errors?
undefined behaviour includes working as expected, just don’t be surprised if it bites you later.
yes.. .and that too in a silly function called print_queues
if it runs w/o the free(), I’d expect anal-leakage
whats that!
that’s either when yer butthole leaks all over yer chair/pants, or leaks mem while the program is running: only your compile hosting can tell you which you are suffering
I was better without that definition
can you see an invalid read in print_queues function (memory.c)… I don’t think its possible!
keep that ugly, disgusting, sad image in yer mind and you attack every single warning, error and glitch – fix it or leak to death.
your leaking concept is weird..
well, ptr-next might refer to garbage from some other bug
it might be weird, but I’m not the one with the issues today
so’k – it wasn’t remotely a priority
well, think I will get an early night
goodnight
btw, a useful trick is to use a free() wrapper that magically frees the ptr and then NULLS that ptr as well.
laters, Chris
I’ll sit here entire night.. .. counting down from 184… and when its 0.. i will throw a party to all ##c
hey… is if (prevptr) and if (prevptr != NULL) the same?
yes
(if prevptr is a pointer)
brrrr
grrr, too
grrr? all well?
I’m searching for a safe way to receive and parse an http request. I was thinking that I might make my program expect “\r\n\r\n”, but this might also be absent in the case of a malicious attempt to crash the server
Then make sure nothing can crash your server.
One way might be to receive each request asychonously in a thread, and give each thread a timeout response.
this is why I’m searching for a way to parse it safely
I don’t see what security has to do with protocol compliance.
If parsing fails, perform cleanup and error wiggetstuff.
complying to a protocol does not mean someone could deliberatly try not to comply to it to see what would happen
then is there a way to know what was sent in a single send() ?
because it can be fragmented
you are extremely confused.
tcp is a streaming protocol — there are no fragments, there are no packets.
and what would knowing about a ’single send’ tell you?
that it is a complete request, but then someone could try sending a request in two send()s
so yeah, useless.
utter nonsense
well, ok — you’ve realised why it’s a stupid idea, then
I suggest that you look into this thing called ‘eof’ ..
ok…
it’s just “one of those days”
ooooh goody. Those days are worse on Mondays, too.
can i use a structure from a dynamic library or does it have to be functions only?
ucan i use a structure from a dynamic library or does it have to be functions only?/u
I think there are ways you can hack this in.
yes.
but how do you expect to use it?
I love it when you say yes to an either or question.
it’s just fun
I really hate having to come up with 2 structures to do one thing from 2 directions. Damn.
well i want to use the openssl libraries but i want to use them dynamically
on closely setting watches on pointers, I’ve come to realise that value of one of my structures changes magically at 0xb7efffd1 in ?? () from /lib/tls/i686/cmov/libc.so.6
and that’s what i need the structures for
the structure data is modified, and gdb has no idea of location…
well, how do you expect to use the structure?
and how is the structure allocated?
look at the call stack. you are possibly overruning somewhere in your code
i don’t know, that’s why i’m asking for advice
we can’t tell you how you expect to do things …
structure was allocated using malloc
how to look at call stack?
he is – no question… He’s had issues with sizes, pointers, malloc and free
and how much space did you allocate for it?
well can you tell me something i could search to find information relevant to what i want to do?
sizeof the structure
well, no — because you can just use variable defined in shared libraries normally …
show the malloc line
I suspect he’s not yet cleaned up, rebuild all with -ggdb, run it via gdb and had a backtrace
statically linking the library allows me to do SSL_etcetc instance;
but if i were to do that with a dynamic library it would not know what SSL_etcetc is would it?
statically linking doesn’t do that
you are one confused puppy.
heh
freeframes = (fq *)malloc(frameCount*sizeof(fq));
Cute.
including the appropriate header file allows you to do that — absolutely nothing to do with linkage.
; Ambience audio system
;
; Controls:
fgjopsdfg
;
Cuter.
ah, a mildly retarded puppy.
fq is a structure with one int, and one * to itself
OK SORRY
is there a C99 type which is 24 bits wide?
don’t shout.
dflgjhsdkgh my ctrl button is broken and i pressed v
no
like uint_32_t but only 24 bits
v.sorry k
what is frameCount?
10
what is the typedef for fq?
see stdint+stdint.h – that’s your interface.
typedef struct st_frame fq;
well, perhaps you’ve just corrupted the heap — try valgrinding it
struct st_frame { int frame; struct st_frame *next; ;
tried valgrinding… valgrind runs the entire program successfully
though in summary, it tells 183 errors!
then … correct each error
well, he started with 184 errors via gcc ;-
can’t! it shows error at a place where I cannot expect
i will win
ok… right now… the best solution seems to restart my PC…
ahah … ‘you have defeated gcc … level 2 … the boss is valgrind’
what is it lately with the 24-bit unsigned/int crowd?
24bit unsigned ? what is that, upload your images online color ?
ahhh
that could be it
i thought these days you needed the extra 8 bits for alpha
perhaps you should read those errors?
I have no idea.. Even RBG is still around
depends of the picture format …
rbg? uh i doubt it
well, that suggests to me that there is a lib/api around.
well … much more than one
no, I meant for whatever clusterfuck they are pretending to reinvent
I don’t know … last time I used 24bit ints, it was a school project, meaning ‘no nice lib’
well, I can see several ways to diddle it – it just means another API
Surely that’s easy… Just use uint24_t
If your compiler can’t cope.. fiddle with it ’til it can
which is what began this issue ;-
oh, my, God
I remember that I used a union of uint32_t and int8_t[4], plus some fiddling for endian issues
folks just need to email their Friends at iso/ansi and holler for all that support once and for all
not to mention any required shifting/reloading/reordering
libpack
and that handles 24 or 12 or 36 bits?
unlambda is soo awful!!
Unlambda is awesome, faggot!
oh, and 30-packs.
Not odd sizes yet, no… Need to think on that one
yeah, I looked over yer lib. Not a bad idea, but certainly would be nice to deal with endian and these stupid sizes – and floating-point
quit following me around and dropping useless opinions at my comments Jafet
It does deal with endian just fine
well, when you deal with the other 3/6 packs and fp, it will be even more fun
(which was my humorous point)
I don’t see any major need for FP
heh.. someone will – they always do
There isn’t a single natural way to do it, though
brb – lemme’ recycle
libpack provides the mechanism, not the policy
well, I’ve never seen a better way to deal with fp other than a silly string or a simple fraction of a proper size. I have no idea how folks determine a proper size.
how can a thing like unlambda be turing-equivalent?
jeeeez
Hard to do it universally… so.. as I said, I shalln’t bother
you are absolutely not ready for Turing. Just spare everyone
libpack provides primatives to do all the low-level stuff. For higher things, you have to layer something on top of that
yeah, except… those fp are “standard types”
Hello
SICP would have been such an asset if I read it before I began to code..
before you die and rejoin to goto zero: why?
No they’re not.. There’s no one standard bit representation of FP values…
I actually came across it in my earlier coding days — but I suppose I didn’t acquire the disposition to know great books from ‘decent’ books
IEEE [mumble] is close, but not universal
no, I meant “float, double, long double”
another language?
Yes.. The bit representations of those aren’t standard
not even sizes
libpack is all about translating C-level values into and from a bitstream in a FILE* or char*.
but, everyones compliant-C hosts them
Sure.. Every C implementation provides a ‘double’. But not everyone uses IEEE [mumble] as the bit-level representation
Ergo there isn’t one standard way to stream them over a bytestream
I love the “mumble”
heh
I know what you are saying. I agree. And, there is no great solution.
Detect the representation of floating-point types on the host computer, and translate from IEEE [mumble] to the native machine type.
uDetect the representation of floating-point types on the host computer, and translate from IEEE [mumble] to the native machine type./u
even more irksome is that IEEE stuff _plus_ may have an FPU, (and not yours), or may NOT have an FPU.
They are basically opaque types – but with whatever size is hosted and whatever endian is required, etc
Well… Any form of fixed-point would work…
Also explicit S/M representation
(Scalar/multiplier)
Which is basically what IEEE [mumble] is anyway.
But.. all of that would be nonstandard
other than strings, yeah – all I can envision is numerator/denominator+precision
The point of libpack is that it works with _existing_ things.. e.g. most fun /dev nodes, file formats, network formats, etc…
I could invent something but it would then be unique to libpack
That then defies the point of having it
yeap
irritating as hell, ain’t it?
Not really.. I hardly ever need to deal with floats usually
well, I’d consider those oddball mofo sizes and endian. I am pretty sure it’s gonna’ get worse.
Yes.. interesting bitsizes would be fun.. but offhand I can’t think of a good template notation for them
Maybe ‘v’ for bitvector, with some number to say how many bits…?
Perhaps ‘b’ == ‘v(8)’ and so on..?
well, base 3 suggests itself..
Hmm?
I’m not sure, LeoNerd – I’m fighting shit myself. But, this 24-bit and such suggests dozens and 1/2 dozens and trinary.
hi
Not really.. The specific case of 24-bit values is useful in RGB quantities
i’m trying to set a signal handler for SIGTERM, but it doesnt seem to work
add a ‘tribble’ like a “nybble” and go from there?
if I hit ctrl- c it just exits
anybody knows why?
A particularly naïve image format might be 32bit width, 32bit height, then 24bit packed RGB triples
fat-lobyte: See what the terminal sends on Ctrl-C. Likely it’s SIGINT, not TERM
how about some ASCII text followed by those 24-bit packed RGB triples
LeoNerd, thx, that was it. Now it works!
nono, I meant 24-bit is 2×12bit is 4×6bit is 8×3bit, etc
if you can cover tribbles and nybbles – you seem to get the world by the nuts.
Sounds like PPM…
PPM?
image format
http://netpbm.sourceforge.net/doc/ppm.html
Ohh right. Yes, probably it is
libpack was designed to make that sort of thing trivial
I’ve always just allocatted pixmap buffers that are bytes, using 3*width*height and just being smart about addressing it.
A funpack() call for the header, then malloc the main pixel storage array, then a big loop with more funpack()s, then return it.
for 8 bit rgb ppm
In a single ~8 line function you’ve just written a PPM parser
I’m pretty sure a tribble or nybble-cpu would look at it all similar.
funpack can parse ASCII text?
No. That’s what fscanf() is for
althou, if I recall, ppm has line length restrictions, and it can be either hex pack or edecimal r g b vals with spaces. depends on if you use P3 or P6 ppm format
It can deal with a string though
no, fscand/scanf are a mess.
hex? no. binary!
Just it treats that string as opaque… “here’s some characters”
the ppm P6 format has each 8 bit rgb value represented in the file format as 2 hex digits.
ahh, opening the door to another layer?
funpack(file, “dda#”, &longa, &longb, &strp);
^– two 32-bit little-endian 2’s comp integers, and a NUL-terminated string of undetermined length that will be malloc()ed by funpack itself
(yay for lack of buffer-overflow )
ok, that’s where I flogged the mod_cgisock author.
OK.. Then.. allocate your own buffer, pass that in along with its size, and don’t give the # flag.
given that the sender can ascertain how many characters make up a string, force the silly bugger to prefix every string with a count of the form FFFF
PPM headers aren’t null terminated though
Fixed-size? Again, no problem. That’s just a c[number]
nope!
Explicit length prefix? (a.la. Pascal)
nope!
yep
Hmm….
that’s what we did. Explicit, fixed-format, hex. If they had a loooong string, they broke it up to fit.
Oh.. heh.. PPM is text-based anyway
yup
libpack is more for non-texual byte streams
magic “number”, one or more whitespace characters, width, one or more whitespace character, height, one or more whitespace characters, max color value ( 65536), one whitespace character
the c pre-processor is a valid topic of discussion.
then, depending on whether the max color value can be stored in one 8-bit byte or not, 24- or 48-bit packed RGB in normal english reading order
Yeah.. that’s text. libpack is for nontext…
So… list of thing I need to do c++ for a client/server (lan) video stream? compiler, some sort of tcp library, things?
*things
NO no c++, cpp is c-pre-processor.
well, when this 24bit stuff comes in, it matters. I think it suggests libpack has a niche, but it’s not getting seen properly.
see ##C++ for your C++ needs; cpp is the the “c pre processor”
Likely because I don’t know how to get it seen.. What do I do?
!cpp
cpp is The C Preprocessor ; integrated with gcc
I like CPP (the c preprocessor)
Perl has CPAN, Python has the Cheese Shop, PHP has Pear, Ruby has something or other… What does C have like those?
interesting.
well I could give you this code that dereferences a NULL pointer
well, if it is a local-issue, LeoNerd – folks can already commo pretty clear – is that what you want? If it’s between variant machines, that’s when the issues like size and endian get ugly.
no, C has never had similar. It’s sad, but it’s true
C has linux
NS – stay on the curve
It must be said, tho, that there are MANY libs that do cool things in C. just no central place they are located, no central ‘package mgr/downloader’ integrated into C environments.
agreed
so, the libs are just all over the place on the net.
it’s a clusterfuck
part of the reason is that C isn’t really all that ‘portable’ once you stray from UNIX/POSIX.
CCAN’d yee shall find
oh joy. a place to keep cc(1)s!
well, for starters, folks would need a site, like rafb or the iso-thingie.
due to low-level os stuff being different on other OSes.
among other things
C is not C– and C– is (afaik, dead and dry)
apparantly a variant of C– is alive and well, actually…
C– is quite useful for certain bootstrap issues
hi
E.g. write a C compiler in C–
iirc, ‘C’ is only sorta-std based: the keywords are the issue
Then a new system only needs a C– interpreter and it can bootstrap a C compiler for itself
how does that solve any bootstrap issues?
what does the compile generate anyway?
well, vmgen or that funky Lighting GNU thing seems to suggest a C underlayer
eewwwwwww
GNU lightning is a mess of macros
I agree.. We need a way to ascertain “where the hell am I?” plus libobjects, libstaticlib, libsharedlib, libplugins and the API to create, read or employ.
I merely mentioned it because they are _trying_
It might well be that we need a “C interpreter” where the guts can vary all over – but it needs to play portable anywhere with source.
I keep meaning to look for/write a C-CIL compiler sometime
Would be interesting to run C code on Monon
*Mono
CINT is the only one I know, and I never installed it.
Instant detection of things like buffer overruns, double-frees, that sort of thing…
not what I meant.
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CmmType
Still not what I meant.
still has some rather large differences with the C– spec…
Further, I’d point out that folks always want to neglect interpret and who and did/does and the layering. Folks get pissed when I mention “interpret”, but goddamnit it’s a fact.
like not supporting arguments the usual way…
Now that I think about it… It’s funny that folks go nuts on kernel-rebuilds/releases and driver/module installs – tolerate the living hell of it all, and then expect C to be “better”
indeed
what does it mean to have a static function?
even the “ASM is a language” group doesn’t see it.
although some of those issues are related to the architecture of monolithic kernels.
local linkage
well, it’s 100% related to architecture, expectations and reporting: the latter two being “interfaces and access”
or, in simpiler words, static fuctions have file scope, outside that file they cannot be referenced.
Im calling connect() on a socket. It returns 0, but sets errno value to that of “Illegal seek” and my socket doesnt connect. Whats wrong?
no, it doesn’t.
connect(); perror(); prints “Illegal Seek”. errno is not set before connect()
so what?
when does connect() set errno?
hee hee.
I am completely confused. i call my socket() func and errno is set to success. then when i call my connect function, before connect() errno is illegal seek.
Well, Hatty?
obviously what you have told us is false.
A few years ago I used to get peeved that some lisps bypassed everything to generate MC.. I can’t hardly fault them anymore.
when … does … connect … set … errno?
me either.
it doesnt. i was wrong
ok, rethink your diagnosis.
You are not supposed to check errno unless a function has actually failed. It’s set to an indeterminate value by any functions that succeed, or that aren’t specified to set errno on error.
either connect doesn’t return 0, or it doesn’t set errno.
Just out of curiousity, what does “Illegal Seek” even mean?
well, it isn’t set to zero by library functions.
try looking at fseek() manpage.
nothing without context.
it’s not _C_ that’s funky – it’s all the layers between that no one admits to needing, and that refuse to report to a query at the interface. Hell, folks don’t even understand that the MC is interpreted and that – somewhere under it all – is direct, specialized bits that they are being granted access to.
at least one of your observations is false — go and reobserve.
hi all, can someone point me towards a channel that relates to algorithms for generating primes
#math
get realistic
I believe the Mersenne Twister algorithm on wikipedia is wrong
empty
Nah. Just wait long enough.
oops
no one cares if it is empty
cheers
lookup sieve of erathostenes
an interesting thing to note is that MC on the IBM as400/iseries/i5 is all a VM that is over the real silicon–which lets them change out the hardware implementation and still let really really old code still run.
or.. wtf.? mersenne twister is for generating random numbers, not primes!
…also true for every x86 implementation since.. ever
sure, and that’s not much different from layers over the transistors/rheostats that “microcode” is still approximating.
right, although their implemetation allows updates to that layer without replacing the hardware
unlike x86.
yes I know – I’m tired after work
someone, somewhere interprets everything; each “someone” has access, or does not, etc..
understood.. Like flashing an FPGA – which would be a language itself.
yah
zvbra – they do have a period that is a Mersenne prime though (hence the name )
there is a big advantage in relying on an interface and not an implementation
well, we can’t convince most folks
amen
although sometimes we run into the issue where the promise of the interface is not reflected by the reality of the implementation behind it….
hello room
there are also reasons to restrict access, but also to report to queries instead of blindly accepting instructions.
hello
heh – see above. I agree
If I malloc size of 10 structures (for use as an array)…. and If I want to free() just one of them, the first one
how do I do it?
You don’t.
It’s funny that folks will screw around fucking up packets of data for the net and other folks commo – but they can’t see that everything is predicated on this “interpretation”
problem solved.
now, here is a puzzler…
it is a serial thing— if you want to be able to free any one of the ten, you have to malloc all 10 separately.
thanks… I was thinking that I am freeing the first one, while I was freeing the entire 10!
yep
Given that we simply have “the kernel” and access-permissions.. Seems like every tool – and C and the local libc install – is a kicker.
‘a kicker’?
down to 16 from 183 errors in valgrind… hehe (and no invalid read/write)
I do believe C has a future, but there is something wrong with the interface and libc
C has a seg fault for its future.
there is simply no way for every interpreter to ascertain (request/reply) what it needs from a lower level, or know WHERE to look and HOW to ask. etc
’something wrong’ is sufficiently general for me to agree w/ you. I suspect that were this to be duked out, there would be massive dissagreements about what, and if not, there would be about what to do about it.
but then, would the resulting thing even be C anymore?
of course, and most folks won’t agree with permissions/access or the idea of an interpreter
maybe not, but it should be compliant back into the stoneage
if you don’t ask, you don’t know. If you do ask, you can learn, etc
who asks what? when?
I’ve always thought it would be fun to take OSKit and put a wrapper around it, perhaps ruby or something, and make a ‘ruby os’ or ’scheme os’. I just don’t have the cycles for it with children.
get your children to do it
what else are children for other than fulfilling your failed aspirations?
You have 1 new message. ‘/msg Cheiron @messages’ to read it.
lolwut
precisely.
they are failed yet. but if I haven’t done it by the time I die…
s/are/aren’t
don’t go blaming death
children are a responsibility, and a spare pair of hands/brains.
Until they move out
well, I’ve got 11 years until then.
until you can kick them out lawfully?
college?
right
well, sure – if that matters
optimistic
God bless America.
shrug
Every society has BS related to kids. Ain’t one I see is “right”
well, it took when I left home, but my sis lived with the folks, with he 1st-good-for-nada-husbad for a few years.
hopefully, I get two of the former.
but, if theyre in a bind, I’m a softie. so, 11yr may be too optimistic
kids should be monitored, raised/taught as required, trusted (and verified), and then let loose shrug
ideally.
and trained in ninjitsu, in case college doesn’t go well
although if either of them has an interest in software engineering, I may be able to recruit…
unless they’re addicted to WoW, in which case it’s both socially and physically impossible to remove them from the house.
pizza_, speaking from experience?
aaaaaaahhhh!!!!!!
The kid never asked to play – but, once “of age”, they can decide to play or split.
WoW?
exagerrating, but yes
yikes, that is definitely spelled wrong
WoW is a grphical-mutilplayer online game. Never even seen it myself, but it has a rep
I’m pretty sure “college” was never on the list of “this is a parent”
PoppaVic, horrible online game substitute for real life/socialising, addictive, costly and isolating. it ruins lives, and reputations
It’s a boon, at best
wha?
you shouldn’t teach wow-addicts ninjutsu.
of course, there never was a “congrats, here is a new sportscar” clause either.
Kind of what MUD/MUSH/MOOs were to my era, although I didn’t get into them
bKind of what MUD/MUSH/MOOs were to my era, although I didn’t get into them/b
oh, so online-nonsense?
yah
ah
kind of like IRC.
worse than MUDs, it’s infiltrated popular culture
true, that
I get “infiltrated” by virus, and “culture” is bacterial. shrug
meanwhile, I think we pretty-well covered the issues with OS/user/C – it sure reminds me of the bios/bdos days.
Actually, Z’s discussions of better ways to use plugins impacts as well, but most folks would never see it.
I like plugins.
PoppaVic, better ways to use plugins?
I haven’t seen his discussion of it tho. bet it was fun
well, most folks don’t even realize that a plugin is not a……
hmmm
not a what?
PoppaVic, I once thought that most of your program should be plugginable, the core of your program being one to facilitate that. it probably helps if the language you are using makes it easy to plug/unplug code
Auris-: it’s not a .com, a .o, .stlib or a .shlib
so, how many ways to do that are there in C other than configurable dynamic library/routine loading?
other than writing a mini-language, I don’t know of any others
if you look at C, it’s extremely limited. You are now speaking of libc.
ok, not a shlib…. that sounds like I’ve used the term differently theb
s/theb/then
yes, I’m think of plugins through a C lens at the moment
right, and plugins are something for the dlopen/dlsym interface.
ok, thats what I was thinking.
hi
ELF shoves together .so and plugins.
hello, alesan
I have a “stack smashed” problem. I am not sure how this feature works
feature?
it’s not a feature, it’s a bug
fix it
valgrind
bartel, mh?
there’s a tool called valgrind that’ll save you some time
this is why I invest in pwder, primers and bullets.
you overwrite your stack in a routine, and it is a smashed stack. it is often easy to find, you set your brk in the routin and step through it looking a tthe stack. when the stack goes bye-bye, you have your overwrite.
PoppaVic, I am trying to debug where is the problem but… the stack smashing error occurs after I write on a log file, and before I write something else
and in between there is only a “return true”
did you compile ALL of it again, with -ggdb?
PoppaVic, yes, both library (it is where the error occurs) and main app
to be honest I only used -g
shoudl I use -ggdb?
You need a completely clean gdb compile. Do what I said. Then run it, and when it dies, do “bt”
some machines will get bent when you do not use ‘gdb’ as the debugging compile.
bent?
~dict bent
….assuming you are using the gnu toolset.
peeved, irate, useless, fucked, die-well
While that is virtually correct, it only happens in certain cases.
For example on PPC G5s when doing kernel debugging.
yes gnu on linux (will try freebsd later )
I always bring that ‘assume’ up, since I use UNIX vendor’s pricet compilers at me workplace.
s/precet/pricey
where do you work?
In Colorado.
ah, the sunshine state – beautiful
indeed.
I’d test *nix, and *bsd and solaris or something else with a different endian-issue
that endian crap reaches up and RIPS off yer nuts, rather than merely nipping them
PoppaVic, you forget 64 bits versions
I try, I wish others would as well.
Given a baseline size, the rest is moot if the goddamned interfaces are sensible.
You can have both kinds of fun with code that has to run on HP PA-RISC and HP Itanium-64.
shhhh – I am just shedding this headache
wasnot IA64 still LE
and I highly doubt that HP made IA64, after all, it’s “Intel” A 64.
Itanium can do it both ways… so probably siil maintains endianess.
the pa-risc way.
I have one around here somewhere, just haven’t used it personally.
screwing with endian and sizes as an arg to a tool is not gonna’ help.
ok, then I’ll restrain my screams
Ok, dbl checked, HPUX is BEndian on itanium as it is on PARISC
I can specify my endian issues per-object/program: it’s not portable. Back to interpreting/reporting.
The PowerPC chip could go both big or little endian as well. it is fairly common for newer chips to be able to do both, although I believe it is some thing that is configured on the board, so once in palce isn’t changeable.
no
no?
no to which?
it’s a state.. I don’t know if it allows for switching-while-operating or under permissions
It doesn’t allow switch while operating.
I’d never dick with the default, myself
they don’t define a default.
really? State while operating or state while reading?
the way you wire it to the MB, I’m pretty sure, sets which is the default.
there is _always_ a bootstrapping-default
ie, the chip, not attached to a MB, doesn’t have a default. attached and powered on, it does
we return to that “interpreting” issue, methinks.
but it depends on the motherboard.
probably
Hello
it’s all gates, kids
yeah, bill gates.
nah, transistors
Schrödinger’s chip won’t tell you which endian it is until you observe it.
bill was just another wannabe that managed to steal and market
$56US Billon isn’t a wannabe in my book.
oh, _reporting_ – no. I don’t even know if state-switching a ship is checkable/reversable
dude, you think too small: hehe. Thieves and liars remain the same, except they can use yer $$ to lobby and defend
afaik, Bill gates couldn’t code his way outta’ a papersack, let alone his own products/os
hi
Bill Gates is a rather good coder.
according to whom? where? using?
hi all
at least now you should congratulate me…. valgrind says 0 errors!
Oh that’s right, he’s just a business exec.
I’m pretty sure he began as a programmer/hacqueer, but he learned all he needed from IBM biz-practice, and sole the rest. You don’t manage a firm that large by doodling code you can steal or buy or hire.
sole/stole
He’s rather good at modifying src.
rb
brb
he hasn’t personally touched source in years and years – decades
I’m sure he writes little pieces of code..
Just to feel good with himself.
excel macros to pull project milestones of a sql server database?
/s/of/out of/
Even that, i doubt.
Trust me, I predate DOS and Doze – there are others here with at LEAST that age/experience. Gates was never, EVER an “inovator”. Ever.
and he still managed to be the richest dude alive, go figure
now, once you got his Defense out of your “system” – how goes your shitty connection?
He is a good businessman.
yeah, it’s sad.. Knowing whom to screw or steal from, and layers to pay seems to matter far more than we’d think/
layers/lawyers
Meh; it’s a little stable.
Any GLib-ers around here? I’m just currently looking at the GScanner lexical parser… Wondering about how to implement language keywords – identifiers or symbols…?
Any GLib-ers around here? I’m just currently looking at the GScanner lexical parser… Wondering about how to implement language keywords – identifiers or symbols…?
no, 1 horse is a “little stable”
I’m thinking of playing with scheme; gotten some books ;p
coding in an altered state usually results in recoding a great deal later.
i studied it at first year of university
Depends, truly on who you are.
In my college they teach vb and java in first year of cs
sometimes, it does mean “gee, that was a great idea!”, but usually it means “OK, the idea was great – wtf did I mean?” ;
Scheme is to LISP what a lot full of lumber and tools are to a completes mansion.
better to code high then drunk though o_O
you does not need books you can find all you need on sheme web site…
Heh..
so was the 1998 Bjarne Stroustrup interview with Computer magazine actually real?
blah.. back to Whome does What to WHom.
Perhaps, I should check Lisp out as opposed to scheme.
SAtire.
vb? bleah!
we studied scheme and java…
Which is why I study Information Systems
remind me – I stopped subscribing to Byte decades ago
I have to work on so many things.
the interview where he said c++ was a joke that he just threw together to up the salary of regular programmers
we got pascal and assembly in the first year
It’s much like a dream; working on other langs. ;p
they are both pretty cool. If you start with LISP, Paul Graham has a good book. (good books really, but one is not for beginners._
it was clearly satire.
I often thought the article was a joke, but look at the way it has evolved.
yeah
i almost thought it was real
esp the part about destructors, constructors
check out the guile 1.6 manual, it covers learning scheme very well
Track Records, folks.
although it certainly reads as an amusing critique on c++ from a C point of view.
I have the teach yourself Scheme in fixnum days; I’ll go through that first
I’ll look around for a good lisp book later.
thats just good satire
What would you recommend?
Blah, he’s probably gone shopping again.
For LISP, I recommend http://www.paulgraham.com/acl.html
Alright.
1) the cpp can’t report/test as we’d like; 2) C can’t ask/reply ala’ #1; 3) we can’t mess with prelude/exit as we’d like; 4) I sincerely believe ‘asm’ was a mistake.
so i have a structure of arrays that i need to manipulate (i need to delete one of the structures), would it be best web hosting to create a pointer, and copy to struct to the new pointer or is there a way to do this with less overhead
no
since it pointers, i can’t imagine there being to much overhead
you either have an array of structures, or an array of bytes that are interpreted.
but i don’t believe there is a built in func that i know of that is similiar to pop
ubut i don’t believe there is a built in func that i know of that is similiar to pop/u
heh
I prefer the func similar to cola.
you might want to explain what a structure of arrays is
http://download.plt-scheme.org/drscheme/. feck is written in Scheme
while we are talking, Ma’ is hollering upstairs about dinner – which I must make. Same ideas, different context
I’ve used DrScheme. It is pretty decent.
damn women
peapicker, certainly decent for beginners
I’d not mind an independent process/callback/thread: but it ain’t.
yup
Mind if I take a look at your src?
draichis, nope
draichis, feck is here http://monkeyboy.td.org.uit.no/~cin/feckbot/
http://monkeyboy.td.org.uit.no/~cin/scm-irc/
everything (in *MY CONTEXT*) means I do it, or others do. When the others don’t interface well, they can ask/say what they want, but *I* get the chore. This is life and programming.
Groovy syntax.. ;p
Alright, I’ll be back in a little bit; it’s about to rain and I hate the rain.
So bbiab.
“Let’s get that roast in the oven” – oh, the roast I thawed? In the fridge you never look in? cooking it the way I mentioned?, etc
http://rafb.net/p/1i6bsC81.html
and, thus: I still get peeved with people.
or structure, whatever
link doesn’t work ?
oh wait it does
so i want to delete one of these shapes and am wondering what the best way to do it is
you can’t i think
what is “a shape”?
im thinking copy the pointer to another pointer, then edit the second pointer, then copy it back to the first pointer
uim thinking copy the pointer to another pointer, then edit the second pointer, then copy it back to the first pointer/u
huh
but will this work with the structure of arrays
If what you want to delete is an element of struct shapes plotter_shapes[MAX_PLOTTER_OBJECTS]; then you can’t
arrays are the wrong issue; you lost track of the issue
say array of sructs please but how would you delete them ?
if it were individually allocated thing that were pointd to by, say struct shapes* plotter_shapes[MAX_PLOTTER_OBJECTS]; — then you could. (note the *)
I’ve run plotters, done some graphics, and definitely know about structs. So.. yer confused who is doing what with which and what which is and why/
*new_ptry = *struct ; *new_ptr(for loop); *struct = *new_ptr;
no, i am not confused about what i am doing
you most certainly are, or you would not be asking
so that is where structures of pointers comes in handy
shit man, im just trying to delete an element from an array
simple as that
array of pointers to stuctures is what I described.
im not to that level yet
you can’t the_plumber, you can zero them out, but you can’t de-allocate them or remove them
arrays of structure can’t have members deleted from the array. You can blank a member out with memset though.
yeah, as snhmib also pointed out
ahhh, so can’t i just copy the structure to a new structure and then copy that back?
bahhh, so can’t i just copy the structure to a new structure and then copy that back?/b
I have no idea what you mean by that. perhaps some example code accompanying your question would be better.
in my opinion, there are two forms of allocate/malloc – will you listen?
well that might work, but you have to copy the contents of the array, not a pointer to it
with memmove() or something like it
hmm
with array i mean struct
OK, then forget it.
i always have an open ear
I asked a simple question, earlier: yes or no?
im gonna grab a book real quick
I use a modem. Go ahead, and stop screwing around.
that was a yes
I /that
he has to LISTEN and REPLY – or it’s not worth my time, and it makes everyone else here that cares suffer it.
hold your horses for a sec, had to get coffee too
wake the hell up. Respond.
ahh, coffee is good – go piss while yer thinking about it ;-
heh, cans right behind me
that scares me
OK, are you set up?
almost, i need to check one thing though
you need a better nick
how about ‘Mario’?
“Kong”
mario was a plumber.
oh, really?
http://en.wikipedia.org/wiki/Mario_Bros.
“Unlike Donkey Kong, where he was a carpenter, in this game Mario became a plumber, exterminating pests who exit from pipes.”
PoppaVic:L what got me thinking about the structure copy was a swap example i saw in a book
wow you totally ruined that joke
=(
yer being an anal-retentive pendatic
haha
My nick _is_ peapicker.
which used pointers to swap numbers. it was a call by reference function
what does that mean? In this context and today?
NONONO
So, I pick at peas.
hah
There is no GODdamned “call by reference” in C
how’s that working out for you?
dude, I unignored you
come on, relax a little
call by reference?
Almost have enough for pea soup.
so what is this? void swap (int *i);
are you thinking C++? or just stupid?
I’be decades on your forthish
I am relaxed, you just misinterpreted what I said is all
I’ve
please, all I’d like is that we help these kids or joke.. I get to the point where folks seem to get mean and nasty about helping.
the argument (int *i) passes the valus of the pointer *i.
hrm. I’ve actually been talking to you for days. no wonder you didn’t respond
s/valus/value
call by reference?
I think it was some bot.
or call by value?
which word did I just use?
everything in C is “call by value”
well, this book must be fucked then
you can deREFERENCE a pointer that you pass the VALUE of, but it is still by value.
Folks want to pretend there is no stack, well there is – throw that book away.
it’s probably just making some analogy like “pointers are like references in X language”, perhaps?
every “call” gets the VALUE of some “type” and you can screw those all you like.
Cin has nailed what the book should be trying to tell you
yes
the moment you pass at least *pointer, you are _exposing_ external info via a ptr – to the call you made.
yes, i understand this
you have to understand and BELIEVE it right down to yer nuts.. Really.
C is not fantastic, but it will let you denut yourself.
its what keeps me awake at night
it should not.
something to get right away is that pointers are types, too, with values, ones that can be printed e.g. int x = 5;printf(“%p”, &x); /* will print some address */
If you obsess about it, this tells me you need an interface/api
ALLLllllll the basic “types” in C can reflect a local CPU and registers.
in other languages a pointer or reference is different, when you print it, it always prints what it refers to, instead of like in C’s pointers where you can only access what it refers to be _dereferencing_ it, you follow?
yep
hm. is there a plugin for XChat to automatically make words that are _underlined_ actuallly emphasized?
#xchat?
no idea. I’m wndering if there is a plugin for Pidgin for the same.
LET’S DO IT
Cin, ?
never that I have seen, and the Aqua-Xchat author gave up and needs a maintainer
so, the_plumber, what are you wanting to do in your function in your program?
do you understand the diff between “value, pointer, handle, enum”?
simply to push and pop structures from an array
no
I’ve made a few XChat patches in my time, I could probably add this if there isn’t already something to do it
are you maintaining a counter/index that tells you where the top is?
then use the GLIB queue/dll
enum = enumerate, pointer (reference or value), etc
yeahm I helped as well – I think it’s dying.dead
yes, it is a global
ok, so yer a virgin.. This bodes-not-well
ok. so, you pass in a struct to copy onto the top in push, and you pass in a pointer to a struct to copy back to in pop, and after that, in pop, you don’t have to do anything but decrement the index.
no
Please don’t pass around structures… It makes my guts shiver
you never have to clear that mem, because you aren’t ever going to look at it iuntil after you copy in a new struct with a push when you increment the index again.
I don’t think there’s much more to add/change to it. all IRC clients tend to have the same base functionality and then it seems to be subtle aesthetics and little bits here and there…
well, pointer to struct are better to pass in all cases, yes. I accidentally left that out of my push sentence.
I one felt that libIRCclient was a possibility.. I already learned that libIRCserver wasn’t
heh
look, he doesn’t understnd the basics – stick to values, not structures.
the elements of the structure are irrelevent, the principle I outline would work for any struct.
there are ways and ways – you don’t even understand basics. Stop looking for pasted-solutions. Look to learn the basics
so does most Linux and POSIXy stuff work well on OS X? that is, you don’t have to fuck about like on Windows?
right.
*most* stuff
Cin, they should in Leopard.
I’ve had no real issues, EXCEPT for makefiles.. Would you like a linux/osx tarball?