www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/21/09:16:33

From: mdruiter AT cs DOT vu DOT nl (Ruiter de M)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: "vsscanf" - Is there an equivalent in DJGPP?
Date: 21 Jul 1998 12:06:56 GMT
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Lines: 35
Message-ID: <6p2090$ip0$1@star.cs.vu.nl>
References: <6ovkg5$jlg$1 AT news4 DOT jaring DOT my>
NNTP-Posting-Host: sloep118.cs.vu.nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Krian U (krian AT umich DOT edu) wrote:
> I have some code ported over from Borland C to DJGPP that uses "vsscanf", an 
> sscanf-type function that works with va_lists.

WatTCP, no? :-)

The function `vsscanf' will be in the next DJGPP version (2.02), in
the meantime you can define it yourself:

#include <stdio.h>
#include <stdarg.h>
#include <libc/file.h>
#include <libc/unconst.h>
 
int
vsscanf(const char *str, const char *fmt, va_list ap)
{
  FILE _strbuf;
 
  _strbuf._flag = _IOREAD|_IOSTRG;
  _strbuf._ptr = _strbuf._base = unconst(str, char *);
  _strbuf._cnt = 0;
  while (*str++)
    _strbuf._cnt++;
  _strbuf._bufsiz = _strbuf._cnt;
  return _doscan(&_strbuf, fmt, ap);
}

Hope this helps.

--
Groeten, Michel.        http://www.cs.vu.nl/~mdruiter
  ____________
  \  /====\  /          "You know, Beavis, you need things that suck,
   \/      \/           to have things that are cool", Butt-Head.

- Raw text -


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