delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/12/18/18:45:37

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Radical NetSurfer <RadSurfer AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Tips & Tricks (long forgotten)
Date: Sat, 18 Dec 2004 16:49:09 -0500
Message-ID: <el89s0hcav344jvuh265q8r28616ifusj8@4ax.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Organization: Velocity.Net
Cache-Post-Path: web.velocity.net!unknown AT 66-211-216-150 DOT velocity DOT net
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Lines: 52
X-Complaints-To: abuse AT newshosting DOT com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019