aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/Makefile.am2
-rw-r--r--src/funopen.c44
-rw-r--r--src/isascii.c29
-rw-r--r--src/memrchr.c36
-rw-r--r--src/putc_unlocked.c31
6 files changed, 150 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 688bcf0..2ac113d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
2003-02-18 Neal H. Walfield <[email protected]>
+ * Makefile.am (libassuan_a_LIBADD): New variable.
+ * funopen.c: Move from ../common.
+ * isascii.c: Likewise.
+ * memrchr.c: Likewise.
+ * putc_unlocked.c: Likewise.
+
+2003-02-18 Neal H. Walfield <[email protected]>
+
* assuan-handler.c (_IO_cookie_io_functions_t): Remove.
(cookie_io_functions_t): Remove.
(fopencookie): Remove prototype.
diff --git a/src/Makefile.am b/src/Makefile.am
index 1af90e7..344c261 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,5 +49,7 @@ libassuan_a_SOURCES = \
assuan-domain-server.c \
assuan-logging.c
+libassuan_a_LIBADD = @LIBOBJS@
+
assuan-errors.c : assuan.h
$(srcdir)/mkerrors < $(srcdir)/assuan.h > assuan-errors.c
diff --git a/src/funopen.c b/src/funopen.c
new file mode 100644
index 0000000..e768b05
--- /dev/null
+++ b/src/funopen.c
@@ -0,0 +1,44 @@
+/* funopen.c - Replacement for funopen.
+ * Copyright (C) 2003 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG 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 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_FOPENCOOKIE
+FILE *
+funopen(const void *cookie, cookie_read_function_t *readfn,
+ cookie_write_function_t *writefn,
+ cookie_seek_function_t *seekfn,
+ cookie_close_function_t *closefn)
+{
+ cookie_io_functions_t io = { read: readfn, write: writefn,
+ seek: seekfn,
+ close: closefn };
+
+ return fopencookie ((void *) cookie,
+ readfn ? ( writefn ? "rw" : "r" )
+ : ( writefn ? "w" : ""), io);
+}
+#else
+#error No known way to implement funopen.
+#endif
diff --git a/src/isascii.c b/src/isascii.c
new file mode 100644
index 0000000..565c716
--- /dev/null
+++ b/src/isascii.c
@@ -0,0 +1,29 @@
+/* isascii.c - Replacement for isascii.
+ * Copyright (C) 2002 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG 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 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+int
+isascii (int c)
+{
+ return (((c) & ~0x7f) == 0);
+}
diff --git a/src/memrchr.c b/src/memrchr.c
new file mode 100644
index 0000000..3e60c55
--- /dev/null
+++ b/src/memrchr.c
@@ -0,0 +1,36 @@
+/* memrchr.c - Replacement for memrchr.
+ * Copyright (C) 2002 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG 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 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+
+void *
+memrchr (const void *block, int c, size_t size)
+{
+ void *p;
+
+ for (p = block + size; p != block; p --)
+ if (*p == c)
+ return p;
+ return 0;
+}
diff --git a/src/putc_unlocked.c b/src/putc_unlocked.c
new file mode 100644
index 0000000..02c6461
--- /dev/null
+++ b/src/putc_unlocked.c
@@ -0,0 +1,31 @@
+/* putc_unlocked.c - Replacement for putc_unlocked.
+ * Copyright (C) 2002 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG 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 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+int
+putc_unlocked (int c, FILE *stream)
+{
+ return putc (c, stream);
+}