pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/libfetch libfetch-2.7:
details: https://anonhg.NetBSD.org/pkgsrc/rev/a23cb69c6b61
branches: trunk
changeset: 541336:a23cb69c6b61
user: joerg <joerg%pkgsrc.org@localhost>
date: Sun Apr 20 15:29:26 2008 +0000
description:
libfetch-2.7:
Add fetchCopyURL.
diffstat:
net/libfetch/Makefile | 4 ++--
net/libfetch/files/fetch.c | 27 ++++++++++++++++++++++++++-
net/libfetch/files/fetch.h | 3 ++-
3 files changed, 30 insertions(+), 4 deletions(-)
diffs (71 lines):
diff -r 1a066d94a6ce -r a23cb69c6b61 net/libfetch/Makefile
--- a/net/libfetch/Makefile Sun Apr 20 13:59:09 2008 +0000
+++ b/net/libfetch/Makefile Sun Apr 20 15:29:26 2008 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.9 2008/04/19 14:49:23 joerg Exp $
+# $NetBSD: Makefile,v 1.10 2008/04/20 15:29:26 joerg Exp $
#
-DISTNAME= libfetch-2.6
+DISTNAME= libfetch-2.7
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
diff -r 1a066d94a6ce -r a23cb69c6b61 net/libfetch/files/fetch.c
--- a/net/libfetch/files/fetch.c Sun Apr 20 13:59:09 2008 +0000
+++ b/net/libfetch/files/fetch.c Sun Apr 20 15:29:26 2008 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fetch.c,v 1.4 2008/04/19 14:49:23 joerg Exp $ */
+/* $NetBSD: fetch.c,v 1.5 2008/04/20 15:29:26 joerg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* All rights reserved.
@@ -297,6 +297,31 @@
}
/*
+ * Copy an existing URL.
+ */
+struct url *
+fetchCopyURL(const struct url *src)
+{
+ struct url *dst;
+ char *doc;
+
+ /* allocate struct url */
+ if ((dst = malloc(sizeof(*dst))) == NULL) {
+ fetch_syserr();
+ return (NULL);
+ }
+ if ((doc = strdup(src->doc)) == NULL) {
+ fetch_syserr();
+ free(dst);
+ return (NULL);
+ }
+ *dst = *src;
+ dst->doc = doc;
+
+ return dst;
+}
+
+/*
* Split an URL into components. URL syntax is:
* [method:/][/[user[:pwd]@]host[:port]/][document]
* This almost, but not quite, RFC1738 URL syntax.
diff -r 1a066d94a6ce -r a23cb69c6b61 net/libfetch/files/fetch.h
--- a/net/libfetch/files/fetch.h Sun Apr 20 13:59:09 2008 +0000
+++ b/net/libfetch/files/fetch.h Sun Apr 20 15:29:26 2008 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fetch.h,v 1.6 2008/04/19 14:49:23 joerg Exp $ */
+/* $NetBSD: fetch.h,v 1.7 2008/04/20 15:29:26 joerg Exp $ */
/*-
* Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
* All rights reserved.
@@ -145,6 +145,7 @@
struct url *fetchMakeURL(const char *, const char *, int,
const char *, const char *, const char *);
struct url *fetchParseURL(const char *);
+struct url *fetchCopyURL(const struct url *);
void fetchFreeURL(struct url *);
/* URL listening */
Home |
Main Index |
Thread Index |
Old Index