Path: blob/master/venv/Lib/site-packages/lxml/includes/libxslt/trio.h
811 views
/*************************************************************************1*2* $Id$3*4* Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.5*6* Permission to use, copy, modify, and distribute this software for any7* purpose with or without fee is hereby granted, provided that the above8* copyright notice and this permission notice appear in all copies.9*10* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED11* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF12* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND13* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.14*15*************************************************************************16*17* http://ctrio.sourceforge.net/18*19************************************************************************/2021#ifndef TRIO_TRIO_H22#define TRIO_TRIO_H2324#if !defined(WITHOUT_TRIO)2526/*27* Use autoconf defines if present. Packages using trio must define28* HAVE_CONFIG_H as a compiler option themselves.29*/30#if defined(HAVE_CONFIG_H)31# include <config.h>32#endif3334#include "triodef.h"3536#include <stdio.h>37#include <stdlib.h>38#if defined(TRIO_COMPILER_ANCIENT)39# include <varargs.h>40#else41# include <stdarg.h>42#endif4344#ifdef __cplusplus45extern "C" {46#endif4748/*49* Error codes.50*51* Remember to add a textual description to trio_strerror.52*/53enum {54TRIO_EOF = 1,55TRIO_EINVAL = 2,56TRIO_ETOOMANY = 3,57TRIO_EDBLREF = 4,58TRIO_EGAP = 5,59TRIO_ENOMEM = 6,60TRIO_ERANGE = 7,61TRIO_ERRNO = 8,62TRIO_ECUSTOM = 963};6465/* Error macros */66#define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF)67#define TRIO_ERROR_POSITION(x) ((-(x)) >> 8)68#define TRIO_ERROR_NAME(x) trio_strerror(x)6970typedef int (*trio_outstream_t) TRIO_PROTO((trio_pointer_t, int));71typedef int (*trio_instream_t) TRIO_PROTO((trio_pointer_t));7273TRIO_CONST char *trio_strerror TRIO_PROTO((int));7475/*************************************************************************76* Print Functions77*/7879int trio_printf TRIO_PROTO((TRIO_CONST char *format, ...));80int trio_vprintf TRIO_PROTO((TRIO_CONST char *format, va_list args));81int trio_printfv TRIO_PROTO((TRIO_CONST char *format, void **args));8283int trio_fprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...));84int trio_vfprintf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args));85int trio_fprintfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args));8687int trio_dprintf TRIO_PROTO((int fd, TRIO_CONST char *format, ...));88int trio_vdprintf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args));89int trio_dprintfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args));9091int trio_cprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,92TRIO_CONST char *format, ...));93int trio_vcprintf TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,94TRIO_CONST char *format, va_list args));95int trio_cprintfv TRIO_PROTO((trio_outstream_t stream, trio_pointer_t closure,96TRIO_CONST char *format, void **args));9798int trio_sprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, ...));99int trio_vsprintf TRIO_PROTO((char *buffer, TRIO_CONST char *format, va_list args));100int trio_sprintfv TRIO_PROTO((char *buffer, TRIO_CONST char *format, void **args));101102int trio_snprintf TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...));103int trio_vsnprintf TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,104va_list args));105int trio_snprintfv TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,106void **args));107108int trio_snprintfcat TRIO_PROTO((char *buffer, size_t max, TRIO_CONST char *format, ...));109int trio_vsnprintfcat TRIO_PROTO((char *buffer, size_t bufferSize, TRIO_CONST char *format,110va_list args));111112char *trio_aprintf TRIO_PROTO((TRIO_CONST char *format, ...));113char *trio_vaprintf TRIO_PROTO((TRIO_CONST char *format, va_list args));114115int trio_asprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, ...));116int trio_vasprintf TRIO_PROTO((char **ret, TRIO_CONST char *format, va_list args));117118/*************************************************************************119* Scan Functions120*/121int trio_scanf TRIO_PROTO((TRIO_CONST char *format, ...));122int trio_vscanf TRIO_PROTO((TRIO_CONST char *format, va_list args));123int trio_scanfv TRIO_PROTO((TRIO_CONST char *format, void **args));124125int trio_fscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, ...));126int trio_vfscanf TRIO_PROTO((FILE *file, TRIO_CONST char *format, va_list args));127int trio_fscanfv TRIO_PROTO((FILE *file, TRIO_CONST char *format, void **args));128129int trio_dscanf TRIO_PROTO((int fd, TRIO_CONST char *format, ...));130int trio_vdscanf TRIO_PROTO((int fd, TRIO_CONST char *format, va_list args));131int trio_dscanfv TRIO_PROTO((int fd, TRIO_CONST char *format, void **args));132133int trio_cscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,134TRIO_CONST char *format, ...));135int trio_vcscanf TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,136TRIO_CONST char *format, va_list args));137int trio_cscanfv TRIO_PROTO((trio_instream_t stream, trio_pointer_t closure,138TRIO_CONST char *format, void **args));139140int trio_sscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, ...));141int trio_vsscanf TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, va_list args));142int trio_sscanfv TRIO_PROTO((TRIO_CONST char *buffer, TRIO_CONST char *format, void **args));143144/*************************************************************************145* Locale Functions146*/147void trio_locale_set_decimal_point TRIO_PROTO((char *decimalPoint));148void trio_locale_set_thousand_separator TRIO_PROTO((char *thousandSeparator));149void trio_locale_set_grouping TRIO_PROTO((char *grouping));150151/*************************************************************************152* Renaming153*/154#ifdef TRIO_REPLACE_STDIO155/* Replace the <stdio.h> functions */156#ifndef HAVE_PRINTF157# define printf trio_printf158#endif159#ifndef HAVE_VPRINTF160# define vprintf trio_vprintf161#endif162#ifndef HAVE_FPRINTF163# define fprintf trio_fprintf164#endif165#ifndef HAVE_VFPRINTF166# define vfprintf trio_vfprintf167#endif168#ifndef HAVE_SPRINTF169# define sprintf trio_sprintf170#endif171#ifndef HAVE_VSPRINTF172# define vsprintf trio_vsprintf173#endif174#ifndef HAVE_SNPRINTF175# define snprintf trio_snprintf176#endif177#ifndef HAVE_VSNPRINTF178# define vsnprintf trio_vsnprintf179#endif180#ifndef HAVE_SCANF181# define scanf trio_scanf182#endif183#ifndef HAVE_VSCANF184# define vscanf trio_vscanf185#endif186#ifndef HAVE_FSCANF187# define fscanf trio_fscanf188#endif189#ifndef HAVE_VFSCANF190# define vfscanf trio_vfscanf191#endif192#ifndef HAVE_SSCANF193# define sscanf trio_sscanf194#endif195#ifndef HAVE_VSSCANF196# define vsscanf trio_vsscanf197#endif198/* These aren't stdio functions, but we make them look similar */199#define dprintf trio_dprintf200#define vdprintf trio_vdprintf201#define aprintf trio_aprintf202#define vaprintf trio_vaprintf203#define asprintf trio_asprintf204#define vasprintf trio_vasprintf205#define dscanf trio_dscanf206#define vdscanf trio_vdscanf207#endif208209#ifdef __cplusplus210} /* extern "C" */211#endif212213#endif /* WITHOUT_TRIO */214215#endif /* TRIO_TRIO_H */216217218