home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / gfx / edit / tsmorph / sprintf.c < prev    next >
C/C++ Source or Header  |  1993-12-21  |  2KB  |  52 lines

  1. // TSMorph - Amiga Morphing program
  2. // Copyright (C) © 1993  Topicsave Limited
  3.  
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; either version 2 of the License, or
  7. // any later version.
  8.  
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. // GNU General Public License for more details.
  13.  
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program; if not, write to the Free Software
  16. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. // mpaddock@cix.compulink.co.uk
  19.  
  20. //    $Author: M_J_Paddock $
  21. //    $Date: 1993/06/06 23:17:33 $
  22. //    $Revision: 1.2 $
  23.  
  24. // sprintf() using RawDoFmt()
  25.  
  26. #include <proto/exec.h>
  27. #include <stdarg.h>
  28. #include <stdio.h>
  29.  
  30. int sprintf(char *buffer,char *ctl, ...)
  31. {
  32.    va_list args;
  33.  
  34.    va_start(args, ctl);
  35.  
  36.    /*********************************************************/
  37.    /* NOTE: The string below is actually CODE that copies a */
  38.    /*       value from d0 to A3 and increments A3:          */
  39.    /*                                                       */
  40.    /*          move.b d0,(a3)+                              */
  41.    /*          rts                                          */
  42.    /*                                                       */
  43.    /*       It is essentially the callback routine needed   */
  44.    /*       by RawDoFmt.                                    */
  45.    /*********************************************************/
  46.  
  47.    RawDoFmt(ctl, args, (void (*))"\x16\xc0\x4e\x75", buffer);
  48.  
  49.    va_end(args);
  50.  
  51.    return 0;
  52. }