~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to missing/vsnprintf.c

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2006-05-08 22:23:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060508222312-w2wqeaz030ifi59j
Tags: 1.9.0+20060423-3ubuntu1
* Resynchronized with Debian.
* Only change from Debian is the addition of
  debian/patches/903_sparc_fix_define.patch to fix illegal instructions
  at runtime on sparc. (change from 1.9.0+20050921-1ubuntu1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
#endif /* People who don't like const sys_error */
112
112
 
113
113
#include <stddef.h>
 
114
#if defined(__hpux) && !defined(__GNUC__) || defined(__DECC)
 
115
#include <string.h>
 
116
#endif
 
117
 
 
118
#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__)
 
119
#include <stdlib.h>
 
120
#endif
114
121
 
115
122
#ifndef NULL
116
123
#define NULL    0
194
201
#define __sclearerr(p)  ((void)((p)->_flags &= ~(__SERR|__SEOF)))
195
202
#define __sfileno(p)    ((p)->_file)
196
203
 
 
204
#undef feof
 
205
#undef ferror
 
206
#undef clearerr
197
207
#define feof(p)         __sfeof(p)
198
208
#define ferror(p)       __sferror(p)
199
209
#define clearerr(p)     __sclearerr(p)
203
213
#endif
204
214
 
205
215
 
206
 
#if defined(__hpux) && !defined(__GNUC__) || defined(__DECC)
207
 
#include <string.h>
208
 
#endif
209
 
 
210
216
/*
211
217
 * I/O descriptors for __sfvwrite().
212
218
 */
220
226
        int     uio_resid;
221
227
};
222
228
 
 
229
#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_SNPRINTF)
223
230
/*
224
231
 * Write some memory regions.  Return zero on success, EOF on error.
225
232
 *
226
233
 * This routine is large and unsightly, but most of the ugliness due
227
234
 * to the three different kinds of output buffering is handled here.
228
235
 */
229
 
static BSD__sfvwrite(fp, uio)
 
236
static int BSD__sfvwrite(fp, uio)
230
237
        register FILE *fp;
231
238
        register struct __suio *uio;
232
239
{
293
300
                */
294
301
        }
295
302
        return (0);
296
 
 
297
 
err:
298
 
        fp->_flags |= __SERR;
299
 
        return (EOF);
300
303
}
 
304
#endif
301
305
 
302
306
/*
303
307
 * Actual printf innards.
305
309
 * This code is large and complicated...
306
310
 */
307
311
 
308
 
#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__)
309
 
#include <stdlib.h>
310
 
#endif
311
 
 
312
312
/*
313
313
 * Flush out all the vectors defined by the given uio,
314
314
 * then reset it so that it can be reused.