Revision: 14686
Author: adrian.chadd
Date: Sun May 23 00:33:46 2010
Log: Begin breaking out the URL and protocol_t related code from src/
and into a new top level library.
http://code.google.com/p/lusca-cache/source/detail?r=14686
Added:
/branches/LUSCA_HEAD/libsqurl
/branches/LUSCA_HEAD/libsqurl/Makefile.am
/branches/LUSCA_HEAD/libsqurl/url.c
/branches/LUSCA_HEAD/libsqurl/url.h
Modified:
/branches/LUSCA_HEAD/Makefile.am
/branches/LUSCA_HEAD/configure.in
/branches/LUSCA_HEAD/src/Makefile.am
=======================================
--- /dev/null
+++ /branches/LUSCA_HEAD/libsqurl/Makefile.am Sun May 23 00:33:46 2010
@@ -0,0 +1,7 @@
+## Process this file with automake to produce Makefile.in
+
+libsqurl_a_SOURCES = \
+ url.c
+
+noinst_LIBRARIES = \
+ libsqurl.a
=======================================
--- /dev/null
+++ /branches/LUSCA_HEAD/libsqurl/url.c Sun May 23 00:33:46 2010
@@ -0,0 +1,36 @@
+#include "../include/config.h"
+
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "../include/util.h"
+
+#include "url.h"
+
+char *
+url_convert_hex(char *org_url, int allocate)
+{
+ static char code[] = "00";
+ char *url = NULL;
+ char *s = NULL;
+ char *t = NULL;
+ url = allocate ? (char *) xstrdup(org_url) : org_url;
+ if ((int) strlen(url) < 3 || !strchr(url, '%'))
+ return url;
+ for (s = t = url; *s; s++) {
+ if (*s == '%' && *(s + 1) && *(s + 2)) {
+ code[0] = *(++s);
+ code[1] = *(++s);
+ *t++ = (char) strtol(code, NULL, 16);
+ } else {
+ *t++ = *s;
+ }
+ }
+ do {
+ *t++ = *s;
+ } while (*s++);
+ return url;
+}
+
=======================================
--- /dev/null
+++ /branches/LUSCA_HEAD/libsqurl/url.h Sun May 23 00:33:46 2010
@@ -0,0 +1,6 @@
+#ifndef __LUSCA_LIBSQURL_URL_H__
+#define __LUSCA_LIBSQURL_URL_H__
+
+extern char * url_convert_hex(char *org_url, int allocate);
+
+#endif
=======================================
--- /branches/LUSCA_HEAD/Makefile.am Wed May 19 20:20:46 2010
+++ /branches/LUSCA_HEAD/Makefile.am Sun May 23 00:33:46 2010
@@ -4,8 +4,8 @@
#
AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5
-DIST_SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug libstmem
libasyncio libsqtlv libsqstore snmplib scripts src icons errors contrib doc
helpers tools app
-SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug libstmem
libasyncio libsqtlv libsqstore @makesnmplib@ scripts src icons errors doc
helpers tools app
+DIST_SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug
libstmem libasyncio libsqtlv libsqstore snmplib scripts src icons errors
contrib doc helpers tools app
+SUBDIRS = lib libcore libmem libsqname libcb libiapp libstat libsqftp
libsqurl libhttp libsqdns libsqident libsqinet libhelper libmime libsqdebug
libstmem libasyncio libsqtlv libsqstore @makesnmplib@ scripts src icons
errors doc helpers tools app
DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
DEFAULT_PINGER = $(libexecdir)/`echo pinger |
sed '$(transform);s/$$/$(EXEEXT)/'`
=======================================
--- /branches/LUSCA_HEAD/configure.in Wed May 19 20:20:46 2010
+++ /branches/LUSCA_HEAD/configure.in Sun May 23 00:33:46 2010
@@ -3294,6 +3294,7 @@
libsqinet/Makefile \
libhelper/Makefile \
libsqftp/Makefile \
+ libsqurl/Makefile \
libhttp/Makefile \
libiapp/Makefile \
libstat/Makefile \
=======================================
--- /branches/LUSCA_HEAD/src/Makefile.am Thu May 20 02:16:16 2010
+++ /branches/LUSCA_HEAD/src/Makefile.am Sun May 23 00:33:46 2010
@@ -239,6 +239,7 @@
-L../libstmem \
-L../libiapp \
-L../libsqftp \
+ -L../libsqurl \
-L../libhttp \
-L../libstat \
-L../libsqdns \
@@ -274,6 +275,7 @@
-lmime \
-liapp \
-lsqftp \
+ -lsqurl \
-lhttp \
-lstat \
-lmiscutil \
@@ -314,7 +316,7 @@
data_DATA = \
mib.txt
-LDADD = -L../lib -L../libcore -L../libsqdebug -L../libmem -L../libsqname
-L../libcb -L../libhelper -L../libmime -L../libstmem -L../libiapp
-L../libsqftp -L../libhttp -L../libstat -L../libsqdns -L../libsqident
-L../libsqinet -L../libasyncio -L../libsqtlv -L../libsqstore -lsqstore
-lsqtlv -lasyncio -lsqinet -lsqdns -lsqdebug -lcore -lmem -lsqname -lcb
-lsqident -lhelper -lmime -lstmem -liapp -lsqftp -lhttp -lstat -lmiscutil
@XTRA_LIBS@
+LDADD = -L../lib -L../libcore -L../libsqdebug -L../libmem -L../libsqname
-L../libcb -L../libhelper -L../libmime -L../libstmem -L../libiapp
-L../libsqftp -L../libsqurl -L../libhttp -L../libstat -L../libsqdns
-L../libsqident -L../libsqinet -L../libasyncio -L../libsqtlv
-L../libsqstore -lsqstore -lsqtlv -lasyncio -lsqinet -lsqdns -lsqdebug
-lcore -lmem -lsqname -lcb -lsqident -lhelper -lmime -lstmem -liapp -lsqftp
-lsqurl -lhttp -lstat -lmiscutil @XTRA_LIBS@
EXTRA_DIST = \
cf_gen_defines \
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.