delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/04/20/21:16:04

Mime-Version: 1.0
To: djgpp-workers AT delorie DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Far string/mem functions
Date: Mon, 20 Apr 1998 18:11:33 -0700
Message-ID: <19980421011110.AAH9311@ppp124.cartsys.com>

As per the suggestions on the thread "protected mode" on djgpp, I have
written a set of far pointer str*/mem* functions for libc. I have a couple
of questions, though.

* Where should their prototypes go? <sys/farptr.h>? <string.h>, if not
-ansi? A new header?
* Does it seem necessary to document them completely, or can we just list
their prototypes and refer users to the corresponding near functions? They
are very similar; the only differences are that each pointer arg to the
original is replaced by two unsigned args (selector and offset) in the far
versions. Functions that returned pointers return the offset only.
* As written currently, my `_farmemcmp' may (for efficiency) touch memory
beyond the first byte mismatch, though not beyond the given limit. Is that
legal?
* Is it acceptable for a libc function to clobber %gs?

Current status:
* I have written all the functions I plan to, though I have NOT yet tested
them at all.
* I have versions of all the str*/mem* functions, except the following:
`strcoll', `strxfrm', `strerror', `strftime', `strsep', `strtok', and the
string-to-number conversions like `strto{(u?ll?),(l?d)}'. These seem to me
to be either too hard or particularly useless. (Of course, many of the
others are useless too, but hey.)
* Many of the functions are very inefficient (`_farstrcasecmp', for
instance, does a segment register load for each character). Yes, I'm lazy.
* I have not written a makefile nor any documentation.

I will post them here (or would it be better to upload to delorie.com? It's
about 16K altogether right now) when they are more stable, and when I can
integrate them into the libc.

Nate Eldredge
nate AT cartsys DOT com



- Raw text -


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