Back to index

php5  5.3.10
rt.c
Go to the documentation of this file.
00001 /* rt.c: bcmath library file. */
00002 /*
00003     Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
00004     Copyright (C) 2000 Philip A. Nelson
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.  (COPYING.LIB)
00015 
00016     You should have received a copy of the GNU Lesser General Public
00017     License along with this library; if not, write to:
00018 
00019       The Free Software Foundation, Inc.
00020       59 Temple Place, Suite 330
00021       Boston, MA 02111-1307 USA.
00022 
00023     You may contact the author by:
00024        e-mail:  philnelson@acm.org
00025       us-mail:  Philip A. Nelson
00026                 Computer Science Department, 9062
00027                 Western Washington University
00028                 Bellingham, WA 98226-9062
00029        
00030 *************************************************************************/
00031 
00032 #include <config.h>
00033 #include <stdio.h>
00034 #include <assert.h>
00035 #include <stdlib.h>
00036 #include <ctype.h>
00037 #include <stdarg.h>
00038 #include "bcmath.h"
00039 #include "private.h"
00040 
00041 
00042 void bc_rt_warn (char *mesg ,...)
00043 {
00044   va_list args;
00045   char error_mesg [255];
00046 
00047   va_start (args, mesg);
00048   vsnprintf (error_mesg, sizeof(error_mesg), mesg, args);
00049   va_end (args);
00050 
00051   fprintf (stderr, "bc math warning: %s\n", error_mesg);
00052 }
00053 
00054 
00055 void bc_rt_error (char *mesg ,...)
00056 {
00057   va_list args;
00058   char error_mesg [255];
00059 
00060   va_start (args, mesg);
00061   vsnprintf (error_mesg, sizeof(error_mesg), mesg, args);
00062   va_end (args);
00063 
00064   fprintf (stderr, "bc math error: %s\n", error_mesg);
00065 }