delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/01/17:35:18

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: "Missing" functions
Date: Fri, 01 Aug 1997 09:37:38 -0700
Organization: Alcyone Systems
Lines: 38
Message-ID: <33E210D2.127C0C75@alcyone.com>
References: <33E20183 DOT 69C5 AT ncs DOT com>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Brian Almquist wrote:

> I am trying to convert some source that was written in Microsoft C
> (compiler circa 1984), and there are some functions that don't appear
> to  be in the DJGPP libraries.
> 
> One is strcmpi(), and the other is fcloseall(). The latter is included
> in the list of "missing" functions for DJGPP v2, but I have not had any
> luck finding any references to the two in most of the online
> documentation.

strcmpi and fcloseall are both nonstandard functions that Borland and
Microsoft liked to use.  strcmpi is a function that does case
_insensitive_ string compares, and there's no corresponding ANSI C
function.  Similarly, fcloseall is a non-ANSI function which closes all
open files.  Depending on the context, you may not need to call this at
all -- for instance, if fcloseall is being called just before the program
exits, you can just remove the call, since this will happen automatically
anyway.

> Could someone please point out a workaround to these functions, or at
> least tell me exactly what they do so that I can find a reasonable
> alternative.

If fcloseall is actually used inside the code in an important way, what
you'll probably have to do is keep a running list of the files that have
been opened with fopen, and then have an alternate fcloseall which will go
through the list and close them (and then purge the list).

As for strcmpi, you'll have to write your own.

-- 
       Erik Max Francis, &tSftDotIotE / email / mailto:max AT alcyone DOT com
                     Alcyone Systems /   web / http://www.alcyone.com/max/
San Jose, California, United States /  icbm / 37 20 07 N  121 53 38 W
                                   \
   "Love is not love which alters / when it alternation finds."
                                 / William Shakespeare, _Sonnets_, 116

- Raw text -


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