Mail Archives: djgpp/2004/12/18/18:45:37
Some points to consider while trying to
re-acquaint myself with DJGPP...
Did you know that
_lfn_gen_short_fname
does *not* actually return the true Windows Short Filename?
You can instead use
_dos_findfirst
(and optionally _dos_findnext)
however to get the *true* Short_Filename !
Truncating a string with printf()
Does anyone know if such a thing is possible?
Or are we expected to use str[n] = 0; to truncate?
the un4tunate side-effect of that is, it obviously
destroys your string!
Using %-12s has no effect if the string is long;
theres no explicit size-limit option...
Binary_Blocks_of_Data:
What I'd also like to see is a tutorial on copying,
concatenating, and searching Binary-Blocks of
Data...
fread() will retrieve binary blocks !
But 'C' would appear not to easily provide a means
to concatenate to a binary_block, you must keep
track of the pointer within the block yourself;
since there's no way to "know" trying find its length
on the fly... a function like memcat(), would be nice
that returned the LAST known pointer position within
the block, and *not* the start of the block...
unsigned char *memcat(dest, src, n_bytes);
or some such thing; returned pointer being LAST
known position forward into the dest...
dest = (dest + n_bytes);
subsequent calls would requite:
memcpy((dest + l_bytes), src, n_bytes);
such that l_bytes is the Last_Known bytes into
Destination, and n_bytes is the Current number
of bytes to concatenate on...
Discussion on any of it ?
email:RadSurfer AT yahoo DOT com
- Raw text -