home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / clib / vsprintf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  1.2 KB  |  68 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: vsprintf.c,v 1.2 1997/01/08 04:12:53 ldp Exp $
  4.  
  5.     Desc: C function vsprintf()
  6.     Lang: english
  7. */
  8. /* Original source from libnix */
  9. #define AROS_ALMOST_COMPATIBLE
  10.  
  11. static int _vsprintf_uc (int c, char ** str)
  12. {
  13.     *(*str)++ = c;
  14.     return 1;
  15. }
  16.  
  17. /*****************************************************************************
  18.  
  19.     NAME */
  20. #include <stdio.h>
  21. #include <stdarg.h>
  22.  
  23.     int vsprintf (
  24.  
  25. /*  SYNOPSIS */
  26.     char       * str,
  27.     const char * format,
  28.     va_list      args)
  29.  
  30. /*  FUNCTION
  31.     Format a list of arguments and put them into the string str.
  32.  
  33.     INPUTS
  34.     str - The formatted result is stored here
  35.     format - A printf() format string.
  36.     args - A list of arguments for the format string.
  37.  
  38.     RESULT
  39.     The number of characters written.
  40.  
  41.     NOTES
  42.     No check is beeing made that str is large enough to contain
  43.     the result.
  44.  
  45.     EXAMPLE
  46.  
  47.     BUGS
  48.  
  49.     SEE ALSO
  50.     printf(), sprintf(), fprintf(), vprintf(), vfprintf(), snprintf(),
  51.     vsnprintf()
  52.  
  53.     INTERNALS
  54.  
  55.     HISTORY
  56.     11.12.1996 digulla created
  57.  
  58. ******************************************************************************/
  59. {
  60.     int rc;
  61.  
  62.     rc = __vcformat (&str, (void *)_vsprintf_uc, format, args);
  63.  
  64.     *str = 0;
  65.  
  66.     return rc;
  67. } /* vsprintf */
  68.