SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /userland/debug.c (Article 9) and /userland/debug.c (Article 7)


001 /* Copyright (C) 2004  David Decotigny (with I    001 /* Copyright (C) 2004  David Decotigny (with INSA Rennes for vsnprintf)
002    Copyright (C) 2003  The KOS Team               002    Copyright (C) 2003  The KOS Team
003    Copyright (C) 1999  Free Software Foundatio    003    Copyright (C) 1999  Free Software Foundation
004                                                   004 
005    This program is free software; you can redi    005    This program is free software; you can redistribute it and/or
006    modify it under the terms of the GNU Genera    006    modify it under the terms of the GNU General Public License
007    as published by the Free Software Foundatio    007    as published by the Free Software Foundation; either version 2
008    of the License, or (at your option) any lat    008    of the License, or (at your option) any later version.
009                                                   009    
010    This program is distributed in the hope tha    010    This program is distributed in the hope that it will be useful,
011    but WITHOUT ANY WARRANTY; without even the     011    but WITHOUT ANY WARRANTY; without even the implied warranty of
012    MERCHANTABILITY or FITNESS FOR A PARTICULAR    012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013    GNU General Public License for more details    013    GNU General Public License for more details.
014                                                   014    
015    You should have received a copy of the GNU     015    You should have received a copy of the GNU General Public License
016    along with this program; if not, write to t    016    along with this program; if not, write to the Free Software
017    Foundation, Inc., 59 Temple Place - Suite 3    017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
018    USA.                                           018    USA. 
019 */                                                019 */
020 #include <crt.h>                                  020 #include <crt.h>
021 #include <stdarg.h>                               021 #include <stdarg.h>
022                                                   022 
023 #include "debug.h"                                023 #include "debug.h"
024                                                   024 
025 int bochs_printf(const char *format, /* args *    025 int bochs_printf(const char *format, /* args */...)
026 {                                                 026 {
027   char buff[4096];                                027   char buff[4096];
028   int len;                                        028   int len;
029   va_list ap;                                     029   va_list ap;
030                                                   030   
031   va_start(ap, format);                           031   va_start(ap, format);
032   len = vsnprintf(buff, sizeof(buff), format,     032   len = vsnprintf(buff, sizeof(buff), format, ap);
033   va_end(ap);                                     033   va_end(ap);
034                                                   034   
035   if (len < 0)                                    035   if (len < 0)
036     return len;                                   036     return len;
037                                                   037 
038   return _sos_bochs_write(buff, len);             038   return _sos_bochs_write(buff, len);
039 }                                                 039 }
                                                      

source navigation ] diff markup ] identifier search ] general search ]