[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS libidn/csharp/lib
From: |
libidn-commit |
Subject: |
CVS libidn/csharp/lib |
Date: |
Thu, 1 Dec 2005 22:53:50 +0100 |
Update of /home/cvs/libidn/csharp/lib
In directory dopio:/tmp/cvs-serv18625/lib
Added Files:
Makefile.am alloca_.h allocsa.c allocsa.h allocsa.valgrind
csharpcomp.c csharpcomp.h csharpcomp.sh.in error.c error.h
execute.c execute.h exit.h exitfail.c exitfail.h
fatal-signal.c fatal-signal.h getdelim.c getdelim.h getline.c
getline.h gettext.h pipe.c pipe.h quotearg.c quotearg.h
safe-read.c safe-read.h sh-quote.c sh-quote.h stdbool_.h
strpbrk.c strpbrk.h w32spawn.h wait-process.c wait-process.h
xalloc-die.c xalloc.h xallocsa.c xallocsa.h xmalloc.c
Log Message:
Use gnulib, for csharpcomp.
--- /home/cvs/libidn/csharp/lib/Makefile.am 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/Makefile.am 2005/12/01 21:53:50 1.1
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2004 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
# Public License, this file may be distributed as part of a program
# that contains a configuration script generated by Automake, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib
--m4-base=m4 --aux-dir=. --macro-prefix=gl csharpcomp
AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
noinst_LIBRARIES = libgnu.a
libgnu_a_SOURCES =
libgnu_a_LIBADD = @LIBOBJS@
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
MOSTLYCLEANFILES =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
## begin gnulib module alloca-opt
BUILT_SOURCES += $(ALLOCA_H)
EXTRA_DIST += alloca_.h
# We need the following in order to create <alloca.h> when the system
# doesn't have one that works with the given compiler.
alloca.h: alloca_.h
cp $(srcdir)/alloca_.h address@hidden
mv address@hidden $@
MOSTLYCLEANFILES += alloca.h alloca.h-t
## end gnulib module alloca-opt
## begin gnulib module allocsa
libgnu_a_SOURCES += allocsa.h allocsa.c
EXTRA_DIST += allocsa.valgrind
## end gnulib module allocsa
## begin gnulib module csharpcomp
libgnu_a_SOURCES += csharpcomp.h csharpcomp.c
EXTRA_DIST += csharpcomp.sh.in
## end gnulib module csharpcomp
## begin gnulib module execute
libgnu_a_SOURCES += execute.h execute.c w32spawn.h
## end gnulib module execute
## begin gnulib module exit
libgnu_a_SOURCES += exit.h
## end gnulib module exit
## begin gnulib module fatal-signal
libgnu_a_SOURCES += fatal-signal.h fatal-signal.c
## end gnulib module fatal-signal
## begin gnulib module gettext-h
libgnu_a_SOURCES += gettext.h
## end gnulib module gettext-h
## begin gnulib module pipe
libgnu_a_SOURCES += pipe.h pipe.c w32spawn.h
## end gnulib module pipe
## begin gnulib module sh-quote
libgnu_a_SOURCES += sh-quote.h sh-quote.c
## end gnulib module sh-quote
## begin gnulib module stdbool
BUILT_SOURCES += $(STDBOOL_H)
EXTRA_DIST += stdbool_.h
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool_.h
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h >
address@hidden
mv address@hidden $@
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
## end gnulib module stdbool
## begin gnulib module strpbrk
libgnu_a_SOURCES += strpbrk.h
## end gnulib module strpbrk
## begin gnulib module wait-process
libgnu_a_SOURCES += wait-process.h wait-process.c
## end gnulib module wait-process
## begin gnulib module xalloc-die
libgnu_a_SOURCES += xalloc-die.c
## end gnulib module xalloc-die
## begin gnulib module xallocsa
libgnu_a_SOURCES += xallocsa.h xallocsa.c
## end gnulib module xallocsa
# Makefile.am ends here
--- /home/cvs/libidn/csharp/lib/alloca_.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/alloca_.h 2005/12/01 21:53:50 1.1
/* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
means there is a real alloca function. */
#ifndef _GNULIB_ALLOCA_H
# define _GNULIB_ALLOCA_H
/* alloca (N) returns a pointer to N bytes of memory
allocated on the stack, which will last until the function returns.
Use of alloca should be avoided:
- inside arguments of function calls - undefined behaviour,
- in inline functions - the allocation may actually last until the
calling function returns,
- for huge N (say, N >= 65536) - you never know how large (or small)
the stack is, and when the stack cannot fulfill the memory allocation
request, the program just crashes.
*/
#ifdef __GNUC__
# define alloca __builtin_alloca
#elif defined _AIX
# define alloca __alloca
#elif defined _MSC_VER
# include <malloc.h>
# define alloca _alloca
#else
# include <stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
#endif
#endif /* _GNULIB_ALLOCA_H */
--- /home/cvs/libidn/csharp/lib/allocsa.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/allocsa.c 2005/12/01 21:53:50 1.1
/* Safe automatic memory allocation.
Copyright (C) 2003 Free Software Foundation, Inc.
Written by Bruno Haible <address@hidden>, 2003.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Specification. */
#include "allocsa.h"
/* The speed critical point in this file is freesa() applied to an alloca()
result: it must be fast, to match the speed of alloca(). The speed of
mallocsa() and freesa() in the other case are not critical, because they
are only invoked for big memory sizes. */
#if HAVE_ALLOCA
/* Store the mallocsa() results in a hash table. This is needed to reliably
distinguish a mallocsa() result and an alloca() result.
Although it is possible that the same pointer is returned by alloca() and
by mallocsa() at different times in the same application, it does not lead
to a bug in freesa(), because:
- Before a pointer returned by alloca() can point into malloc()ed memory,
the function must return, and once this has happened the programmer must
not call freesa() on it anyway.
- Before a pointer returned by mallocsa() can point into the stack, it
must be freed. The only function that can free it is freesa(), and
when freesa() frees it, it also removes it from the hash table. */
#define MAGIC_NUMBER 0x1415fb4a
#define MAGIC_SIZE sizeof (int)
/* This is how the header info would look like without any alignment
considerations. */
struct preliminary_header { void *next; char room[MAGIC_SIZE]; };
/* But the header's size must be a multiple of sa_alignment_max. */
#define HEADER_SIZE \
(((sizeof (struct preliminary_header) + sa_alignment_max - 1) /
sa_alignment_max) * sa_alignment_max)
struct header { void *next; char room[HEADER_SIZE - sizeof (struct
preliminary_header) + MAGIC_SIZE]; };
/* Verify that HEADER_SIZE == sizeof (struct header). */
typedef int verify1[2 * (HEADER_SIZE == sizeof (struct header)) - 1];
/* We make the hash table quite big, so that during lookups the probability
of empty hash buckets is quite high. There is no need to make the hash
table resizable, because when the hash table gets filled so much that the
lookup becomes slow, it means that the application has memory leaks. */
#define HASH_TABLE_SIZE 257
static void * mallocsa_results[HASH_TABLE_SIZE];
#endif
void *
mallocsa (size_t n)
{
#if HAVE_ALLOCA
/* Allocate one more word, that serves as an indicator for malloc()ed
memory, so that freesa() of an alloca() result is fast. */
size_t nplus = n + HEADER_SIZE;
if (nplus >= n)
{
char *p = (char *) malloc (nplus);
if (p != NULL)
{
size_t slot;
p += HEADER_SIZE;
/* Put a magic number into the indicator word. */
((int *) p)[-1] = MAGIC_NUMBER;
/* Enter p into the hash table. */
slot = (unsigned long) p % HASH_TABLE_SIZE;
((struct header *) (p - HEADER_SIZE))->next = mallocsa_results[slot];
mallocsa_results[slot] = p;
return p;
}
}
/* Out of memory. */
return NULL;
#else
# if !MALLOC_0_IS_NONNULL
if (n == 0)
n = 1;
# endif
return malloc (n);
#endif
}
#if HAVE_ALLOCA
void
freesa (void *p)
{
/* mallocsa() may have returned NULL. */
if (p != NULL)
{
/* Attempt to quickly distinguish the mallocsa() result - which has
a magic indicator word - and the alloca() result - which has an
uninitialized indicator word. It is for this test that sa_increment
additional bytes are allocated in the alloca() case. */
if (((int *) p)[-1] == MAGIC_NUMBER)
{
/* Looks like a mallocsa() result. To see whether it really is one,
perform a lookup in the hash table. */
size_t slot = (unsigned long) p % HASH_TABLE_SIZE;
void **chain = &mallocsa_results[slot];
for (; *chain != NULL;)
{
if (*chain == p)
{
/* Found it. Remove it from the hash table and free it. */
char *p_begin = (char *) p - HEADER_SIZE;
*chain = ((struct header *) p_begin)->next;
free (p_begin);
return;
}
chain = &((struct header *) ((char *) *chain -
HEADER_SIZE))->next;
}
}
/* At this point, we know it was not a mallocsa() result. */
}
}
#endif
--- /home/cvs/libidn/csharp/lib/allocsa.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/allocsa.h 2005/12/01 21:53:50 1.1
/* Safe automatic memory allocation.
Copyright (C) 2003-2004 Free Software Foundation, Inc.
Written by Bruno Haible <address@hidden>, 2003.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _ALLOCSA_H
#define _ALLOCSA_H
#include <alloca.h>
#include <stddef.h>
#include <stdlib.h>
/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
alloca(N); otherwise it returns NULL. It either returns N bytes of
memory allocated on the stack, that lasts until the function returns,
or NULL.
Use of safe_alloca should be avoided:
- inside arguments of function calls - undefined behaviour,
- in inline functions - the allocation may actually last until the
calling function returns.
*/
#if HAVE_ALLOCA
/* The OS usually guarantees only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
allocate anything larger than 4096 bytes. Also care for the possibility
of a few compiler-allocated temporary stack slots.
This must be a macro, not an inline function. */
# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
#else
# define safe_alloca(N) ((N), NULL)
#endif
/* allocsa(N) is a safe variant of alloca(N). It allocates N bytes of
memory allocated on the stack, that must be freed using freesa() before
the function returns. Upon failure, it returns NULL. */
#if HAVE_ALLOCA
# define allocsa(N) \
((N) < 4032 - sa_increment \
? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
: mallocsa (N))
#else
# define allocsa(N) \
mallocsa (N)
#endif
extern void * mallocsa (size_t n);
/* Free a block of memory allocated through allocsa(). */
#if HAVE_ALLOCA
extern void freesa (void *p);
#else
# define freesa free
#endif
/* Maybe we should also define a variant
nallocsa (size_t n, size_t s) - behaves like allocsa (n * s)
If this would be useful in your application. please speak up. */
/* ------------------- Auxiliary, non-public definitions ------------------- */
/* Determine the alignment of a type at compile time. */
#if defined __GNUC__
# define sa_alignof __alignof__
#elif defined __cplusplus
template <class type> struct sa_alignof_helper { char __slot1; type __slot2;
};
# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
[34 lines skipped]
--- /home/cvs/libidn/csharp/lib/allocsa.valgrind 2005/12/01 21:53:50
NONE
+++ /home/cvs/libidn/csharp/lib/allocsa.valgrind 2005/12/01 21:53:50
1.1
[41 lines skipped]
--- /home/cvs/libidn/csharp/lib/csharpcomp.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/csharpcomp.c 2005/12/01 21:53:50 1.1
[569 lines skipped]
--- /home/cvs/libidn/csharp/lib/csharpcomp.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/csharpcomp.h 2005/12/01 21:53:50 1.1
[610 lines skipped]
--- /home/cvs/libidn/csharp/lib/csharpcomp.sh.in 2005/12/01 21:53:50
NONE
+++ /home/cvs/libidn/csharp/lib/csharpcomp.sh.in 2005/12/01 21:53:50
1.1
[769 lines skipped]
--- /home/cvs/libidn/csharp/lib/error.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/error.c 2005/12/01 21:53:50 1.1
[1073 lines skipped]
--- /home/cvs/libidn/csharp/lib/error.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/error.h 2005/12/01 21:53:50 1.1
[1139 lines skipped]
--- /home/cvs/libidn/csharp/lib/execute.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/execute.c 2005/12/01 21:53:50 1.1
[1457 lines skipped]
--- /home/cvs/libidn/csharp/lib/execute.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/execute.h 2005/12/01 21:53:50 1.1
[1498 lines skipped]
--- /home/cvs/libidn/csharp/lib/exit.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/exit.h 2005/12/01 21:53:50 1.1
[1530 lines skipped]
--- /home/cvs/libidn/csharp/lib/exitfail.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/exitfail.c 2005/12/01 21:53:50 1.1
[1557 lines skipped]
--- /home/cvs/libidn/csharp/lib/exitfail.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/exitfail.h 2005/12/01 21:53:50 1.1
[1577 lines skipped]
--- /home/cvs/libidn/csharp/lib/fatal-signal.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/fatal-signal.c 2005/12/01 21:53:50 1.1
[1861 lines skipped]
--- /home/cvs/libidn/csharp/lib/fatal-signal.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/fatal-signal.h 2005/12/01 21:53:50 1.1
[1938 lines skipped]
--- /home/cvs/libidn/csharp/lib/getdelim.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/getdelim.c 2005/12/01 21:53:50 1.1
[2066 lines skipped]
--- /home/cvs/libidn/csharp/lib/getdelim.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/getdelim.h 2005/12/01 21:53:50 1.1
[2094 lines skipped]
--- /home/cvs/libidn/csharp/lib/getline.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/getline.c 2005/12/01 21:53:50 1.1
[2126 lines skipped]
--- /home/cvs/libidn/csharp/lib/getline.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/getline.h 2005/12/01 21:53:50 1.1
[2154 lines skipped]
--- /home/cvs/libidn/csharp/lib/gettext.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/gettext.h 2005/12/01 21:53:50 1.1
[2232 lines skipped]
--- /home/cvs/libidn/csharp/lib/pipe.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/pipe.c 2005/12/01 21:53:50 1.1
[2742 lines skipped]
--- /home/cvs/libidn/csharp/lib/pipe.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/pipe.h 2005/12/01 21:53:50 1.1
[2875 lines skipped]
--- /home/cvs/libidn/csharp/lib/quotearg.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/quotearg.c 2005/12/01 21:53:50 1.1
[3559 lines skipped]
--- /home/cvs/libidn/csharp/lib/quotearg.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/quotearg.h 2005/12/01 21:53:50 1.1
[3696 lines skipped]
--- /home/cvs/libidn/csharp/lib/safe-read.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/safe-read.c 2005/12/01 21:53:50 1.1
[3776 lines skipped]
--- /home/cvs/libidn/csharp/lib/safe-read.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/safe-read.h 2005/12/01 21:53:50 1.1
[3801 lines skipped]
--- /home/cvs/libidn/csharp/lib/sh-quote.c 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/sh-quote.c 2005/12/01 21:53:50 1.1
[3911 lines skipped]
--- /home/cvs/libidn/csharp/lib/sh-quote.h 2005/12/01 21:53:50 NONE
+++ /home/cvs/libidn/csharp/lib/sh-quote.h 2005/12/01 21:53:50 1.1
[3948 lines skipped]
--- /home/cvs/libidn/csharp/lib/stdbool_.h 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/stdbool_.h 2005/12/01 21:53:51 1.1
[4041 lines skipped]
--- /home/cvs/libidn/csharp/lib/strpbrk.c 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/strpbrk.c 2005/12/01 21:53:51 1.1
[4083 lines skipped]
--- /home/cvs/libidn/csharp/lib/strpbrk.h 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/strpbrk.h 2005/12/01 21:53:51 1.1
[4111 lines skipped]
--- /home/cvs/libidn/csharp/lib/w32spawn.h 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/w32spawn.h 2005/12/01 21:53:51 1.1
[4280 lines skipped]
--- /home/cvs/libidn/csharp/lib/wait-process.c 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/wait-process.c 2005/12/01 21:53:51 1.1
[4688 lines skipped]
--- /home/cvs/libidn/csharp/lib/wait-process.h 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/wait-process.h 2005/12/01 21:53:51 1.1
[4758 lines skipped]
--- /home/cvs/libidn/csharp/lib/xalloc-die.c 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/xalloc-die.c 2005/12/01 21:53:51 1.1
[4803 lines skipped]
--- /home/cvs/libidn/csharp/lib/xalloc.h 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/xalloc.h 2005/12/01 21:53:51 1.1
[4882 lines skipped]
--- /home/cvs/libidn/csharp/lib/xallocsa.c 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/xallocsa.c 2005/12/01 21:53:51 1.1
[4919 lines skipped]
--- /home/cvs/libidn/csharp/lib/xallocsa.h 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/xallocsa.h 2005/12/01 21:53:51 1.1
[4961 lines skipped]
--- /home/cvs/libidn/csharp/lib/xmalloc.c 2005/12/01 21:53:51 NONE
+++ /home/cvs/libidn/csharp/lib/xmalloc.c 2005/12/01 21:53:51 1.1
[5202 lines skipped]
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01
- CVS libidn/csharp/lib,
libidn-commit <=
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01
- CVS libidn/csharp/lib, libidn-commit, 2005/12/01