uget-2.0.2/0000775000175000017500000000000012574544073007475 500000000000000uget-2.0.2/depcomp0000755000175000017500000004755611736361705011007 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2011-12-04.11; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/ \1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/ / G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: uget-2.0.2/ar-lib0000755000175000017500000001305311736361705010507 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-01-30.22; # UTC # Copyright (C) 2010, 2012 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat < #include #include #include #include #include #include #include #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #include void test_launch (void) { uint16_t* pathutf16; uint16_t* parmutf16; int result; pathutf16 = ug_utf8_to_utf16 ("C:\\Program Files\\uGet\\bin\\aria2c", -1, NULL); parmutf16 = ug_utf8_to_utf16 ("--enable-rpc=true", -1, NULL); wprintf (L"%s %s", pathutf16, parmutf16); result = (int)ShellExecuteW (NULL, L"open", pathutf16, parmutf16, NULL, SW_HIDE); if (result > 32) puts ("ShellExecuteW - OK"); free (parmutf16); free (pathutf16); } #else void test_launch (void) { } #endif // ---------------------------------------------------------------------------- // test UgUri void dump_uri (UgUri* uri) { } void test_uri (void) { char* temp; char* hosts[] = {"ftp.you.com", ".your.org", ".edu", NULL}; char* exts[] = {"png", "bmp", "jpg", NULL}; char* schemes[] = {"ftp", "http", "git", NULL}; // const char* uri = "ftp://i.am.ftp.you.com/file.bmp"; const char* uri = "http://my.and.your.org/file%200.png"; // const char* uri = "git://this.edu/file.jpg"; UgUri uuri; int index; puts ("\n--- test_uri:"); ug_uri_init (&uuri, uri); index = ug_uri_match_hosts (&uuri, hosts); printf ("ug_uri_match_hosts () return %d\n", index); index = ug_uri_match_schemes (&uuri, schemes); printf ("ug_uri_match_schemes () return %d\n", index); index = ug_uri_match_file_exts (&uuri, exts); printf ("ug_uri_match_file_exts () return %d\n", index); temp = ug_uri_get_file (&uuri); puts (temp); ug_free (temp); } // ---------------------------------------------------------------------------- // test UgList static UgLink link[4]; void test_list (void) { UgLink* temp; UgList list; uintptr_t index; ug_list_init (&list); for (index = 0; index < 4; index++) link[index].data = (void*) index; ug_list_append (&list, link + 0); ug_list_append (&list, link + 1); ug_list_append (&list, link + 2); ug_list_append (&list, link + 3); ug_list_remove (&list, link + 2); ug_list_insert (&list, link + 3, link + 2); for (temp = list.head; temp; temp = temp->next) { printf ("%d, %p, %p\n", (int)(intptr_t)temp->data, temp->prev, temp->next); } } // ---------------------------------------------------------------------------- // test UgNode void dump_node (UgNode* root) { UgNode* cur; printf ("node->next : %p\n", root->next); printf ("node->prev : %p\n", root->prev); printf ("node->parent : %p\n", root->parent); printf ("node->children : %p\n", root->children); printf ("node->n_children : %d\n", root->n_children); for (cur = root->children; cur; cur = cur->next) printf ("%u\n", (unsigned)(uintptr_t)cur->data); } void test_node (void) { UgNode* root; UgNode* node1; UgNode* node2; UgNode* node3; UgNode* node4; puts ("\n--- test_node:"); root = ug_node_new (); node1 = ug_node_new (); node1->data = (void*)(uintptr_t) 1; node2 = ug_node_new (); node2->data = (void*)(uintptr_t) 2; node3 = ug_node_new (); node3->data = (void*)(uintptr_t) 3; node4 = ug_node_new (); node4->data = (void*)(uintptr_t) 4; ug_node_append (root, node3); printf ("ug_node_append (3)\n"); ug_node_prepend (root, node1); printf ("ug_node_prepend (1)\n"); ug_node_insert (root, node3, node2); printf ("ug_node_insert (2) before 3\n"); ug_node_append (root, node4); printf ("ug_node_append (4)\n"); printf ("root.n_children : %d\n", root->n_children); dump_node (root); ug_node_unlink (node2); dump_node (node2); ug_node_free (root); ug_node_free (node1); ug_node_free (node2); ug_node_free (node3); ug_node_free (node4); } // ---------------------------------------------------------------------------- // UgBuffer void test_buffer () { UgBuffer buffer; puts ("\n--- test_buffer:"); ug_buffer_init (&buffer, 3); ug_buffer_write (&buffer, "This is test string.", -1); ug_buffer_write_char (&buffer, 'K'); ug_buffer_write_char (&buffer, '\0'); puts ((char*)buffer.beg); ug_buffer_clear (&buffer, 1); } // ---------------------------------------------------------------------------- // UgSLink void test_slink () { UgSLinks slinks; char* data1 = "1th"; char* data2 = "2th"; char* data3 = "3th"; char* data4 = "4th"; puts ("\n--- test_slink:"); ug_slinks_init (&slinks, 16); ug_slinks_add (&slinks, data1); ug_slinks_add (&slinks, data2); ug_slinks_add (&slinks, data3); ug_slinks_add (&slinks, data4); ug_slinks_remove (&slinks, data1, NULL); ug_slinks_remove (&slinks, data3, NULL); ug_slinks_remove (&slinks, data2, NULL); ug_slinks_remove (&slinks, data4, NULL); ug_slinks_add (&slinks, data2); ug_slinks_add (&slinks, data4); ug_slinks_foreach (&slinks, (void*)puts, NULL); ug_slinks_final (&slinks); } // ---------------------------------------------------------------------------- // UgUtil void test_base64 () { const char* test_string = "This is a test string."; char* base64; int len; puts ("\n--- test_base64:"); base64 = ug_base64_encode ((uint8_t*)test_string, strlen (test_string), &len); printf ("%.*s\n", len, base64); puts (base64); } // ---------------------------------------------------------------------------- // Utility void test_utility () { char* temp; time_t res; int n; res = ug_str_rfc822_to_time ("Sat, 07 Sep 2002 00:00:01 GMT"); if (res != -1) puts (ctime (&res)); res = ug_str_rfc3339_to_time ("2013-09-12T22:50:20+08:00"); if (res != -1) puts (ctime (&res)); temp = ug_build_filename ("basedir", "path", "file", NULL); printf ("ug_build_filename() - %s\n", temp); ug_free (temp); temp = ug_unescape_uri ("This%20is a test%200.", -1); puts (temp); ug_free (temp); temp = ug_strdup ("\nThis\n one\r"); puts ("--- ug_str_remove_crlf () --- start ---"); puts (temp); n = ug_str_remove_crlf (temp, temp); puts (temp); printf ("--- ug_str_remove_crlf () return %d --- end ---", n); ug_free (temp); } // ---------------------------------------------------------------------------- // Option struct Opt { int index; char* name; }; UgOptionEntry opt_entry[] = { {"category-index", "ci", offsetof (struct Opt, index), UG_ENTRY_INT, "", "=N", NULL}, {"category-name", "cn", offsetof (struct Opt, name), UG_ENTRY_STRING, "", "=name", NULL}, {NULL} }; int print_option_callback (UgOption* option, const char* name, const char* value, void* dest, void* data) { printf ("%s = %s\n", name, value); return TRUE; } void test_option (void) { UgOption option; struct Opt dest; ug_option_init (&option); // ug_option_set_parser (&option, print_option_callback, NULL, NULL); ug_option_set_parser (&option, ug_option_parse_entry, &dest, opt_entry); ug_option_parse (&option, "--category-index=1", -1); ug_option_parse (&option, "-cn=hhk", -1); ug_option_final (&option); } void test_cmd_arg (void) { const char* cmd = "--enable --file=\"\" --arg "; char** argv; int argc; int count; argv = ug_argv_from_cmd (cmd, &argc, 0); for (count = 0; count < argc; count++) puts (argv[count]); ug_argv_free (argv); } // ---------------------------------------------------------------------------- // HTML void start_element (UgHtml* uhtml, const char* element_name, const char** attribute_names, const char** attribute_values, void* dest, void* data) { int index; printf ("<%s", element_name); for (index = 0; attribute_names[index]; index++) printf (" %s=%s", attribute_names[index], attribute_values[index]); printf (">"); } void end_element (UgHtml* uhtml, const char* element_name, void* dest, void* data) { printf ("\n", element_name); } void text (UgHtml* uhtml, const char* text, int text_len, void* dest, void* data) { printf ("%s", text); } UgHtmlParser testparser = { start_element, end_element, text }; void test_html (void) { UgHtml* uhtml; uhtml = ug_html_new (); ug_html_begin_parse (uhtml); ug_html_push (uhtml, &testparser, NULL, NULL); ug_html_parse (uhtml, "< p attr1=\"value1\" attr2=val2/> < &xxxxx; ", -1); ug_html_end_parse (uhtml); puts("\n"); } // ---------------------------------------------------------------------------- // main int main (void) { test_html (); test_cmd_arg (); test_option (); test_list (); test_node (); test_uri (); test_buffer (); test_slink (); // test_launch (); test_base64 (); test_utility (); return 0; } uget-2.0.2/tests/Makefile.am0000664000175000017500000000367012267677745012635 00000000000000noinst_PROGRAMS = \ test-json test-jsonrpc test-plugin+app test-info \ test-uglib test-uget # test-uglib-cxx test-uget-cxx TESTS_LIBS = @PTHREAD_LIBS@ @CURL_LIBS@ @GLIB_LIBS@ # set the include path found by configure AM_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget AM_CFLAGS = @PTHREAD_CFLAGS@ @LFS_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ AM_LDFLAGS = @LFS_LDFLAGS@ # test_json_CPPFLAGS = -I$(top_srcdir)/uglib test_json_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_json_SOURCES = test-json.c # test_jsonrpc_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_jsonrpc_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_jsonrpc_SOURCES = test-jsonrpc.c # test_plugin_app_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_plugin_app_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_plugin_app_SOURCES = test-plugin+app.c # test_info_CPPFLAGS = -I$(top_srcdir)/uglib test_info_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_info_SOURCES = test-info.c # test_uglib_CPPFLAGS = -I$(top_srcdir)/uglib test_uglib_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uglib_SOURCES = test-uglib.c # test_uget_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_uget_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uget_SOURCES = test-uget.c ## test C++ standard-layout #test_uglib_cxx_CPPFLAGS = -I$(top_srcdir)/uglib #test_uglib_cxx_CXXFLAGS = -std=c++11 #test_uglib_cxx_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uglib_cxx_SOURCES = test-uglib-cxx.cxx ## test_uget_cxx_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget #test_uget_cxx_CXXFLAGS = -std=c++11 #test_uget_cxx_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uget_cxx_SOURCES = test-uget-cxx.cxx uget-2.0.2/tests/test-plugin+app.c0000664000175000017500000002602712456470652013761 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #define ug_sleep Sleep #else #include // usleep() #define ug_sleep(millisecond) usleep (millisecond * 1000) #endif // _WIN32 || _WIN64 // ---------------------------------------------------------------------------- // test_node void download_node (UgetNode* node, const UgetPluginInfo* info) { UgetCommon* common; UgetPlugin* plugin; UgetEvent* events; UgetEvent* cur; UgetEvent* next; UgetProgress* progress; int integer[2]; char* string[5]; plugin = uget_plugin_new (info); integer[0] = 1000000; integer[1] = 1000000; uget_plugin_ctrl (plugin, UGET_PLUGIN_CTRL_SPEED, integer); uget_plugin_start (plugin, node); while (uget_plugin_sync (plugin)) { ug_sleep (1000); // event events = uget_plugin_pop (plugin); for (cur = events; cur; cur = next) { next = cur->next; printf ("\n" "Event type: %d - %s\n", cur->type, cur->string); uget_event_free (cur); } // progress progress = ug_info_get (&node->info, UgetProgressInfo); if (progress == NULL) continue; string[0] = ug_str_from_int_unit (progress->complete, NULL); string[1] = ug_str_from_int_unit (progress->total, NULL); string[2] = ug_str_from_int_unit (progress->uploaded, NULL); string[3] = ug_str_from_int_unit (progress->download_speed, "/s"); string[4] = ug_str_from_int_unit (progress->upload_speed, "/s"); printf ("\r" "DL: %s / %s, %d%%, %s | UL: %s, %s" " ", string[0], string[1], progress->percent, string[3], string[2], string[4]); for (integer[0] = 0; integer[0] < 5; integer[0]++) ug_free (string[integer[0]]); } // these data may changed, print them. common = ug_info_get (&node->info, UgetCommonInfo); printf ("\n" "node->name : %s\n" "common->uri : %s\n" "common->file : %s\n", node->name, common->uri, common->file); // print children for (node = node->children; node; node = node->next) printf ("child node name : %s\n", node->name); uget_plugin_unref (plugin); } void test_node_download (void) { UgetCommon* common; UgetHttp* http; UgetNode* node; char* referrer; char* uri; char* mirrors; uri = "http://download.tuxfamily.org/notepadplus/6.5.3/npp.6.5.3.Installer.exe"; // uri = "http://ftp.gimp.org/pub/gimp/v2.8/windows/gimp-2.8.10-setup.exe"; // mirrors = "ftp://195.220.108.108/linux/fedora/linux/updates/19/x86_64/kernel-3.11.2-201.fc19.x86_64.rpm"; mirrors = NULL; // referrer = "http://code.google.com/p/tortoisegit/wiki/Download?tm=2"; referrer = NULL; node = uget_node_new (NULL); // commom options common = ug_info_realloc (&node->info, UgetCommonInfo); common->uri = ug_strdup (uri); if (mirrors) common->mirrors = ug_strdup (mirrors); common->folder = ug_strdup ("D:\\Downloads"); common->max_connections = 2; common->debug_level = 1; // http options http = ug_info_realloc (&node->info, UgetHttpInfo); if (referrer) http->referrer = ug_strdup (referrer); // download_node (node, UgetPluginAria2Info); download_node (node, UgetPluginCurlInfo); uget_node_unref (node); } // ---------------------------------------------------------------------------- // test_plugin void test_setup_plugin_aria2 (void) { const UgetPluginInfo* pinfo; pinfo = UgetPluginAria2Info; uget_plugin_set (pinfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_URI, "http://localhost/jsonrpc"); #if defined _WIN32 || defined _WIN64 uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_PATH, "C:\\Program Files\\uGet\\bin\\aria2c.exe"); #endif uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_ARGUMENT, "--enable-rpc=true -D --check-certificate=false"); uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_LAUNCH, (void*) TRUE); uget_plugin_set (pinfo, UGET_PLUGIN_ARIA2_SHUTDOWN, (void*) TRUE); ug_sleep (1000); uget_plugin_set (pinfo, UGET_PLUGIN_INIT, (void*) FALSE); ug_sleep (1000); } // ---------------------------------------------------------------------------- // test_task void print_node_speed_limit (UgetNode** dnode, int count) { int total[2] = {0,0}; UgetRelation* relation; for (count = 0; count < 7; count++) { relation = ug_info_get (&dnode[count]->info, UgetRelationInfo); printf ("limit D: %d, U: %d | speed D: %d, U: %d\n", relation->task.limit[0], relation->task.limit[1], relation->task.speed[0], relation->task.speed[1]); total[0] += relation->task.limit[0]; total[1] += relation->task.limit[1]; } printf ("total limit D: %d, U: %d\n", total[0], total[1]); } void test_task (void) { UgetTask* task; UgetNode* dnode[7]; UgetRelation* relation; int count; task = calloc (1, sizeof (UgetTask)); uget_task_init (task); // task speed control ------------------- for (count = 0; count < 7; count++) { dnode[count] = uget_node_new (NULL); relation = ug_info_realloc (&dnode[count]->info, UgetRelationInfo); relation->task.limit[0] = 2000; relation->task.limit[1] = 1500; relation->task.speed[0] = 2000 - count * 200; relation->task.speed[1] = 1500 - count * 200; uget_task_add (task, dnode[count], UgetPluginEmptyInfo); } relation->task.limit[0] = 0; relation->task.limit[1] = 0; uget_task_set_speed (task, 12000, 8000); print_node_speed_limit(dnode, 7); puts ("---"); uget_task_adjust_speed (task); print_node_speed_limit(dnode, 7); uget_task_remove_all (task); uget_task_final (task); free (task); for (count = 0; count < 7; count++) uget_node_unref (dnode[count]); } // ---------------------------------------------------------------------------- // test_app void setup_app (UgetApp* app) { UgetNode* cnode; UgetCategory* category; UgetCommon* common; cnode = uget_node_new (NULL); cnode->name = ug_strdup ("Home Category"); category = ug_info_realloc (&cnode->info, UgetCategoryInfo); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("http"); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("https"); *(char**)ug_array_alloc (&category->schemes, 1) = ug_strdup ("ftp"); common = ug_info_realloc (&cnode->info, UgetCommonInfo); common->max_connections = 2; uget_app_add_category (app, cnode, TRUE); uget_app_add_plugin (app, UgetPluginAria2Info); uget_app_add_plugin (app, UgetPluginCurlInfo); uget_app_clear_plugins (app); uget_app_set_default_plugin (app, UgetPluginCurlInfo); } void start_app (UgetApp* app) { UgetNode* dnode; UgetCommon* common; char* string[2]; dnode = uget_node_new (NULL); dnode->name = ug_strdup ("Download"); common = ug_info_realloc (&dnode->info, UgetCommonInfo); common->uri = ug_strdup ("http://www.utorrent.com/scripts/dl.php?track=stable&build=29812&client=utorrent"); common->folder = ug_strdup ("D:\\Downloads"); common->debug_level = 1; // common->keeping.enable = TRUE; // common->keeping.uri = TRUE; // common->keeping.folder = TRUE; // common->keeping.debug_level = TRUE; uget_app_add_download (app, dnode, NULL, FALSE); puts ("uget_app_grow()"); while (uget_app_grow (app, FALSE)) { ug_sleep (1000); string[0] = ug_str_from_int_unit (app->task.speed.download, "/s"); string[1] = ug_str_from_int_unit (app->task.speed.upload, "/s"); printf ("\r" "DL: %s | UL %s" " ", string[0], string[1]); ug_free (string[0]); ug_free (string[1]); } puts ("uget_app_grow() return 0"); puts ("call uget_app_grow() again"); uget_app_grow (app, FALSE); } void close_app (UgetApp* app) { uget_app_clear_plugins (app); } void test_app_node (UgetApp* app) { UgetNode* dnode[7]; UgetNode* cnode; UgetCommon* common; int count; for (count = 0; count < 7; count++) { dnode[count] = uget_node_new (NULL); common = ug_info_realloc (&dnode[count]->info, UgetCommonInfo); common->uri = ug_strdup ("ftp://127.0.0.1/"); common->folder = ug_strdup ("D:\\Downloads"); common->keeping.enable = TRUE; common->keeping.uri = FALSE; common->keeping.folder = FALSE; uget_app_add_download (app, dnode[count], NULL, TRUE); } uget_app_move_download (app, dnode[5], NULL); uget_app_delete_download (app, dnode[2], TRUE); uget_app_delete_download (app, dnode[4], FALSE); uget_app_delete_download (app, dnode[6], FALSE); cnode = app->real.children; if (cnode) printf ("%d\n", cnode->n_children); cnode = app->split.children; if (cnode) printf ("%d\n", cnode->n_children); cnode = app->mix.children; if (cnode) printf ("%d\n", cnode->n_children); cnode = app->mix_split.children; if (cnode) printf ("%d\n", cnode->n_children); } void test_app (void) { UgetApp* app; app = calloc (1, sizeof (UgetApp)); uget_app_init (app); setup_app (app); start_app (app); // test_app_node (app); uget_app_save_categories (app, NULL); // uget_app_load_categories (app, NULL); uget_app_final (app); free (app); } // ---------------------------------------------------------------------------- // main int main (void) { // initialize plugin uget_plugin_set (UgetPluginCurlInfo, UGET_PLUGIN_INIT, (void*) TRUE); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_INIT, (void*) TRUE); // test_setup_plugin_aria2 (); // test_node_download (); // test_task (); // test_app (); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_ARIA2_SHUTDOWN_NOW, (void*) TRUE); // finalize plugin uget_plugin_set (UgetPluginCurlInfo, UGET_PLUGIN_INIT, (void*) FALSE); uget_plugin_set (UgetPluginAria2Info, UGET_PLUGIN_INIT, (void*) FALSE); ug_sleep(1000); return 0; } uget-2.0.2/tests/test-json.c0000664000175000017500000005741012456470652012660 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include #include #include #include #include #include #include #include #include // ---------------------------------------------------------------------------- // WorkedId typedef struct { int worked; char* id; } WorkedId; UgJsonError worked_id_custom_parse (UgJson* json, const char* name, const char* value, void* dest, void* none); void worked_id_custom_write (UgJson* json, void* data); UgEntry WorkedIdEntry[] = { {"worked", offsetof (WorkedId, worked), UG_ENTRY_BOOL, NULL, NULL}, {"id", offsetof (WorkedId, id), UG_ENTRY_STRING, NULL, NULL}, {NULL}, }; // used by test_json_object_custom() UgEntry WorkedIdCustomEntry[] = { {NULL, 0, UG_ENTRY_CUSTOM, (UgJsonParseFunc) worked_id_custom_parse, (UgJsonWriteFunc) worked_id_custom_write }, {NULL} }; // ------------------------------------ // WorkedId functions void worked_id_init (WorkedId* wid) { wid->worked = 0; wid->id = NULL; } void worked_id_final (WorkedId* wid) { ug_free (wid->id); } WorkedId* worked_id_new (void) { WorkedId* wid; wid = ug_malloc (sizeof (WorkedId)); worked_id_init(wid); return wid; } void worked_id_free (WorkedId* wid) { worked_id_final (wid); } // UgEntry.type = UG_ENTRY_CUSTOM // UgEntry.param1 = (UgJsonParseFunc) worked_id_custom_parse UgJsonError worked_id_custom_parse (UgJson* json, const char* name, const char* value, void* dest, void* none) { // WorkedId's type is UG_JSON_OBJECT if (json->type != UG_JSON_OBJECT) { // if (json->type == UG_JSON_ARRAY) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } // initialize WorkedId. If you have initialized it, don't initialize again. // worked_id_init (dest); // push JSON parser, only UG_JSON_OBJECT or UG_JSON_ARRAY need to push parser. ug_json_push (json, ug_json_parse_entry, dest, WorkedIdEntry); // return error code return UG_JSON_ERROR_NONE; } // UgEntry.type = UG_ENTRY_CUSTOM // UgEntry.param2 = (UgJsonWriteFunc) worked_id_custom_write void worked_id_custom_write (UgJson* json, void* data) { ug_json_write_object_head (json); ug_json_write_entry (json, data, WorkedIdEntry); ug_json_write_object_tail (json); } // ---------------------------------------------------------------------------- // WorkedIdArray typedef UG_ARRAY (WorkedId) WorkedIdArray; UgJsonError worked_id_array_parse (UgJson* json, const char* name, const char* value, void* array, void* none) { WorkedId* wid; // WorkedId's type is UG_JSON_OBJECT if (json->type != UG_JSON_OBJECT) { // if (json->type == UG_JSON_ARRAY) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } wid = ug_array_alloc (array, 1); worked_id_init (wid); // push JSON parser, only UG_JSON_OBJECT or UG_JSON_ARRAY need to push parser. ug_json_push (json, ug_json_parse_entry, wid, WorkedIdEntry); // return error code return UG_JSON_ERROR_NONE; } void worked_id_array_write (UgJson* json, void* array) { WorkedId* cur; WorkedId* end; cur = ((WorkedIdArray*)array)->at; end = ((WorkedIdArray*)array)->at + ((WorkedIdArray*)array)->length; for (; cur < end; cur++) worked_id_custom_write (json, cur); } // ---------------------------------------------------------------------------- // SampleJs typedef struct { char* name; struct Info { struct FtpInfo { char* user; char* password; int active_mode; } ftp; struct HttpInfo { char* user_agent; char* referrer; } http; UgArrayStr sarray; UgArrayInt iarray; UG_ARRAY(WorkedId) oarray; } info; } SampleJs; // SampleJs.Info.FtpInfo UgEntry FtpInfoEntry[] = { {"user", offsetof (struct FtpInfo, user), UG_ENTRY_STRING, NULL, NULL}, {"password", offsetof (struct FtpInfo, password), UG_ENTRY_STRING, NULL, NULL}, {"active-mode",offsetof (struct FtpInfo, active_mode),UG_ENTRY_BOOL, NULL, NULL}, {NULL}, }; // SampleJs.Info.HttpInfo UgEntry HttpInfoEntry[] = { {"user-agent", offsetof (struct HttpInfo, user_agent), UG_ENTRY_STRING, NULL, NULL}, {"referrer", offsetof (struct HttpInfo, referrer), UG_ENTRY_STRING, NULL, NULL}, {NULL}, }; // SampleJs.Info UgEntry InfoEntry[] = { {"ftp", offsetof (struct Info, ftp), UG_ENTRY_OBJECT, FtpInfoEntry, (UgInitFunc) NULL}, {"http", offsetof (struct Info, http), UG_ENTRY_OBJECT, HttpInfoEntry, (UgInitFunc) NULL}, {"sarray", offsetof (struct Info, sarray), UG_ENTRY_ARRAY, ug_json_parse_array_string, ug_json_write_array_string}, {"iarray", offsetof (struct Info, iarray), UG_ENTRY_ARRAY, ug_json_parse_array_int, ug_json_write_array_int}, {"oarray", offsetof (struct Info, oarray), UG_ENTRY_ARRAY, worked_id_array_parse, worked_id_array_write}, {NULL}, }; // SampleJs UgEntry SampleJsEntry[] = { {"name", offsetof (SampleJs, name), UG_ENTRY_STRING, NULL, NULL}, {"info", offsetof (SampleJs, info), UG_ENTRY_OBJECT, InfoEntry, (UgInitFunc) NULL}, {NULL}, }; // used by sample_js_parse() UgEntry SampleJsObjectEntry[] = { {NULL, 0, UG_ENTRY_OBJECT, SampleJsEntry, (UgInitFunc) NULL}, {NULL} }; // ------------------------------------ // SampleJs functions SampleJs* sample_js_new (void) { SampleJs* samplejs; samplejs = calloc (1, sizeof (SampleJs)); ug_array_init (&samplejs->info.sarray, sizeof (char*), 0); ug_array_init (&samplejs->info.iarray, sizeof (int), 0); ug_array_init (&samplejs->info.oarray, sizeof (WorkedId), 0); return samplejs; } void sample_js_free (SampleJs* samplejs) { ug_array_clear (&samplejs->info.sarray); ug_array_clear (&samplejs->info.iarray); ug_array_clear (&samplejs->info.oarray); free (samplejs); } // UgJsonParseFunc UgJsonError json_debug_parser (UgJson* json, const char* name, const char* value, void* dest, void* none) { printf ("scope : %s\n", (json->scope == UG_JSON_ARRAY) ? "A" : "O"); if (json->type == UG_JSON_ARRAY || json->type == UG_JSON_OBJECT) ug_json_push (json, json_debug_parser, NULL, NULL); // UgJson.index[0] : index of name // UgJson.index[1] : index of value // debug if (json->index[0]) printf ("'%s' : ", json->buf.at + json->index[0]); switch (json->type) { case UG_JSON_NULL: // null printf ("NULL '%s'", json->buf.at + json->index[1]); break; case UG_JSON_TRUE: // true printf ("TRUE '%s'", json->buf.at + json->index[1]); break; case UG_JSON_FALSE: // false printf ("FALSE '%s'", json->buf.at + json->index[1]); break; case UG_JSON_NUMBER: // 1234, 0.567 printf ("NUMBER '%s'", json->buf.at + json->index[1]); break; case UG_JSON_STRING: // "string" printf ("STRING '%s'", json->buf.at + json->index[1]); break; case UG_JSON_OBJECT: // { printf ("OBJECT"); break; case UG_JSON_ARRAY: // [ printf ("ARRAY"); break; } printf ("\n"); return 0; } static const char* sample_js_string = { "{" " \"name\": \"\\u5927\\u4E2Dfile.torrent\"," " \"info\":" " {" " \"ftp\":" " {" " \"user\": \"anonymous\"," " \"password\": \"guest@unknown\"," " \"active-mode\": false" " }," " \"http\":" " {" " \"user-agent\": \"Browser\\/version\"," " \"referrer\": \"http:\\/\\/127.0.0.1\\/\" " " }," " \"sarray\":" " [" " \"element1\", \"element2\"," " \"element3\", \"element\\n4\" " " ]," " \"iarray\":" " [" " 1234, 2012," " 4567, 2011 " " ]," " \"oarray\":" " [" " { \"worked\" : false, \"id\": \"KMan\" }," " { \"worked\" : true , \"id\": \"Kimi\" }," " { \"worked\" : false, \"id\": \"XMan\" }," " { \"worked\" : true , \"id\": \"WMan\" }" " ]" " }" "}" }; void sample_js_parse (SampleJs* samplejs) { UgJson json; int code; // JSON string for SampleJs const char* json_string = sample_js_string; memset (&json, 0, sizeof (json)); ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of object ug_json_push (&json, ug_json_parse_entry, samplejs, SampleJsObjectEntry); #elif 1 // method 2: push ug_json_parse_object() to parse start of object ug_json_push (&json, ug_json_parse_entry, samplejs, SampleJsEntry); ug_json_push (&json, ug_json_parse_object, NULL, NULL); #else // debug ug_json_push (&json, json_debug_parser, NULL, NULL); ug_json_push (&json, ug_json_parse_object, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } void sample_js_reparse (SampleJs* samplejs) { UgJson json; UgValue value; ug_value_init (&value); memset (&json, 0, sizeof (json)); ug_json_init (&json); ug_json_begin_parse (&json); ug_json_push (&json, ug_json_parse_value, &value, NULL); ug_json_parse (&json, sample_js_string, -1); ug_json_end_parse (&json); // convert UgValue to UgEntry ug_json_begin_parse (&json); ug_json_push (&json, ug_json_parse_entry, samplejs, SampleJsObjectEntry); ug_json_parse_by_value (&json, &value); ug_json_end_parse (&json); ug_json_final (&json); ug_value_clear (&value); } void sample_js_print (SampleJs* samplejs) { UgJson json; UgBuffer buffer; printf ("\n" "obj.info.ftp.user: %s\n" "obj.info.ftp.password: %s\n" "obj.info.ftp.active_mode: %d\n" "obj.info.http.user_agent: %s\n" "obj.info.http.referrer: %s\n", samplejs->info.ftp.user, samplejs->info.ftp.password, samplejs->info.ftp.active_mode, samplejs->info.http.user_agent, samplejs->info.http.referrer ); printf ("obj.info.sarray[0]: %s\n" "obj.info.sarray[1]: %s\n" "obj.info.sarray[2]: %s\n" "obj.info.sarray[3]: %s\n", samplejs->info.sarray.at[0], samplejs->info.sarray.at[1], samplejs->info.sarray.at[2], samplejs->info.sarray.at[3]); printf ("obj.info.iarray[0]: %d\n" "obj.info.iarray[1]: %d\n" "obj.info.iarray[2]: %d\n" "obj.info.iarray[3]: %d\n", samplejs->info.iarray.at[0], samplejs->info.iarray.at[1], samplejs->info.iarray.at[2], samplejs->info.iarray.at[3]); printf ("obj.info.oarray[0].worked: %d\n" "obj.info.oarray[0].id: %s\n" "obj.info.oarray[1].worked: %d\n" "obj.info.oarray[1].id: %s\n" "obj.info.oarray[2].worked: %d\n" "obj.info.oarray[2].id: %s\n" "obj.info.oarray[3].worked: %d\n" "obj.info.oarray[3].id: %s\n", samplejs->info.oarray.at[0].worked, samplejs->info.oarray.at[0].id, samplejs->info.oarray.at[1].worked, samplejs->info.oarray.at[1].id, samplejs->info.oarray.at[2].worked, samplejs->info.oarray.at[2].id, samplejs->info.oarray.at[3].worked, samplejs->info.oarray.at[3].id); ug_json_init (&json); ug_buffer_init (&buffer, 1024); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, samplejs, SampleJsObjectEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_entry (&json, samplejs, SampleJsEntry); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_buffer_write_char (&buffer, '\0'); puts ((char*)buffer.beg); ug_buffer_clear (&buffer, 1); ug_json_final (&json); } // UgBufferFunc static int buffer_to_file (UgBuffer* buffer) { FILE* file = buffer->data; printf ("write %d bytes to file\n", ug_buffer_length (buffer)); fwrite (buffer->beg, 1, ug_buffer_length(buffer), file); buffer->cur = buffer->beg; return 0; } void sample_js_to_file (SampleJs* samplejs, const char* filename) { UgBuffer buffer; UgJson json; FILE* file; file = fopen (filename, "w"); ug_buffer_init (&buffer, 128); buffer.more = buffer_to_file; buffer.data = file; ug_json_init (&json); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, samplejs, SampleJsObjectEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_entry (&json, samplejs, SampleJsEntry); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_json_final (&json); fclose (file); } // ---------------------------------------------------------------------------- // JSON object sample void test_json_object_custom (void) { UgBuffer buffer; WorkedId worked; int code; UgJson json; const char* json_string = { "{ \"worked\" : true , \"id\": \"C.H. Huang\" }" }; puts ("\n--- test_json_object_custom:"); worked_id_init (&worked); ug_json_init (&json); ug_buffer_init (&buffer, 128); // parse ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of object ug_json_push (&json, ug_json_parse_entry, &worked, WorkedIdCustomEntry); #else // method 2: push ug_json_parse_object() to parse start of object ug_json_push (&json, ug_json_parse_entry, &worked, WorkedIdEntry); ug_json_push (&json, ug_json_parse_object, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); // write ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, &worked, WorkedIdCustomEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_entry (&json, &worked, WorkedIdEntry); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); ug_buffer_clear (&buffer, 1); ug_json_final (&json); worked_id_final (&worked); } // ---------------------------------------------------------------------------- // JSON array sample // use UgArray to store JSON number array void test_json_int_array (void) { // method 1 const UgEntry intArrayEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, ug_json_parse_array_int, ug_json_write_array_int}, {NULL} }; // common UgJson json; UgArrayInt array; UgJsonError code; char* teststr = "[12,22,34,56]"; int index; puts ("\n--- test_json_int_array:"); memset (&json, 0, sizeof (json)); ug_array_init (&array, sizeof (int), 0); // JSON begin ug_json_init (&json); // JSON parse ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, &array, (void*)intArrayEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_array_int, &array, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, teststr, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); // JSON end ug_json_final (&json); printf ("array.length = '%d'\n" "array.allocated = '%d'\n\n", array.length, array.allocated); for (index = 0; index < array.length; index++) printf ("array.at[%d] = %d\n", index, array.at[index]); ug_array_clear (&array); } // use UgList to store JSON string and number array void test_json_array_by_list (void) { // method 1 const UgEntry stringListEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, ug_json_parse_list_string, ug_json_write_list_string}, {NULL} }; const UgEntry intListEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, ug_json_parse_list_int, ug_json_write_list_int}, {NULL} }; // common UgJson json; UgList list; UgLink* link; UgJsonError code; UgBuffer buffer; char* jarraystr = "[\"Str1\",\"Str2\",\"Str3\",\"Str4\"]"; char* jarrayint = "[21,32,43,54]"; puts ("\n--- test_json_array_by_list:"); memset (&json, 0, sizeof (json)); ug_list_init (&list); // JSON begin ug_json_init (&json); ug_buffer_init (&buffer, 4096); puts ("\n parse JSON string array:"); // JSON parse - string array ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, &list, (void*)stringListEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_list_string, &list, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, jarraystr, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); printf ("list.size = '%d'\n", (int)list.size); for (link = list.head; link; link = link->next) printf ("link->data = \"%s\"\n", (char*)link->data); // JSON write - string array ug_json_begin_write (&json, 0, &buffer); #if 1 // method 1: use UgEntry to write start of array ug_json_write_entry (&json, &list, (void*)stringListEntry); #else // method 2: call ug_json_write_array_head() to write start of array ug_json_write_array_head (&json); ug_json_write_list_string (&json, &list); ug_json_write_array_tail (&json); #endif ug_json_end_write (&json); puts ("ug_json_write_list_string:"); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); // free strings in list ug_list_foreach (&list, (UgForeachFunc) ug_free, NULL); ug_list_clear (&list, TRUE); puts ("\n parse JSON int array:"); // JSON parse - int array ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, &list, (void*)intListEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_list_int, &list, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, jarrayint, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); printf ("list.size = '%d'\n", (int)list.size); for (link = list.head; link; link = link->next) printf ("link->data = %d\n", (int)(intptr_t)link->data); // JSON write - int array buffer.cur = buffer.beg; ug_json_begin_write (&json, 0, &buffer); #if 1 // method 1: use UgEntry to write start of array ug_json_write_entry (&json, &list, (void*)intListEntry); #else // method 2: call ug_json_write_array_head() to write start of array ug_json_write_array_head (&json); ug_json_write_list_int (&json, &list); ug_json_write_array_tail (&json); #endif ug_json_end_write (&json); puts ("ug_json_write_list_int:"); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); // free list ug_list_clear (&list, TRUE); ug_buffer_clear (&buffer, 1); // JSON end ug_json_final (&json); } // ---------------------------------------------------------------------------- // JSON value sample void test_json_value (void) { UgJson json; int code; #if 0 const char* json_string = "1234"; #elif 0 const char* json_string = "-100"; #elif 0 const char* json_string = "\"This is string.\""; #elif 0 const char* json_string = "\"This is"; // uncompleted string #elif 0 const char* json_string = "true"; #elif 0 const char* json_string = "tr"; // uncompleted true #else const char* json_string = "{"; // uncompleted object #endif puts ("\n--- test_json_value:"); ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // debug ug_json_push (&json, json_debug_parser, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } // ---------------------------------------------------------------------------- // test JSON writer void test_json_writer (void) { UgJson json; UgBuffer buffer; puts ("\n--- test_json_writer:"); ug_json_init (&json); ug_buffer_init (&buffer, 4096); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); // --- object1 begin ug_json_write_object_head (&json); // --- array1 begin ug_json_write_array_head (&json); ug_json_write_array_tail (&json); // --- array1 end // --- object2 begin ug_json_write_object_head (&json); ug_json_write_string (&json, "name1"); // --- array2 begin ug_json_write_array_head (&json); ug_json_write_int (&json, 1205); ug_json_write_int (&json, 2011); ug_json_write_int (&json, 1102); ug_json_write_array_tail (&json); // --- array2 end ug_json_write_string (&json, "name2"); ug_json_write_string (&json, "value2"); ug_json_write_object_tail (&json); // --- object2 end ug_json_write_object_tail (&json); // --- object1 end ug_json_end_write (&json); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); ug_buffer_clear (&buffer, 1); ug_json_final (&json); } // ---------------------------------------------------------------------------- // test UgArray void test_array (void) { UgArrayChar array; char* str = "This one is test string."; puts ("\n--- test_array:"); ug_array_init (&array, sizeof (char), 0); ug_array_append (&array, str, strlen (str)); ug_array_end0 (&array); printf ("\n" "array.at = '%s'\n" "array.length = '%d'\n" "array.allocated = '%d'\n", array.at, array.length, array.allocated); } // ---------------------------------------------------------------------------- // test main function int main (void) { SampleJs* samplejs; // g_mem_set_vtable (glib_mem_profiler_table); // test UgArray test_array (); // test JSON writer test_json_writer (); // test simple JSON value test_json_value (); // use Custom type (WorkedId) to store JSON object test_json_object_custom (); // use UgArray(int) to store JSON number array test_json_int_array (); // use UgList to store JSON string and number array test_json_array_by_list (); puts ("\n--- SampleJs functions:"); // C struct sample code: parse, print, and save file. samplejs = sample_js_new (); sample_js_parse (samplejs); sample_js_print (samplejs); sample_js_to_file (samplejs, "test-SampleJs.json"); sample_js_free (samplejs); samplejs = sample_js_new (); sample_js_reparse (samplejs); sample_js_print (samplejs); sample_js_free (samplejs); // g_mem_profile (); return 0; } uget-2.0.2/tests/test-uget.c0000664000175000017500000002375112520536143012642 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include //#include #include #include #include // ---------------------------------------------------------------------------- // UgetNode UgEntry NodeChildrenEntry[] = { {NULL, 0, UG_ENTRY_ARRAY, (UgJsonParseFunc) ug_json_parse_uget_node_children, (UgJsonWriteFunc) ug_json_write_uget_node_children}, {NULL} }; void init_node (UgetNode* parent) { UgetNode* newone; UgetNode* newtwo; newone = uget_node_new (NULL); newone->type = 1; uget_node_append (parent, newone); newtwo = uget_node_new (NULL); newtwo->type = 2; uget_node_append (parent, newtwo); parent = newtwo; newone = uget_node_new (NULL); newone->type = 3; uget_node_append (parent, newone); newtwo = uget_node_new (NULL); newtwo->type = 4; uget_node_append (parent, newtwo); } // "01-03-02" void dump_int_array (UgArrayInt* array) { int index; for (index = 0; index < array->length; index++) { if (index) printf ("-"); printf ("%.2d", array->at[index]); } puts (""); } void dump_fake_path (UgetNode* node, UgArrayInt* array) { UgetNode* cur; int index; for (index = 0, cur = node->fake; cur; cur = cur->peer, index++) { *(int*) ug_array_alloc(array, 1) = index; dump_int_array (array); dump_fake_path (cur, array); array->length--; } } void print_fake_path (UgetNode* node) { UgArrayInt array; ug_array_init(&array, sizeof (int), 20); dump_fake_path (node, &array); ug_array_clear (&array); } void test_fake_path () { UgetNode* node; UgetNode* fake0; UgetNode* fake1; UgetNode* fake2; node = uget_node_new (NULL); fake0 = uget_node_new (node); fake1 = uget_node_new (node); fake2 = uget_node_new (node); uget_node_new (fake0); uget_node_new (fake1); uget_node_new (fake1); uget_node_new (fake2); uget_node_new (fake2); uget_node_new (fake2); print_fake_path (node); uget_node_unref (node); } void parse_node (UgetNode* parent) { int code; UgJson json; const char* json_string = { "[" " {" " \"name\": null," " \"type\": 1," " \"info\": {" " }," " \"children\": [" " ]" " }," " {" " \"name\": null," " \"type\": 2," " \"info\": {" " }," " \"children\": [" " {" " \"name\": null," " \"type\": 3," " \"info\": {" " }," " \"children\": [" " ]" " }," " {" " \"name\": null," " \"type\": 4," " \"info\": {" " }," " \"children\": [" " ]" " }" " ]" " }" "]" }; ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of array ug_json_push (&json, ug_json_parse_entry, parent, NodeChildrenEntry); #else // method 2: push ug_json_parse_array() to parse start of array ug_json_push (&json, ug_json_parse_uget_node_children, parent, NULL); ug_json_push (&json, ug_json_parse_array, NULL, NULL); #endif code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } // UgBufferFunc static int buffer_to_file (UgBuffer* buffer) { FILE* file = buffer->data; printf ("write %d bytes to file\n", ug_buffer_length (buffer)); fwrite (buffer->beg, 1, ug_buffer_length(buffer), file); buffer->cur = buffer->beg; return 0; } void write_node_to_file (UgetNode* node, char* filename) { UgBuffer buffer; UgJson json; FILE* file; file = fopen (filename, "w"); ug_buffer_init (&buffer, 128); buffer.more = buffer_to_file; buffer.data = file; ug_json_init (&json); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, node, NodeChildrenEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_array_head (&json); ug_json_write_uget_node_children (&json, node); ug_json_write_array_tail (&json); #endif ug_json_end_write (&json); ug_json_final (&json); ug_buffer_clear (&buffer, 1); fclose (file); } void test_uget_node () { UgetNode* root; root = uget_node_new (NULL); #if 0 init_node (root); #else parse_node (root); #endif write_node_to_file (root, "test-UgetNode.json"); } // ---------------------------------------------------------------------------- // UgetA2cf void print_bitfield (uint8_t* bytes, int length) { int count; int index; int temp; for (index = 0; index < length; index++) { for (count = 0; count < 8; count++) { temp = (bytes[0] << count) & 0x80; if (temp) printf ("1"); else printf ("0"); } printf ("\n"); bytes++; } } void print_a2cf (UgetA2cf* a2cf) { UgetA2cfPiece* piece; if (a2cf == NULL) return; printf ("ver : %d\n", (int)a2cf->ver); printf ("ext : %d\n", (int)a2cf->ext); printf ("info_hash_len : %d\n", (int)a2cf->info_hash_len); printf ("piece_len : %d\n", (int)a2cf->piece_len); printf ("total_len : %d\n", (int)a2cf->total_len); printf ("upload_len : %d\n", (int)a2cf->upload_len); printf ("bitfield_len : %d\n", (int)a2cf->bitfield_len); if (a2cf->bitfield_len) { printf ("bitfield:\n"); print_bitfield (a2cf->bitfield, a2cf->bitfield_len); } printf ("n_pieces : %d\n", (int)a2cf->piece.list.size); for (piece = (void*)a2cf->piece.list.head; piece; piece = piece->next) { printf ("index : %d\n", (int)piece->index); printf ("length : %d\n", (int)piece->length); printf ("bitfield_length : %d\n", (int)piece->bitfield_len); printf ("bitfield:\n"); print_bitfield (piece->bitfield, piece->bitfield_len); } } void test_uget_a2cf (void) { UgetA2cf a2cf; const char* fname; uint64_t beg, end; memset (&a2cf, 0, sizeof (UgetA2cf)); fname = "D:\\Downloads\\TestData-Aria2\\npp.6.4.2.Installer.exe.aria2-1"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\npp.6.4.2.Installer.exe.aria2-2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); // fill beg = 3145728 + 16384 * 2; end = 5242880 + 16384 * 4 + 1; // beg = 7340032; // + 16384 * 2; // end = 7401344; printf ("fill %d - %d\n", (int)beg, (int)end); printf ("fill result %d\n", (int)uget_a2cf_fill (&a2cf, beg, end)); // lack beg = 0; // beg = 3145728 - 16384 * 2; // beg = 5242880; // beg = 7340032; // beg = 7401344; if (uget_a2cf_lack (&a2cf, &beg, &end)) printf ("lack %d - %d\n", (int)beg, (int)end); print_a2cf (&a2cf); // completed printf ("completed: %u\n", (unsigned)uget_a2cf_completed (&a2cf)); // clear uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\npp.6.4.3.Installer.exe.aria2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); // lack beg = 0; uget_a2cf_lack (&a2cf, &beg, &end); printf ("lack %d - %d\n", (int)beg, (int)end); uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\ubuntu-13.04-desktop-amd64.iso.aria2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); uget_a2cf_clear (&a2cf); fname = "D:\\Downloads\\TestData-Aria2\\eclipse-cpp-kepler-R-win32.zip.aria2"; printf ("%s\n", fname); uget_a2cf_load (&a2cf, fname); print_a2cf (&a2cf); uget_a2cf_clear (&a2cf); } // ---------------------------------------------------------------------------- // UgetCurl void test_uget_curl (void) { UgetCurl* ugcurl; ugcurl = uget_curl_new (); uget_curl_set_url (ugcurl, "http://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe"); uget_curl_open_file (ugcurl, NULL); ugcurl->header_store = TRUE; uget_curl_run (ugcurl, TRUE); ug_thread_join (&ugcurl->thread); uget_curl_free (ugcurl); } // ---------------------------------------------------------------------------- // UgetRss void test_uget_rss (void) { UgetRss* urss; UgetRssFeed* feed; UgetRssItem* item = NULL; urss = uget_rss_new (); uget_rss_add_builtin (urss, UGET_RSS_STABLE); uget_rss_update (urss, TRUE); ug_thread_join (&urss->thread); feed = uget_rss_find_updated (urss, NULL); if (feed) item = uget_rss_feed_find (feed, -1); if (item) printf ("title %s\n", item->title); uget_rss_unref (urss); } // ---------------------------------------------------------------------------- // main int main (void) { // test_uget_node (); // test_fake_path (); // test_uget_a2cf (); // test_uget_curl (); test_uget_rss (); return 0; } uget-2.0.2/tests/test-jsonrpc.c0000664000175000017500000003015612477443373013366 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #include #include #if defined _WIN32 || defined _WIN64 #include #else #include // sleep() #endif #if defined _WIN32 || defined _WIN64 #define ug_sleep Sleep #else #define ug_sleep(millisecond) usleep (millisecond * 1000) #endif static void socket_receiver (UgSocketServer* server, SOCKET client_fd, void* data) { char buf[5]; ug_socket_server_ref (server); // ug_socket_recv (client_fd, buf, 5, 0); recv (client_fd, buf, 5, 0); puts ("socket server: get ping"); // ug_socket_send (client_fd, "pong", 4, 0); send (client_fd, "pong", 4, 0); // ug_socket_close (client_fd); closesocket (client_fd); ug_socket_server_unref (server); } void test_socket_server_client (SOCKET server_fd, SOCKET client_fd) { UgSocketServer* server; char buf[5]; server = ug_socket_server_new (server_fd); ug_socket_server_set_receiver (server, socket_receiver, NULL); ug_socket_server_start (server); // --- client begin --- // ug_socket_send (client_fd, "ping", 4, 0); send (client_fd, "ping", 4, 0); // ug_socket_recv (client_fd, buf, 5, 0); recv (client_fd, buf, 5, 0); puts ("socket client: get pong"); // ug_socket_close (client_fd); // close (client_fd); closesocket (client_fd); // --- client end --- ug_socket_server_stop (server); ug_socket_server_unref (server); } void test_socket (void) { SOCKET server_fd; SOCKET client_fd; puts ("------------------"); // server_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); server_fd = socket (AF_INET, SOCK_STREAM, 0); ug_socket_listen (server_fd, "127.0.0.1", "8088", 5); // client_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); client_fd = socket (AF_INET, SOCK_STREAM, 0); ug_socket_connect (client_fd, "127.0.0.1", "8088"); test_socket_server_client (server_fd, client_fd); ug_sleep (1000); #if !(defined _WIN32 || defined _WIN64) puts ("------------------"); // server_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); server_fd = socket (AF_UNIX, SOCK_STREAM, 0); ug_socket_listen_unix (server_fd, "/tmp/test-socket-unix", -1, 5); // client_fd = ug_socket_new (AF_INET, SOCK_STREAM, 0); client_fd = socket (AF_UNIX, SOCK_STREAM, 0); ug_socket_connect_unix (client_fd, "/tmp/test-socket-unix", -1); test_socket_server_client (server_fd, client_fd); ug_sleep (1000); #endif } // ---------------------------------------------------------------------------- // test parser & writer void parse_rpc_object (UgJsonrpcObject* jobj, const char* json_string) { UgJson json; int code; ug_json_init (&json); ug_json_begin_parse (&json); ug_json_push (&json, ug_json_parse_entry, jobj, (void*)UgJsonrpcObjectEntry); ug_json_push (&json, ug_json_parse_object, NULL, NULL); code = ug_json_parse (&json, json_string, -1); printf ("ug_json_parse response %d\n", code); code = ug_json_end_parse (&json); printf ("ug_json_end_parse response %d\n", code); ug_json_final (&json); } void print_rpc_object (UgJsonrpcObject* jobj) { UgJson json; UgBuffer buffer; ug_json_init (&json); ug_buffer_init (&buffer, 4096); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); // ug_json_write_entry (&json, req, requestEntry); ug_json_write_rpc_object (&json, jobj); ug_json_end_write (&json); ug_json_final (&json); ug_buffer_write_char (&buffer, '\0'); puts (buffer.beg); } void test_rpc_parser (void) { UgJsonrpcArray* jarray; UgJsonrpcObject* jobj; const char* json_string1 = // "{\"jsonrpc\": \"2.0\", \"method\": \"update\", \"params\": [1,2,3,4,5], \"id\":1}"; "{\"jsonrpc\": \"2.0\", \"method\": \"foobar\", \"id\":2}"; const char* json_string2 = "{\"jsonrpc\": \"2.0\", \"error\": {\"code\": -32601, \"message\": \"Method not found.\"}, \"id\": 1}"; // "{\"jsonrpc\": \"2.0\", \"result\": 19, \"id\":1}"; const char* json_string3 = "{\"id\":2,\"jsonrpc\":\"2.0\",\"result\":\"fc585c5fec7319bf\"}"; puts ("----- test_rpc_parser()"); jarray = malloc (sizeof (UgJsonrpcArray)); ug_jsonrpc_array_init (jarray, 8); jobj = ug_jsonrpc_array_alloc (jarray); parse_rpc_object (jobj, json_string1); print_rpc_object (jobj); jobj = ug_jsonrpc_array_alloc (jarray); parse_rpc_object (jobj, json_string2); print_rpc_object (jobj); jobj = ug_jsonrpc_array_alloc (jarray); parse_rpc_object (jobj, json_string3); print_rpc_object (jobj); ug_jsonrpc_array_clear (jarray, 1); free (jarray); } void test_rpc_curl_packet (UgJsonrpcCurl* jrcurl) { int error; UgJsonrpcObject* request; UgJsonrpcObject* response; const char* json_string = "{" "\"jsonrpc\": \"2.0\"," "\"method\": \"aria2.addUri\"," "\"params\": [[\"http:\\/\\/localhost\\/file\"], {}]," "\"id\":2" "}"; request = ug_jsonrpc_object_new (); response = ug_jsonrpc_object_new (); parse_rpc_object (request, json_string); print_rpc_object (request); error = ug_jsonrpc_call (&jrcurl->rpc, request, response); if (error == 0) print_rpc_object (response); ug_jsonrpc_object_free (request); ug_jsonrpc_object_free (response); } void test_jsonrpc_curl (void) { // UgJsonrpcHttp* jrhttp; UgJsonrpcCurl* jrcurl; UgJsonrpcArray* jarray; puts ("----- test_jsonrpc_curl()"); // jrhttp = malloc (sizeof (UgJsonrpcHttp)); // ug_jsonrpc_http_init (jrhttp); jrcurl = malloc (sizeof (UgJsonrpcCurl)); ug_jsonrpc_curl_init (jrcurl); jarray = malloc (sizeof (UgJsonrpcArray)); ug_jsonrpc_array_init (jarray, 8); // ug_jsonrpc_http_set_client (jrhttp, "http://localhost:6800/jsonrpc"); // test_rpc_http_packet (jrhttp); ug_jsonrpc_curl_set_url (jrcurl, "http://localhost:6800/jsonrpc"); // test_rpc_curl_packet (jrcurl); // ug_jsonrpc_http_final (jrhttp); // free (jrhttp); ug_jsonrpc_curl_final (jrcurl); free (jrcurl); ug_jsonrpc_array_clear (jarray, 1); free (jarray); } // ---------------------------------------------------------------------------- // test UgJsonrpcSocket static void jsonrpc_accepted (UgJsonrpc* jrpc, void* data, void* data2) { UgJsonrpcObject* request; UgJsonrpcObject* response; int result; request = ug_jsonrpc_object_new (); response = ug_jsonrpc_object_new (); response->result.type = UG_VALUE_STRING; response->result.c.string = "pong"; do { result = ug_jsonrpc_receive (jrpc, request, NULL); if (result == UG_JSON_OBJECT) { print_rpc_object (request); response->id.type = request->id.type; response->id.c = request->id.c; ug_jsonrpc_response (jrpc, response); ug_jsonrpc_object_clear (request); } } while (result != 0); response->id.type = UG_JSON_NULL; response->result.c.string = NULL; ug_jsonrpc_object_free (response); ug_jsonrpc_object_free (request); puts ("server: client connection closed."); } void test_jsonrpc_socket (void) { UgJsonrpcObject* request; UgJsonrpcObject* response; UgJsonrpcSocket* jclient; UgSocketServer* server; #if 0 UgJsonrpcSocket* jserver; #endif puts ("----- test_jsonrpc_socket()"); server = ug_socket_server_new_addr ("127.0.0.1", "14777"); if (server == NULL) { puts ("failed to create UgJsonrpcSocketServer"); return; } #if 0 jserver = ug_malloc (sizeof (UgJsonrpcSocket)); ug_jsonrpc_socket_init (jserver); ug_jsonrpc_socket_use_server (jserver, server, jsonrpc_accepted, NULL, NULL); ug_socket_server_start (server); #else ug_socket_server_run_jsonrpc (server, jsonrpc_accepted, NULL, NULL); #endif ug_sleep (1000); jclient = ug_malloc (sizeof (UgJsonrpcSocket)); ug_jsonrpc_socket_init (jclient); ug_jsonrpc_socket_connect (jclient, "127.0.0.1", "14777"); // ping server request = ug_jsonrpc_object_new (); response = ug_jsonrpc_object_new (); request->method_static = "ping"; ug_jsonrpc_call (&jclient->rpc, request, response); print_rpc_object (response); ug_jsonrpc_object_free (response); ug_jsonrpc_object_free (request); ug_jsonrpc_socket_close (jclient); ug_jsonrpc_socket_final (jclient); ug_free (jclient); ug_sleep (1000); #if 0 ug_jsonrpc_socket_final(jserver); #endif ug_socket_server_stop (server); ug_socket_server_unref (server); } // ---------------------------------------------------------------------------- // test_uget_aria2 void test_uget_aria2_rpc_object (UgetAria2* uaria2) { UgValue* value; UgValue* vobj; UgJsonrpcObject* req1; UgJsonrpcObject* res1; UgJsonrpcObject* req2; UgJsonrpcObject* res2; // request 1 req1 = uget_aria2_alloc (uaria2, TRUE, TRUE); req1->method_static = "aria2.getGlobalStat"; uget_aria2_request (uaria2, req1); // request 2 req2 = uget_aria2_alloc (uaria2, TRUE, TRUE); req2->method_static = "aria2.changeGlobalOption"; ug_value_init_array (&req2->params, 2); vobj = ug_value_alloc (&req2->params, 1); ug_value_init_object (vobj, 2); value = ug_value_alloc (vobj, 1); value->name = "max-overall-download-limit"; value->type = UG_VALUE_STRING; value->c.string = "100k"; value = ug_value_alloc (vobj, 1); value->name = "max-overall-upload-limit"; value->type = UG_VALUE_STRING; value->c.string = "100k"; uget_aria2_request (uaria2, req2); // response 1 res1 = uget_aria2_respond (uaria2, req1); if (res1) { print_rpc_object (res1); ug_value_sort_name (&res1->result); value = ug_value_find_name (&res1->result, "downloadSpeed"); printf ("current downloadSpeed %d\n", ug_value_get_int (value)); } // recycle 1 uget_aria2_recycle (uaria2, req1); uget_aria2_recycle (uaria2, res1); // response 2 res2 = uget_aria2_respond (uaria2, req2); if (res2) { print_rpc_object (res2); } // recycle 2 ug_value_foreach (&req2->params, ug_value_set_name_string, NULL); uget_aria2_recycle (uaria2, req2); uget_aria2_recycle (uaria2, res2); } void test_uget_aria2 (void) { UgetAria2* uaria2; puts ("----- test_uget_aria2()"); uaria2 = uget_aria2_new (); uget_aria2_start_thread (uaria2); #if defined _WIN32 || defined _WIN64 uget_aria2_set_path (uaria2, "C:\\Program Files\\uGet\\bin\\aria2c.exe"); #endif uget_aria2_launch (uaria2); uaria2->shutdown = TRUE; test_uget_aria2_rpc_object (uaria2); // uget_aria2_shutdown (uaria2); uget_aria2_stop_thread (uaria2); uget_aria2_unref (uaria2); ug_sleep (2000); } // ---------------------------------------------------------------------------- // main int main (void) { #if defined _WIN32 || defined _WIN64 WSADATA WSAData; WSAStartup (MAKEWORD (2, 2), &WSAData); #endif // _WIN32 || _WIN64 // libcurl curl_global_init (CURL_GLOBAL_ALL); test_socket (); test_rpc_parser (); test_jsonrpc_socket (); test_jsonrpc_curl (); test_uget_aria2 (); // libcurl curl_global_cleanup (); #if defined _WIN32 || defined _WIN64 WSACleanup (); #endif return 0; } uget-2.0.2/tests/test-info.c0000664000175000017500000001532712456470652012643 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include // ---------------------------------------------------------------------------- // Test1 typedef struct { UG_DATA_MEMBERS; // const UgDataInfo* info; int type; } Test1; const UgEntry Test1Entry[] = { {"type", offsetof (Test1, type), UG_ENTRY_INT, NULL, NULL}, {NULL} }; void test1_init (Test1* t1); const UgDataInfo Test1Info = { "Test1", sizeof (Test1), Test1Entry, // UgEntry (UgInitFunc) test1_init, (UgFinalFunc) NULL, (UgAssignFunc) NULL }; void test1_init (Test1* t1) { t1->info = &Test1Info; t1->type = 1; } // ---------------------------------------------------------------------------- // Test2 typedef struct { UG_DATA_MEMBERS; // const UgDataInfo* info; int type; } Test2; const UgEntry Test2Entry[] = { {"type", offsetof (Test2, type), UG_ENTRY_INT, NULL, NULL}, {NULL} }; void test2_init (Test2* t2); const UgDataInfo Test2Info = { "Test2", sizeof (Test2), Test2Entry, // UgEntry (UgInitFunc) test2_init, (UgFinalFunc) NULL, (UgAssignFunc) NULL }; void test2_init (Test2* t2) { t2->info = &Test2Info; t2->type = 2; } // ---------------------------------------------------------------------------- // Test3 typedef struct { UG_DATA_MEMBERS; // const UgDataInfo* info; int type; } Test3; const UgEntry Test3Entry[] = { {"type", offsetof (Test3, type), UG_ENTRY_INT, NULL, NULL}, {NULL} }; void test3_init (Test3* t3); const UgDataInfo Test3Info = { "Test3", sizeof (Test3), Test3Entry, // UgEntry (UgInitFunc) test3_init, (UgFinalFunc) NULL, (UgAssignFunc) NULL }; void test3_init (Test3* t3) { t3->info = &Test3Info; t3->type = 3; } // ---------------------------------------------------------------------------- // test UgInfo UgEntry InfoCustomEntry[] = { {NULL, 0, UG_ENTRY_CUSTOM, (UgJsonParseFunc) ug_json_parse_info, (UgJsonWriteFunc) ug_json_write_info}, {NULL} }; void test_info (UgInfo* info) { void* data; puts ("\n--- test_info:"); data = ug_info_realloc (info, &Test2Info); printf ("ug_info_realloc (Test2Info) : %d\n", ((Test2*)data)->type); data = ug_info_realloc (info, &Test1Info); printf ("ug_info_realloc (Test1Info) : %d\n", ((Test1*)data)->type); data = ug_info_realloc (info, &Test3Info); printf ("ug_info_realloc (Test3Info) : %d\n", ((Test3*)data)->type); } void parse_info (UgInfo* info) { int code; UgJson json; UgRegistry registry; const char* json_string = { "{" " \"Test1\": {" " \"type\": 1" " }," " \"Test2\": {" " \"type\": 2" " }," " \"Test3\": {" " \"type\": 3" " }" "}" }; // UgRegistry is used by ug_json_parse_info() and ug_json_parse_info_entry() ug_registry_init (®istry); ug_registry_add (®istry, &Test2Info); ug_registry_add (®istry, &Test3Info); ug_registry_add (®istry, &Test1Info); // ug_registry_sort (®istry); // ug_json_parse_info() must use default UgInfoKeys. ug_info_set_registry (®istry); ug_json_init (&json); ug_json_begin_parse (&json); #if 1 // method 1: use UgEntry to parse start of object ug_json_push (&json, ug_json_parse_entry, info, InfoCustomEntry); #else // method 2: push ug_json_parse_info() to parse start of object ug_json_push (&json, ug_json_parse_info, info, ®istry); #endif code = ug_json_parse (&json, json_string, -1); ug_json_end_parse (&json); ug_json_final (&json); printf ("ug_json_parse response %d\n", code); ug_info_set_registry (NULL); ug_registry_final (®istry); } void dump_info (UgInfo* info) { UgPair* cur; UgPair* end; for (cur = info->at, end = info->at + info->length; cur < end; cur++) { if (cur->key == NULL) { puts ("NULL"); continue; } printf ("%s", ((UgDataInfo*)cur->key)->name); if (cur->data) printf (" : %d", ((Test1*)cur->data)->type); puts (""); } } // UgBufferFunc static int buffer_to_file (UgBuffer* buffer) { FILE* file = buffer->data; printf ("write %d bytes to file\n", ug_buffer_length (buffer)); fwrite (buffer->beg, 1, ug_buffer_length(buffer), file); buffer->cur = buffer->beg; return 0; } void write_info_to_file (UgInfo* info, char* filename) { UgJson json; FILE* file; UgBuffer buffer; file = fopen (filename, "w"); ug_buffer_init (&buffer, 128); buffer.more = buffer_to_file; buffer.data = file; ug_json_init (&json); ug_json_begin_write (&json, UG_JSON_FORMAT_INDENT, &buffer); #if 1 // method 1: use UgEntry to write start of object ug_json_write_entry (&json, info, InfoCustomEntry); #else // method 2: call ug_json_write_object_head() to write start of object ug_json_write_object_head (&json); ug_json_write_info (&json, info); ug_json_write_object_tail (&json); #endif ug_json_end_write (&json); ug_json_final (&json); ug_buffer_clear (&buffer, 1); fclose (file); } // ---------------------------------------------------------------------------- // main int main (void) { UgInfo info; puts ("\n--- test UgInfo functions:"); ug_info_init (&info, 8, 2); #if 0 test_info (&info); #else parse_info (&info); #endif dump_info (&info); write_info_to_file (&info, "test-info.json"); ug_info_final (&info); return 0; } uget-2.0.2/tests/Makefile.in0000664000175000017500000004502212574542540012624 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : noinst_PROGRAMS = test-json$(EXEEXT) test-jsonrpc$(EXEEXT) \ test-plugin+app$(EXEEXT) test-info$(EXEEXT) \ test-uglib$(EXEEXT) test-uget$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_test_info_OBJECTS = test-info.$(OBJEXT) test_info_OBJECTS = $(am_test_info_OBJECTS) am__DEPENDENCIES_1 = test_info_DEPENDENCIES = $(top_builddir)/uglib/libuglib.a \ $(am__DEPENDENCIES_1) am_test_json_OBJECTS = test-json.$(OBJEXT) test_json_OBJECTS = $(am_test_json_OBJECTS) test_json_DEPENDENCIES = $(top_builddir)/uglib/libuglib.a \ $(am__DEPENDENCIES_1) am_test_jsonrpc_OBJECTS = test-jsonrpc.$(OBJEXT) test_jsonrpc_OBJECTS = $(am_test_jsonrpc_OBJECTS) test_jsonrpc_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a $(am__DEPENDENCIES_1) am_test_plugin_app_OBJECTS = test-plugin+app.$(OBJEXT) test_plugin_app_OBJECTS = $(am_test_plugin_app_OBJECTS) test_plugin_app_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a $(am__DEPENDENCIES_1) am_test_uget_OBJECTS = test-uget.$(OBJEXT) test_uget_OBJECTS = $(am_test_uget_OBJECTS) test_uget_DEPENDENCIES = $(top_builddir)/uget/libuget.a \ $(top_builddir)/uglib/libuglib.a $(am__DEPENDENCIES_1) am_test_uglib_OBJECTS = test-uglib.$(OBJEXT) test_uglib_OBJECTS = $(am_test_uglib_OBJECTS) test_uglib_DEPENDENCIES = $(top_builddir)/uglib/libuglib.a \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(test_info_SOURCES) $(test_json_SOURCES) \ $(test_jsonrpc_SOURCES) $(test_plugin_app_SOURCES) \ $(test_uget_SOURCES) $(test_uglib_SOURCES) DIST_SOURCES = $(test_info_SOURCES) $(test_json_SOURCES) \ $(test_jsonrpc_SOURCES) $(test_plugin_app_SOURCES) \ $(test_uget_SOURCES) $(test_uglib_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # test-uglib-cxx test-uget-cxx TESTS_LIBS = @PTHREAD_LIBS@ @CURL_LIBS@ @GLIB_LIBS@ # set the include path found by configure AM_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget AM_CFLAGS = @PTHREAD_CFLAGS@ @LFS_CFLAGS@ @CURL_CFLAGS@ @GLIB_CFLAGS@ AM_LDFLAGS = @LFS_LDFLAGS@ # test_json_CPPFLAGS = -I$(top_srcdir)/uglib test_json_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_json_SOURCES = test-json.c # test_jsonrpc_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_jsonrpc_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_jsonrpc_SOURCES = test-jsonrpc.c # test_plugin_app_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_plugin_app_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_plugin_app_SOURCES = test-plugin+app.c # test_info_CPPFLAGS = -I$(top_srcdir)/uglib test_info_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_info_SOURCES = test-info.c # test_uglib_CPPFLAGS = -I$(top_srcdir)/uglib test_uglib_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uglib_SOURCES = test-uglib.c # test_uget_CPPFLAGS = -I$(top_srcdir)/uglib -I$(top_srcdir)/uget test_uget_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) test_uget_SOURCES = test-uget.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) test-info$(EXEEXT): $(test_info_OBJECTS) $(test_info_DEPENDENCIES) $(EXTRA_test_info_DEPENDENCIES) @rm -f test-info$(EXEEXT) $(LINK) $(test_info_OBJECTS) $(test_info_LDADD) $(LIBS) test-json$(EXEEXT): $(test_json_OBJECTS) $(test_json_DEPENDENCIES) $(EXTRA_test_json_DEPENDENCIES) @rm -f test-json$(EXEEXT) $(LINK) $(test_json_OBJECTS) $(test_json_LDADD) $(LIBS) test-jsonrpc$(EXEEXT): $(test_jsonrpc_OBJECTS) $(test_jsonrpc_DEPENDENCIES) $(EXTRA_test_jsonrpc_DEPENDENCIES) @rm -f test-jsonrpc$(EXEEXT) $(LINK) $(test_jsonrpc_OBJECTS) $(test_jsonrpc_LDADD) $(LIBS) test-plugin+app$(EXEEXT): $(test_plugin_app_OBJECTS) $(test_plugin_app_DEPENDENCIES) $(EXTRA_test_plugin_app_DEPENDENCIES) @rm -f test-plugin+app$(EXEEXT) $(LINK) $(test_plugin_app_OBJECTS) $(test_plugin_app_LDADD) $(LIBS) test-uget$(EXEEXT): $(test_uget_OBJECTS) $(test_uget_DEPENDENCIES) $(EXTRA_test_uget_DEPENDENCIES) @rm -f test-uget$(EXEEXT) $(LINK) $(test_uget_OBJECTS) $(test_uget_LDADD) $(LIBS) test-uglib$(EXEEXT): $(test_uglib_OBJECTS) $(test_uglib_DEPENDENCIES) $(EXTRA_test_uglib_DEPENDENCIES) @rm -f test-uglib$(EXEEXT) $(LINK) $(test_uglib_OBJECTS) $(test_uglib_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-json.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-jsonrpc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-plugin+app.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uglib.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am #test_uglib_cxx_CPPFLAGS = -I$(top_srcdir)/uglib #test_uglib_cxx_CXXFLAGS = -std=c++11 #test_uglib_cxx_LDADD = $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uglib_cxx_SOURCES = test-uglib-cxx.cxx #test_uget_cxx_CXXFLAGS = -std=c++11 #test_uget_cxx_LDADD = $(top_builddir)/uget/libuget.a $(top_builddir)/uglib/libuglib.a $(TESTS_LIBS) #test_uget_cxx_SOURCES = test-uget-cxx.cxx # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: uget-2.0.2/missing0000755000175000017500000002415211736361705011014 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: uget-2.0.2/compile0000755000175000017500000001533711736361705011000 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-01-04.17; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free # Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l*) lib=${1#-l} found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes set x "$@" "$dir/$lib.dll.lib" break fi if test -f "$dir/$lib.lib"; then found=yes set x "$@" "$dir/$lib.lib" break fi done IFS=$save_IFS test "$found" != yes && set x "$@" "$lib.lib" shift ;; -L*) func_file_conv "${1#-L}" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: uget-2.0.2/config.h.in0000664000175000017500000000521712574542561011445 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* Have AppIndicator */ #undef HAVE_APP_INDICATOR /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if glib support is required. */ #undef HAVE_GLIB /* Define to 1 if gstreamer support is required. */ #undef HAVE_GSTREAMER /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if libnotify support is required. */ #undef HAVE_LIBNOTIFY /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if libpwmd support is required. */ #undef HAVE_LIBPWMD /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define the location where the catalogs will be installed */ #undef LOCALEDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if gnutls support is required. */ #undef USE_GNUTLS /* Define to 1 if openssl support is required. */ #undef USE_OPENSSL /* Version number of package */ #undef VERSION uget-2.0.2/Makefile.am0000664000175000017500000000041512321735067011444 00000000000000# intltool : add "po" in SUBDIRS SUBDIRS = \ uglib \ uget \ ui-gtk \ ui-gtk-1to2 \ pixmaps \ sounds \ tests \ po \ doc \ Windows EXTRA_DIST = uget-gtk.desktop appsdir = $(datadir)/applications apps_DATA = uget-gtk.desktop uget-2.0.2/Windows/0000775000175000017500000000000012574544100011116 500000000000000uget-2.0.2/Windows/msvc/0000775000175000017500000000000012574544100012066 500000000000000uget-2.0.2/Windows/msvc/uget.vcxproj0000664000175000017500000001372112477443373014407 00000000000000 Debug Win32 Release Win32 {A98D36E8-7119-4AC4-8820-65B902C6B69E} uget Win32Proj StaticLibrary Unicode true StaticLibrary Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ Disabled ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\include;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_LIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\include;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_LIB;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase uget-2.0.2/Windows/msvc/uget.sln0000664000175000017500000001151312330142543013464 00000000000000 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C++ Express 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uglib", "uglib.vcxproj", "{8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-json", "test-json.vcxproj", "{D0C49F36-9ECC-4B87-9360-A7EE570DA73C}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uget", "uget.vcxproj", "{A98D36E8-7119-4AC4-8820-65B902C6B69E}" ProjectSection(ProjectDependencies) = postProject {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} = {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-plugin+app", "test-plugin+app.vcxproj", "{CAD0E048-8211-4F6B-9975-215A526AC645}" ProjectSection(ProjectDependencies) = postProject {A98D36E8-7119-4AC4-8820-65B902C6B69E} = {A98D36E8-7119-4AC4-8820-65B902C6B69E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui-gtk", "ui-gtk.vcxproj", "{9D164547-3F37-4C14-BCCE-91EB2F3DC317}" ProjectSection(ProjectDependencies) = postProject {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} = {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} {A98D36E8-7119-4AC4-8820-65B902C6B69E} = {A98D36E8-7119-4AC4-8820-65B902C6B69E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-jsonrpc", "test-jsonrpc.vcxproj", "{BE2BF360-69F6-406F-A89D-77B0F9A92C04}" ProjectSection(ProjectDependencies) = postProject {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} = {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} {A98D36E8-7119-4AC4-8820-65B902C6B69E} = {A98D36E8-7119-4AC4-8820-65B902C6B69E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-uglib", "test-uglib.vcxproj", "{A5591A27-B27A-4FF2-88E6-E6C534C96E02}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-uget", "test-uget.vcxproj", "{FFAC27EA-E43A-4A78-924D-41E868A4F27F}" ProjectSection(ProjectDependencies) = postProject {A98D36E8-7119-4AC4-8820-65B902C6B69E} = {A98D36E8-7119-4AC4-8820-65B902C6B69E} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA}.Debug|Win32.ActiveCfg = Debug|Win32 {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA}.Debug|Win32.Build.0 = Debug|Win32 {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA}.Release|Win32.ActiveCfg = Release|Win32 {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA}.Release|Win32.Build.0 = Release|Win32 {D0C49F36-9ECC-4B87-9360-A7EE570DA73C}.Debug|Win32.ActiveCfg = Debug|Win32 {D0C49F36-9ECC-4B87-9360-A7EE570DA73C}.Debug|Win32.Build.0 = Debug|Win32 {D0C49F36-9ECC-4B87-9360-A7EE570DA73C}.Release|Win32.ActiveCfg = Release|Win32 {D0C49F36-9ECC-4B87-9360-A7EE570DA73C}.Release|Win32.Build.0 = Release|Win32 {A98D36E8-7119-4AC4-8820-65B902C6B69E}.Debug|Win32.ActiveCfg = Debug|Win32 {A98D36E8-7119-4AC4-8820-65B902C6B69E}.Debug|Win32.Build.0 = Debug|Win32 {A98D36E8-7119-4AC4-8820-65B902C6B69E}.Release|Win32.ActiveCfg = Release|Win32 {A98D36E8-7119-4AC4-8820-65B902C6B69E}.Release|Win32.Build.0 = Release|Win32 {CAD0E048-8211-4F6B-9975-215A526AC645}.Debug|Win32.ActiveCfg = Debug|Win32 {CAD0E048-8211-4F6B-9975-215A526AC645}.Debug|Win32.Build.0 = Debug|Win32 {CAD0E048-8211-4F6B-9975-215A526AC645}.Release|Win32.ActiveCfg = Release|Win32 {CAD0E048-8211-4F6B-9975-215A526AC645}.Release|Win32.Build.0 = Release|Win32 {9D164547-3F37-4C14-BCCE-91EB2F3DC317}.Debug|Win32.ActiveCfg = Debug|Win32 {9D164547-3F37-4C14-BCCE-91EB2F3DC317}.Debug|Win32.Build.0 = Debug|Win32 {9D164547-3F37-4C14-BCCE-91EB2F3DC317}.Release|Win32.ActiveCfg = Release|Win32 {9D164547-3F37-4C14-BCCE-91EB2F3DC317}.Release|Win32.Build.0 = Release|Win32 {BE2BF360-69F6-406F-A89D-77B0F9A92C04}.Debug|Win32.ActiveCfg = Debug|Win32 {BE2BF360-69F6-406F-A89D-77B0F9A92C04}.Debug|Win32.Build.0 = Debug|Win32 {BE2BF360-69F6-406F-A89D-77B0F9A92C04}.Release|Win32.ActiveCfg = Release|Win32 {BE2BF360-69F6-406F-A89D-77B0F9A92C04}.Release|Win32.Build.0 = Release|Win32 {A5591A27-B27A-4FF2-88E6-E6C534C96E02}.Debug|Win32.ActiveCfg = Debug|Win32 {A5591A27-B27A-4FF2-88E6-E6C534C96E02}.Debug|Win32.Build.0 = Debug|Win32 {A5591A27-B27A-4FF2-88E6-E6C534C96E02}.Release|Win32.ActiveCfg = Release|Win32 {A5591A27-B27A-4FF2-88E6-E6C534C96E02}.Release|Win32.Build.0 = Release|Win32 {FFAC27EA-E43A-4A78-924D-41E868A4F27F}.Debug|Win32.ActiveCfg = Debug|Win32 {FFAC27EA-E43A-4A78-924D-41E868A4F27F}.Debug|Win32.Build.0 = Debug|Win32 {FFAC27EA-E43A-4A78-924D-41E868A4F27F}.Release|Win32.ActiveCfg = Release|Win32 {FFAC27EA-E43A-4A78-924D-41E868A4F27F}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal uget-2.0.2/Windows/msvc/test-uget.vcxproj0000664000175000017500000001362512330142543015346 00000000000000 Debug Win32 Release Win32 {FFAC27EA-E43A-4A78-924D-41E868A4F27F} testuget Win32Proj Application Unicode true Application Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ true $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ false Disabled ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue uglib.lib;uget.lib;Ws2_32.lib;curllib.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) D:\devpack\curl-msvc\lib\Debug;D:\devpack\gtk3\lib;Debug;%(AdditionalLibraryDirectories) true Console MachineX86 MaxSpeed true ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase uglib.lib;uget.lib;Ws2_32.lib;curllib.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) D:\devpack\curl-msvc\lib\Release;D:\devpack\gtk3\lib;Release;%(AdditionalLibraryDirectories) true Console true true MachineX86 {8e8a46b4-6b62-4bd0-bcaf-ba9cf1090dea} false uget-2.0.2/Windows/msvc/test-uglib.vcxproj0000664000175000017500000001326612316717714015521 00000000000000 Debug Win32 Release Win32 {A5591A27-B27A-4FF2-88E6-E6C534C96E02} testuglib Win32Proj Application Unicode true Application Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ true $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ false Disabled ..\..\uglib;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue uglib.lib;glib-2.0.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;Debug;%(AdditionalLibraryDirectories) true Console MachineX86 MaxSpeed true ..\..\uglib;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase uglib.lib;glib-2.0.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;Release;%(AdditionalLibraryDirectories) true Console true true MachineX86 {8e8a46b4-6b62-4bd0-bcaf-ba9cf1090dea} false uget-2.0.2/Windows/msvc/ui-gtk.vcxproj0000664000175000017500000002315312307305667014636 00000000000000 Debug Win32 Release Win32 ui-gtk {9D164547-3F37-4C14-BCCE-91EB2F3DC317} ugetgtk Win32Proj Application Unicode true Application Unicode <_ProjectFileVersion>10.0.40219.1 $(SolutionDir)$(Configuration)\$(ProjectName)\ $(Configuration)\$(ProjectName)\ true $(SolutionDir)$(Configuration)\$(ProjectName)\ $(Configuration)\$(ProjectName)\ false Disabled ..\..\uglib;..\..\uget;..\..\ui-gtk;D:\devpack\curl-msvc\include;D:\devpack\gtk3\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\lib\gtk-3.0\include;D:\devpack\gtk3\include\gtk-3.0;D:\devpack\gtk3\include\gdk-pixbuf-2.0;D:\devpack\gtk3\include\pango-1.0;D:\devpack\gtk3\include\atk-1.0;D:\devpack\gtk3\include\cairo;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_CONSOLE;DATADIR_WIN_PROG;HAVE_PLUGIN_ARIA2;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue glib-2.0.lib;gthread-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;gtk-win32-3.0.lib;gdk-win32-3.0.lib;gdk_pixbuf-2.0.lib;pango-1.0.lib;pangocairo-1.0.lib;pangowin32-1.0.lib;atk-1.0.lib;intl.lib;cairo.lib;libcurl.lib;Ws2_32.lib;winmm.lib;uget.lib;uglib.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;D:\devpack\curl-msvc;Debug;%(AdditionalLibraryDirectories) true Console MachineX86 MaxSpeed true ..\..\uglib;..\..\uget;..\..\ui-gtk;D:\devpack\curl-msvc\include;D:\devpack\gtk3\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\lib\gtk-3.0\include;D:\devpack\gtk3\include\gtk-3.0;D:\devpack\gtk3\include\gdk-pixbuf-2.0;D:\devpack\gtk3\include\pango-1.0;D:\devpack\gtk3\include\atk-1.0;D:\devpack\gtk3\include\cairo;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_WINDOWS;DATADIR_WIN_PROG;HAVE_PLUGIN_ARIA2;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase glib-2.0.lib;gthread-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;gtk-win32-3.0.lib;gdk-win32-3.0.lib;gdk_pixbuf-2.0.lib;pango-1.0.lib;pangocairo-1.0.lib;pangowin32-1.0.lib;atk-1.0.lib;cairo.lib;intl.lib;libcurl.lib;Ws2_32.lib;winmm.lib;uget.lib;uglib.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;D:\devpack\curl-msvc\;Release;%(AdditionalLibraryDirectories) true Windows true true MachineX86 uget-2.0.2/Windows/msvc/test-jsonrpc.vcxproj0000664000175000017500000001155312311776525016072 00000000000000 Debug Win32 Release Win32 {BE2BF360-69F6-406F-A89D-77B0F9A92C04} Win32Proj testjsonrpc Application true Unicode Application false Unicode true false ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) Level3 Disabled WIN32;HAVE_GLIB;inline=__inline;_DEBUG;%(PreprocessorDefinitions) uglib.lib;glib-2.0.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;D:\devpack\curl-msvc\lib\Debug;Debug;%(AdditionalLibraryDirectories) true uglib.lib;uget.lib;Ws2_32.lib;curllib.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) Console ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) Level3 WIN32;HAVE_GLIB;inline=__inline;NDEBUG;%(PreprocessorDefinitions) uglib.lib;glib-2.0.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;D:\devpack\curl-msvc\lib\Release;Release;%(AdditionalLibraryDirectories) true uglib.lib;uget.lib;Ws2_32.lib;curllib.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) Console uget-2.0.2/Windows/msvc/msvc-config.txt0000664000175000017500000000400612307305667014771 00000000000000--- include dir --- (C/C++ - General - Additional Include Directories) ..\..\uglib;..\..\uget;..\..\ui-gtk;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0; ..\..\uglib;..\..\uget;..\..\ui-gtk;D:\devpack\curl-msvc\include;D:\devpack\gtk3\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\lib\gtk-3.0\include;D:\devpack\gtk3\include\gtk-3.0;D:\devpack\gtk3\include\gdk-pixbuf-2.0;D:\devpack\gtk3\include\pango-1.0;D:\devpack\gtk3\include\atk-1.0;D:\devpack\gtk3\include\cairo; --- lib dir --- (Linker - General - Additional Library Directories) D:\devpack\gtk3\lib;D:\devpack\curl-msvc; --- lib --- (Linker - Input - Additional Dependencies) glib-2.0.lib;gthread-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;gtk-win32-3.0.lib;gdk-win32-3.0.lib;gdk_pixbuf-2.0.lib;pango-1.0.lib;pangocairo-1.0.lib;pangowin32-1.0.lib;atk-1.0.lib;intl.lib;cairo.lib;libcurl.lib;Ws2_32.lib;winmm.lib;uget.lib;uglib.lib; --- project (solution) --- 1. Caeate Name : ProjectName Location : path\ProjectDir Don't "Create directory for solution" 2. Rename path\ProjectDir\ProjectName to path\ProjectDir\msvc 3. Commit follow file only *.sln *.vcxproj (old vc is *.vcproj) --- project type --- 1. Windows Console (Linker - System - SubSystem) - Select "Console" (C/C++ - Preprocessor - Preprocessor Definitions) - add "_CONSOLE", remove "_WINDOWS" 2. Windows GUI (Linker - System - SubSystem) - Select "Windows" (C/C++ - Preprocessor - Preprocessor Definitions) - add "_WINDOWS", remove "_CONSOLE" 3. Windows Dynamic Library (DLL) (General - Configuration Type) - Select "Dynamic Library (.dll)" (C/C++ - Preprocessor - Preprocessor Definitions) - add "_USRDLL" 4. Windows Static Library (LIB) (General - Configuration Type) - Select "Static Library (.lib)" (C/C++ - Preprocessor - Preprocessor Definitions) - add "_LIB" --- debug --- (Debug - Environment) - add "PATH=C:\Program Files\Common Files\GTK\2.0\bin" or add "PATH=D:\devpack\gtk2\bin" uget-2.0.2/Windows/msvc/stdint.h0000664000175000017500000001706012206515642013471 00000000000000// ISO C9x compliant stdint.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006-2008 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. The name of the author may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_STDINT_H_ // [ #define _MSC_STDINT_H_ #if _MSC_VER > 1000 #pragma once #endif #include // For Visual Studio 6 in C++ mode and for many Visual Studio versions when // compiling for ARM we should wrap include with 'extern "C++" {}' // or compiler give many errors like this: // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #ifdef __cplusplus extern "C" { #endif # include #ifdef __cplusplus } #endif // Define _W64 macros to mark types changing their size, like intptr_t. #ifndef _W64 # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types // Visual Studio 6 and Embedded Visual C++ 4 doesn't // realize that, e.g. char has the same size as __int8 // so we give up on __intX for them. #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; // 7.18.1.2 Minimum-width integer types typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; typedef int64_t int_least64_t; typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; typedef uint64_t uint_least64_t; // 7.18.1.3 Fastest minimum-width integer types typedef int8_t int_fast8_t; typedef int16_t int_fast16_t; typedef int32_t int_fast32_t; typedef int64_t int_fast64_t; typedef uint8_t uint_fast8_t; typedef uint16_t uint_fast16_t; typedef uint32_t uint_fast32_t; typedef uint64_t uint_fast64_t; // 7.18.1.4 Integer types capable of holding object pointers #ifdef _WIN64 // [ typedef signed __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else // _WIN64 ][ typedef _W64 signed int intptr_t; typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types typedef int64_t intmax_t; typedef uint64_t uintmax_t; // 7.18.2 Limits of specified-width integer types #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 // 7.18.2.1 Limits of exact-width integer types #define INT8_MIN ((int8_t)_I8_MIN) #define INT8_MAX _I8_MAX #define INT16_MIN ((int16_t)_I16_MIN) #define INT16_MAX _I16_MAX #define INT32_MIN ((int32_t)_I32_MIN) #define INT32_MAX _I32_MAX #define INT64_MIN ((int64_t)_I64_MIN) #define INT64_MAX _I64_MAX #define UINT8_MAX _UI8_MAX #define UINT16_MAX _UI16_MAX #define UINT32_MAX _UI32_MAX #define UINT64_MAX _UI64_MAX // 7.18.2.2 Limits of minimum-width integer types #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MAX INT64_MAX #define UINT_LEAST8_MAX UINT8_MAX #define UINT_LEAST16_MAX UINT16_MAX #define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST64_MAX UINT64_MAX // 7.18.2.3 Limits of fastest minimum-width integer types #define INT_FAST8_MIN INT8_MIN #define INT_FAST8_MAX INT8_MAX #define INT_FAST16_MIN INT16_MIN #define INT_FAST16_MAX INT16_MAX #define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MAX INT32_MAX #define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MAX INT64_MAX #define UINT_FAST8_MAX UINT8_MAX #define UINT_FAST16_MAX UINT16_MAX #define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST64_MAX UINT64_MAX // 7.18.2.4 Limits of integer types capable of holding object pointers #ifdef _WIN64 // [ # define INTPTR_MIN INT64_MIN # define INTPTR_MAX INT64_MAX # define UINTPTR_MAX UINT64_MAX #else // _WIN64 ][ # define INTPTR_MIN INT32_MIN # define INTPTR_MAX INT32_MAX # define UINTPTR_MAX UINT32_MAX #endif // _WIN64 ] // 7.18.2.5 Limits of greatest-width integer types #define INTMAX_MIN INT64_MIN #define INTMAX_MAX INT64_MAX #define UINTMAX_MAX UINT64_MAX // 7.18.3 Limits of other integer types #ifdef _WIN64 // [ # define PTRDIFF_MIN _I64_MIN # define PTRDIFF_MAX _I64_MAX #else // _WIN64 ][ # define PTRDIFF_MIN _I32_MIN # define PTRDIFF_MAX _I32_MAX #endif // _WIN64 ] #define SIG_ATOMIC_MIN INT_MIN #define SIG_ATOMIC_MAX INT_MAX #ifndef SIZE_MAX // [ # ifdef _WIN64 // [ # define SIZE_MAX _UI64_MAX # else // _WIN64 ][ # define SIZE_MAX _UI32_MAX # endif // _WIN64 ] #endif // SIZE_MAX ] // WCHAR_MIN and WCHAR_MAX are also defined in #ifndef WCHAR_MIN // [ # define WCHAR_MIN 0 #endif // WCHAR_MIN ] #ifndef WCHAR_MAX // [ # define WCHAR_MAX _UI16_MAX #endif // WCHAR_MAX ] #define WINT_MIN 0 #define WINT_MAX _UI16_MAX #endif // __STDC_LIMIT_MACROS ] // 7.18.4 Limits of other integer types #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 // 7.18.4.1 Macros for minimum-width integer constants #define INT8_C(val) val##i8 #define INT16_C(val) val##i16 #define INT32_C(val) val##i32 #define INT64_C(val) val##i64 #define UINT8_C(val) val##ui8 #define UINT16_C(val) val##ui16 #define UINT32_C(val) val##ui32 #define UINT64_C(val) val##ui64 // 7.18.4.2 Macros for greatest-width integer constants #define INTMAX_C INT64_C #define UINTMAX_C UINT64_C #endif // __STDC_CONSTANT_MACROS ] #endif // _MSC_STDINT_H_ ] uget-2.0.2/Windows/msvc/uglib.vcxproj0000664000175000017500000001575512477443373014556 00000000000000 Debug Win32 Release Win32 {8E8A46B4-6B62-4BD0-BCAF-BA9CF1090DEA} uglib Win32Proj StaticLibrary Unicode true StaticLibrary Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ Disabled ..\..\uglib;D:\devpack\curl-mingw\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\lib\glib-2.0\include;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_LIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue ..\..\uglib;D:\devpack\curl-mingw\include;D:\devpack\gtk3\include\glib-2.0;D:\devpack\gtk3\lib\glib-2.0\include;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_LIB;%(PreprocessorDefinitions) MultiThreadedDLL Level3 ProgramDatabase uget-2.0.2/Windows/msvc/test-json.vcxproj0000664000175000017500000001326412307305667015366 00000000000000 Debug Win32 Release Win32 {D0C49F36-9ECC-4B87-9360-A7EE570DA73C} testjson Win32Proj Application Unicode true Application Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ true $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ false Disabled ..\..\uglib;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue uglib.lib;glib-2.0.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;Debug;%(AdditionalLibraryDirectories) true Console MachineX86 MaxSpeed true ..\..\uglib;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase uglib.lib;glib-2.0.lib;%(AdditionalDependencies) D:\devpack\gtk3\lib;Release;%(AdditionalLibraryDirectories) true Console true true MachineX86 {8e8a46b4-6b62-4bd0-bcaf-ba9cf1090dea} false uget-2.0.2/Windows/msvc/test-plugin+app.vcxproj0000664000175000017500000001363412307305667016470 00000000000000 Debug Win32 Release Win32 {CAD0E048-8211-4F6B-9975-215A526AC645} testjson Win32Proj Application Unicode true Application Unicode <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ true $(SolutionDir)$(Configuration)\ $(Configuration)\$(ProjectName)\ false Disabled ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;_DEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue uglib.lib;uget.lib;Ws2_32.lib;curllib.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) D:\devpack\curl-msvc\lib\Debug;D:\devpack\gtk3\lib;Debug;%(AdditionalLibraryDirectories) true Console MachineX86 MaxSpeed true ..\..\uglib;..\..\uget;D:\devpack\curl-msvc\include;D:\devpack\gtk3\lib\glib-2.0\include;D:\devpack\gtk3\include\glib-2.0;%(AdditionalIncludeDirectories) WIN32;HAVE_GLIB;inline=__inline;NDEBUG;_CONSOLE;HAVE_GLIB;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 ProgramDatabase uglib.lib;uget.lib;Ws2_32.lib;curllib.lib;glib-2.0.lib;intl.lib;%(AdditionalDependencies) D:\devpack\curl-msvc\lib\Release;D:\devpack\gtk3\lib;Release;%(AdditionalLibraryDirectories) true Console true true MachineX86 {8e8a46b4-6b62-4bd0-bcaf-ba9cf1090dea} false uget-2.0.2/Windows/Makefile.am0000664000175000017500000000151512333312667013100 00000000000000EXTRA_DIST = \ resources/uget.rc \ resources/uget-icon.ico \ msvc/msvc-config.txt \ msvc/stdint.h \ msvc/test-json.vcxproj \ msvc/test-jsonrpc.vcxproj \ msvc/test-plugin+app.vcxproj \ msvc/test-uget.vcxproj \ msvc/test-uglib.vcxproj \ msvc/uget.sln \ msvc/uget.vcxproj \ msvc/uglib.vcxproj \ msvc/ui-gtk.vcxproj \ CodeBlocks/mingw-config.txt \ CodeBlocks/test-info.cbp \ CodeBlocks/test-json.cbp \ CodeBlocks/test-jsonrpc.cbp \ CodeBlocks/test-plugin+app.cbp \ CodeBlocks/test-uget.cbp \ CodeBlocks/test-uget-cxx.cbp \ CodeBlocks/test-uglib.cbp \ CodeBlocks/test-uglib-cxx.cbp \ CodeBlocks/uget.cbp \ CodeBlocks/uglib.cbp \ CodeBlocks/ui-gtk.cbp \ CodeBlocks/ui-gtk-1to2.cbp \ CodeBlocks/uget.workspace uget-2.0.2/Windows/CodeBlocks/0000775000175000017500000000000012574544100013126 500000000000000uget-2.0.2/Windows/CodeBlocks/uget.cbp0000664000175000017500000000711412477443373014517 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-uglib-cxx.cbp0000664000175000017500000000307012307065577016425 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-uget.cbp0000664000175000017500000000335712311776525015474 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-info.cbp0000664000175000017500000000270112307065577015456 00000000000000 uget-2.0.2/Windows/CodeBlocks/ui-gtk-1to2.cbp0000664000175000017500000000667612324426324015536 00000000000000 uget-2.0.2/Windows/CodeBlocks/uglib.cbp0000664000175000017500000001155712477443373014663 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-jsonrpc.cbp0000664000175000017500000000335112317407515016174 00000000000000 uget-2.0.2/Windows/CodeBlocks/uget.workspace0000664000175000017500000000117412321735067015741 00000000000000 uget-2.0.2/Windows/CodeBlocks/mingw-config.txt0000664000175000017500000000027412206515642016177 00000000000000--- include dir --- ..\..\uglib D:\devpack\gtk2\include\glib-2.0 D:\devpack\gtk2\lib\glib-2.0\include --- lib dir --- D:\devpack\gtk2\lib Debug Release --- lib --- uglib glib-2.0.dll uget-2.0.2/Windows/CodeBlocks/test-plugin+app.cbp0000664000175000017500000000336212311776525016576 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-uglib.cbp0000664000175000017500000000305612311776525015626 00000000000000 uget-2.0.2/Windows/CodeBlocks/ui-gtk.cbp0000664000175000017500000001456212321735067014750 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-json.cbp0000664000175000017500000000270112307065577015474 00000000000000 uget-2.0.2/Windows/CodeBlocks/test-uget-cxx.cbp0000664000175000017500000000350412307065577016271 00000000000000 uget-2.0.2/Windows/resources/0000775000175000017500000000000012574544100013130 500000000000000uget-2.0.2/Windows/resources/uget-icon.ico0000664000175000017500000004220612307305667015451 00000000000000 hF   600 %(  ^4NW.S-S-S-S-S-S-S-S-S-S-S-S-W.^4N[2*F.N.N.N.N.N.N.N.N.N.N.N.N*F[2!]54R4R4R4R4R4R4R4R4R4R4R4R4R4R!]5&a::X:X:X:X/|F l+ q* r+ p* o* q*&s69V:X&a:*f>@^=Z-u@,t?o${% '%w2+v>x${%")2{B@^*f>/lCEc%j2k o!w$%+3:B]Ec%o2x$&,6BEc/lC4pHKh"f,l!-s<{%07CYKhKhFa n)%,9EKh4pH9uMQm#g.l!AWw&5{CJbQmQmJd6{I!y(:FQm9uM?zTWs%i.k E[p!'y,7{AWsWs5vEf t%;}FWs?zTDX]x/o<$i-J_g p&5x?]x]xMc=}N?PPf]xDXI]c~c~c~Ncbl#5u?c~c~;xJ`l#={Gc~I]Pciiibz` h"6s>ii>zMa&m*A|KiPcViooooVi-l52q;0o9&h0&g/)k35s?HUoVi\p}uuuuuuuuuuuu}\p_sҌʪʪʪʪʪʪʪʪʪʪʪʪ_sdwEaubvbvbvbvbvbvbvbvbvbvbvbvaudwE(0 +{{+4,yF:X>Z@\D_E`HbJeMfMfJeHbE`D_@\>Z:X,yF4 )xC/N0N1O3Q4R5R5R5R5R5R5R5R5R4R3Q1O0N/N)xC "1P4R8V=Z?\A]A];U5K7N7N7N7N7N2|F6MR!j)q"w${%}%"k(:U9X @^wJw}hmpr%\-^h$h)D|Osss[lObi!'k,B|N}lotuHVSd!f&C~Ouuu]oTc k&*k0E}Qnquvw9oDQ["X#NFDIS\$c(*b/E{QŸpsuvwwi~VeQ`Q`O^M]M\O^P_ScSc`uŸ |uuvvvvvvvvvvvvuu| x\ĤܙȨȩȩȩȩȩȩȩȩȩȩȩȩȩȩȨĤx\ ( @ ]_^<;< <;< ]_^AAA >|                        |>AAA 0:&L&N'P)Q+R-T.U0V1W2X3Y5Y6Z6Z5Y3Y2X1W0V.U-T+R)Q'P&N&L:0srrU&L&T$P%Q%Q%Q&R&R&R&R&R%Q%Q%Q%Q%Q%Q&R&R&R&R&R%Q%Q%Q$P&T&LUsrr:79\'Q&S&R'T(T(U)U*U*U*U*U*U*U*V*V*U*U*U*U*U*U)U(U(T'T&R&S'Q\:79@=?Z*R)V)V+V,W-X-X.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y-X-X,W+V)V)V*RZ@=??<>Y+U,Y,X-Z/[1\2\2\2\0X#<p.j(l(m(n(m(l(l(k(p-!y4$>.Y-Z,X,Y+UY?<>?<>X-W.[/[2\3]4_5_6_2Xa$hr"w${%{%v$q#t#w#w#v$u$p"k'/V/[.[-WX?<>?<>W/Y1_2]4_6a7b8c8cg(m w$|%&!(!~(s)-Lk!x${%|%& '!|($t32]1_/YW?<>?<>W2[3a5_,Mg*g)h)l)k!v${% '%,)/&q,5X;d(@k x$z%~&!('.(s,0Q3a2[W?<>?<>U3^6c1VYin!p"r"v$z% ~&'--3.y34P=h=h=h!p0n!y$|%#))/+z1/J6c3^U?<>><=T7`8e'@bq"r"p"r#y%}&$+,3064F@j@j@j@j<=><=T9c:h'@dq"j (<"v/u""~((.-~31z=AjBlBlBlBlBl7Yat"|%'-,x13O:h9cT><=><=Q=e<=><=Q?h>k)Bap"^Fp.Fj !x'#o(:XGqGqGqGqGqGqGqGqGq$t4n!%{++u06Q>k?hQ><=><=PCl@n+Dbo!\Js/Ghs"&y18S:TAbJsJsJsJsJs4P3M1Il!$y**s/7S@nClP><==<<ODlBo,Ean ZKu/Gdp!o"!m'&h+5KKuKuKuKuKuT[cn "w((q.7PBoDlO=<<=<<NHqEr-F`m!YNw1Han!q"#u))q.8MNwNwNwNwNwT!Y_c j%&e*6PErHqN=<<=<<MJrFs.G[gTPy2J^j m!!r')p.:OQzQzQzQzQz9T7P6Q7Q8R9UBhFsJrM=<<=<<LNuHv6T_) e+ _,R|3K[h k!!p')n.;PR|R|R|R|R|EiDgEgEfEfDfGpHvNuL=<<=<<JQyJxMyQ{R}S}T~4KXei n&'l,;OT~T~T~T~T~NOTX] Z$:UJxQyJ=<<=<<IT{LzP{S~UVWŀ9RVdhm$&i);PWŀWŀWŀWŀWŀV"^cg m%&g*=WLzT{I=<<<<<HW~N}RTŀVƀWƁXƃCdPbfk$#f(9PXƃXƃXƃXƃXƃV"]cg"m(&h,?ZN}W~H<<<<<<GYP~S~WǂXȂZȄ[ȄZƄ ^+Zdh" d%WRʁ\F<<<=<=E_ŜWȃXɅYɄ[Ɇ]ɇ]ʇ]ʇY:S.t?&g2'h3'g1#d/!c-!b-!b-!b-#d/'g3+k7/n:/j;EcŜ_E=<=766DaÇU΃WɄXʅZˆ[ˇ\ˇ\ˇ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ\ˇ\ˇ[ˇZˆXʅWɄU΃aÇD766onnBcÈU΃YʆYˆZˇ[ˈ[ˇ\ˇ\ˇ\ˈ\ˈ\ˈ\ˈ\ˈ\ˈ\ˈ\ˈ\ˈ\ˈ\ˇ\ˇ[ˇ[ˈZˇYˆYʆU΃cÈBonn&xʘaّXЇYщYщZщ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъ[ъZщYщYщXЇaّxʘ&755(A2huvx•x•x–x–y–y–y–y–y–y–y–y–y–y–y–y–y–y–x–x–x•x•vu(A2h755`]_QRR$$$$$$QRR`]_(0` hhhdee                                    deehhhqqq(7====================================7(qqqCw                                      wC 8^.&L)Q*Q+R,S/U0V2W3X4Y5Y7[7[9\:^<`>`>`@a@a>`>`<`:^9\7[7[5Y4Y3X2W0V/U,S+R*Q)Q&L^.8 Y_0*Z%Q$P$P$P%R%R&R&R&R&S&S&S&S&S&S'S'S'S'S'S'S'S'S&S&S&S&S&S&S&R&R&R%R%Q%Q$P$P%Q*Z_0Yn%K%Q$O$O%O%P%P&P&P&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&Q&P&P%P%P%P$O$O%Q%Kn_`` r&O&R&Q&Q&R'T'R'S(S(U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U)U(U(S'S'S&R&S&Q&Q&R&O r_``ijj p'Q'U'U'U(V)V*V+V+V+W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W+W+V+V*V)V(V'U'U'U'Q pijjhhh p(R)V*V*V+V,W,X-Y.X.Y.Z/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y/Y.Z.Y.X-Y,X,W+V*V*V)V(R phhhhhh o(S*W*W,W,Y-Y/Y/[0[1[1\1\2\2\2\0W'B%9%9%9%9%9%9%9%9%9%9%9%9%9$9$9'B-S/[/Z-Y,Y,W*W*W(S ohhhhhh n+U,Z,Z-Z/[0\2\2\3]3]3]4_3]2\'=t$t#w$x$z%{%{&v$q#u#y%y%x$x$x$y%{%{&x$v,+N0\/[-Z,Z,Z+U nhhhhhh m,U/\/[0\1\2\3^4_5_6`6`6`5^#4s#t#w$y%{%}& ~&z%dUe w#z%y%y%y%z%|%~& '|&i#+M1\0\/[/\,U mhhhhhh m-X0^0\2]2^4_5`7b7b8b8c8c'<r"s"u#x${%}%&}%k G@1Tm%w#y$x$y$z${%~%& '!y&^$/V2]0\0^-X mhhhhhh l.W2_1]3_4_6a5\1U1U1V2V2Ss$s"u#w$z%}& ' ' t%T4.O9d.Om!w$x$x$y${%}&&")$+!i'%t:3_1]2_.W lhhhhhh k/X2`3^5`6a(>p#o"o"p"p"q"r#t#w$z%}& '$+%{, `%>(t>;d;d;d(?o"v$w$x$z%}& '#*(/&r+ P&5`3^2`/X khhhhhh j0Z4b5`5b)An!n!o!o!p!q"r"t#w#y$|% &%+).&k+ J#$Z1=f=g=g=gZq"x${%!}'&,(z.'b+%G'4~KBkBkBkBkBkBkBkBkBk+Ais"v#z$"~((.)s.%O'5[9e8f8a hhhhhhh f;c:h;h4Wj k m!Z 2DmCm'8w$z%"})%y,%f)!I$,`:DmDmDmDmDmDmDmDmDmDmCl"p0j s#w${&&-(q.$N'8\;h:h;c fhhhhhh e=e;iaFqFqFqFqFqFqFqFqFqFqFqFqFq:\j!t#x$&},(o-%N':^=j=j?h  ehhhhhh  dAi>k?k8Zi j l!Z 2HqHr(9s#u$n#a!7PIqIqIqIqIqIqIqIqIqIqIqIqIqIqHr0Hq#v$$z+&m,$L&<`?k>kAi  dhhhhhh  dDl?nBm8Zij l Y 1JsJs(8q"s"r"!t(2E4G4H2xDCgJsJsJsJsJsJsJs?`+?,?,@-Ar#t##y)&l+#K&=`Bm?nDl  dhhhhhh  bFn@nCo:]h i k!X 1KtKu(8n"p"r#t$!v'&x,'l,"K%@`KuKuKuKuKuKuKu8Udegj n!r##w)&j+#J&>cCo@nFn  bhhhhhh  `IpBoEq;]hij X 0LwMw'8l n!p!r" t%$w*&k+"K%@bLwLwLwLwLwLwLw8U\]`cfi n%#b( F#?cEqBoIp  `hhhhhh  `KrCpEr;^gh i V /NwNw(~8i k!m!o"r%$u*&j+"J%CcOxOxOxOxOxOxOx8T@ACEGJOJ < ?dErCpKr  `hhhhhh  `MtEqGs=^`aaP - PyPy(~8hil n!p##t)&i*"J%DdPyPyPyPyPyPyPyAb&g8'g8'g8'i8'i8&k8*m<,n?-k?GpGsEqMt  `hhhhhh  ^PwEsIu<^EEE9 $ Q{Q{)}9fhj l o#"s(&h*"J%EeQ{Q{Q{Q{Q{Q{Q{Q{Q{Q{Q{Q{Q{QzPyLwKwJvIuEsPw  ^hhhhhh  ^SxGuJwEm%d7&d8&d8&c8)g_acfh l%"a'E!HiWŁWŁWŁWŁWŁWŁWŁ?\[]_bfi "m'$b' D#GkN{KzZ~ [hhhhhh Y\L|P}R}R~SŀVƀWƁXƂXƃXƃ8P]`cegk$!`&CIjXƃXƃXƃXƃXƃXƃXƃ@][]`cfi#$n)&c*"F%IlP}L|\ YhhhhhhY^M}Q}R~TƀVƁWǁXǂYǃYǃYDŽOuT^bdfi#b%M JkYDŽYDŽYDŽYDŽYDŽYDŽYDŽA^\^`cfj%&n+&c+#E&ImQ}M}^YhhhhhhX`N}R~RVȀWȀXǂYɃZɄ[Ʉ\Ʌ\Ʌ2}FT`ceh" h% a%Ji[Ʌ[Ʌ[Ʌ[Ʌ[Ʌ[Ʌ[ɅC_\_adg""k''o,'b+#E%InR~N}`XhhhhhhWbPʀSTȁVɁXȃYɅYɄZɄ\Ʌ\Ʌ\Ɇ\Dž&e4MV[` b#c$c$` ^\ZYXVVXY\^b##e('h,(],#C%JpSPʀbWhhhhhhWdQʀTǁUɁVɂXɅYɅZɄ[Ʌ\Ɇ]Ɇ]Ɇ]Ɇ[Ń1uE;@EGIIFDBA@@??@ACGK N#$Q&$K&!:#KpTǁQʀdWhhhhhhVg‰R̂VɃVɂXɅXʅZʆZʅ[ʆ]ʇ]ʇ]ʈ]ʈ]ʈ]ʈV~@\2rG/jA0kB0kB/jA.i@,h>+f=+f=+f=+f=+f=+f=,h>.i@1lC2nD3oE5qH5pH5mHR{VɃR̂g‰VhhhgggThÌS̓WɄVʄXʅX˄YˆZˇ[ˆ\ˆ\ˇ\ˇ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ]ˈ\ˇ\ˇ\ˆ[ˆZˇYˆXʅXʅVʄWɄS̓hÌTgggnnnTjčT΃XʅX˄X˄X˄ZˆZˇ\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇\̇ZˇZˆX˄X˄X˄XʅT΃jčTnnn MmĐVφYˆY̆Y̆ŻŻ[̈\̉\̉\͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉]͉\͉\̉\̉[̈ŻŻY̆Y̆YˆVφmĐ M ;|ǙXφV˄X̆X̆X̆ẊẎẎẎŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻẎẎẎẊX̆X̆X̆V˄Xφ|Ǚ;EEEizڳcЎ`ҍ`ҍaҎaҎaҎaҎaҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎbҎaҎaҎaҎaҎaҎ`ҍ`ҍcЎڳizEEE i{ȥ˨ͪͪͪͪͪͪͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͪͪͪͪͪͪ˨ȥi{ ?>>?>>srrmmmnmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmnmmmmmsrruget-2.0.2/Windows/resources/uget.rc0000664000175000017500000000005312307305667014347 00000000000000MAINICON ICON DISCARDABLE "uget-icon.ico" uget-2.0.2/Windows/Makefile.in0000664000175000017500000002643512574542540013123 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = Windows DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ resources/uget.rc \ resources/uget-icon.ico \ msvc/msvc-config.txt \ msvc/stdint.h \ msvc/test-json.vcxproj \ msvc/test-jsonrpc.vcxproj \ msvc/test-plugin+app.vcxproj \ msvc/test-uget.vcxproj \ msvc/test-uglib.vcxproj \ msvc/uget.sln \ msvc/uget.vcxproj \ msvc/uglib.vcxproj \ msvc/ui-gtk.vcxproj \ CodeBlocks/mingw-config.txt \ CodeBlocks/test-info.cbp \ CodeBlocks/test-json.cbp \ CodeBlocks/test-jsonrpc.cbp \ CodeBlocks/test-plugin+app.cbp \ CodeBlocks/test-uget.cbp \ CodeBlocks/test-uget-cxx.cbp \ CodeBlocks/test-uglib.cbp \ CodeBlocks/test-uglib-cxx.cbp \ CodeBlocks/uget.cbp \ CodeBlocks/uglib.cbp \ CodeBlocks/ui-gtk.cbp \ CodeBlocks/ui-gtk-1to2.cbp \ CodeBlocks/uget.workspace all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Windows/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Windows/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: uget-2.0.2/pixmaps/0000775000175000017500000000000012574544076011161 500000000000000uget-2.0.2/pixmaps/icons/0000775000175000017500000000000012574544076012274 500000000000000uget-2.0.2/pixmaps/icons/hicolor/0000775000175000017500000000000012574544076013733 500000000000000uget-2.0.2/pixmaps/icons/hicolor/22x22/0000775000175000017500000000000012574544076014512 500000000000000uget-2.0.2/pixmaps/icons/hicolor/22x22/apps/0000775000175000017500000000000012574544076015455 500000000000000uget-2.0.2/pixmaps/icons/hicolor/22x22/apps/uget-tray-downloading.png0000664000175000017500000000124312317407515022316 00000000000000PNG  IHDRĴl;tEXtSoftwareAdobe ImageReadyqe<EIDATxb?--\ 2Q@y0f  R '֥><JF&FW=~M_NO;k)O8 w'/-0 PRPÖ``faB]dA @_#R]ŏ/!_;npYG+~}MtWg_xb=}tŭR]gD,L Fhj`R/FSp^DqLfV&f'ϿKE Kc+no<#yzgxD`_b]RU@KA4@Y@}d.D2A99ݦNAFP]oǔ - ^e0r0)(qbM._?솕 I <7[@(MkZ`_Ӽ#IENDB`uget-2.0.2/pixmaps/icons/hicolor/22x22/apps/uget-tray-default.png0000664000175000017500000000107212317407515021435 00000000000000PNG  IHDRĴl;tEXtSoftwareAdobe ImageReadyqe<IDATxb?--\ 2Q@0Z#  ـR !֥_H1?*C0~~FT$B,Ha:H `#YËoz>>~7?j6M /}bgecGW_f絨iXS #3 u 18wO|( 8\O| ?,Lz%عX9 ##l 6 ٸX@ g2zFLOH;mOV< )I?s[8i,)_(0 ~n;Wn- B߮oxw6K3$qFVÇކv؃ak$-A$4mzȒ YgO`h-GM$.E 9\$9Kcu6+5^} 3S \8`l laoYX1hIA@ale@ JjL='pM(rB1~ cx^GdV:kPJ[w0JUsb#U(y,V;A=9"9JeRʭO߬85PfM*/?ݠB znb8,B`yGx5p͞@ڐMq\â@P( )quۦ Tc?^XȚI a󑡃E Xf>g' ?BB?,3G]|B =FJbK9*V%#;IENDB`uget-2.0.2/pixmaps/icons/hicolor/24x24/0000775000175000017500000000000012574544076014516 500000000000000uget-2.0.2/pixmaps/icons/hicolor/24x24/apps/0000775000175000017500000000000012574544076015461 500000000000000uget-2.0.2/pixmaps/icons/hicolor/24x24/apps/uget-tray-downloading.png0000664000175000017500000000121312317407515022317 00000000000000PNG  IHDRw=tEXtSoftwareAdobe ImageReadyqe<-IDATxb?--}2>`!lTbi-0^GӀT&v=|6FS[Y}4\p U!.A-xy;7' YYFO>a$@ʍ1Quxo\Є7`Xp 3kZL.Z`*NN бD?/ϡYv< + H$E\@W5Xs{6Ko410͖T%:'rJ$O.VĽΰE~[ r tE133:dq`p,cac&n}vhbr]ٟ~aK=j ɡ2 a>X4,Ujc7z@e6# } v.*C#d..w̸ 6too$^].w!dDq Hox3xm9`!lTbiͭ0^6@g4R]}S} 4\A߿ZrÝo'+0"Pn}14_򪣷oðgR`6pml:Ź)G(Wu)M_Ľd>QNIBL۹H 6S2 R#I&` j \JGx;&( Ӭ;ښ?z)Hs##&Ї܅jP͈0THV<R vɋEŇ@yl8`O*Is 3Ë.x|׌KsA6ʭ@,B(AUR[*WgʶIENDB`uget-2.0.2/pixmaps/icons/hicolor/24x24/apps/uget-tray-error.png0000664000175000017500000000141012317407515021142 00000000000000PNG  IHDRw=tEXtSoftwareAdobe ImageReadyqe<IDATxb?--}2>`!lTb9-0^6@g4R]} S 4܌A,ܿo{Y\RUOD~BW6!*>!'"t5g{g͘4;s/]Kic$@ʍy 3+sHybh50.$}97g?^ @k0#`S/ `+k،L 4@*hp>r@ 9xYIĽ ׁ @@%+Eş.ϯ%(*~}gQH-b(-.OAF/yliGPbsV'h%z*HJqs2??̯wϼ4ݰ 8 bo 7*Pזãʤ/ YG׬\IENDB`uget-2.0.2/pixmaps/icons/hicolor/24x24/apps/uget-icon.png0000664000175000017500000000227212317407515017773 00000000000000PNG  IHDRw=tEXtSoftwareAdobe ImageReadyqe<\IDATxڴVMoU=c8NRUSTZ$$*ۊn_`-/ĆBB @Z膠|@@bB\3o}vܴN{{νEyyiX[[sss 'fZV|v.N:ZdYu [~`&u=xOPa~x޵ur&nC ECK.!ޅ1?!wGsR'qyvl1i Df ,-!%-Մ՗?`qRTI"$DC*K!J<^p =:u{w*3Eʋxs,z}y3B 9m0֓8$'302/4ES'Y.kذeȤ-+d6ϼ 1Lk:{ 4%wvwAЯ%fGg^ōowcW `X:TezRd4aHUvJݝ|}2#K*K΢226H@ BG-,`)uIZ)YJTi`0"(*8"7SLTzy=l*-1^) "2*W"̿Z6Fh *T*J&GP@l i2H肦DceGQx[J62$&~]-خCK:Ndظ"ZC(_m$$k$ # :umbmzQ[@z@+q2Aj:03KMsd6ɑPFSbatEXtSoftwareAdobe ImageReadyqe<)IDATx}i%u9U^o=3$g"mɴEۢODIH$IA  3?1h1Kd)I{Dj.9rسt{ɽUVzəA뮷t={.\|x!\|(ދBz7M:u9EFNsZ\СC& )y=z|Ac1b̃1`G{キA`<}9rz!\]]U'ʣw}ܯGi||#Ç|$O/c=8oٿ]oZt8J8@P:?I`2sG깿?΅q)n_`ii x8p@pivkbzlJ}+/@Fp$iIXBtomӿaן]_[=vX|&>)R 1t M:≩r/փ XD7f`~(zD?>ggzwA&=O>~y,&7o0J48+t :b QZH m8{m*@ՙF#gjH4Ay="<7k_K1}V'x~av/ C|/}n]I ԕgzul@WE7S w4 ahU,c'#}#\7t |& ɖ-ҿox;?8sԡlHj:߉kK*DzdQ`:0tSVDuɟ׿?;rH߿OQ|MGr@o`.I:q$TWR)Tr1+((98$J~Z-)WR}%I`JFGFvJt 9SǹF(x.xd7JUr~axk1^\BS9)yiP''ǺZXcRnlkS :Qg;f>Vk تμ/s|ND%*^%7%?yzLyXx }xcFbz/#A"E!3U̮dM"P" NL2 TӀ^j9QP_,Cۂ[m&/ !G#BmZ@Z l\| qME*:ikFZζ|_^xӎ2ҋ뼵"Mw q5p6̈́ h6  9f2 #[%g%og|H,}`P(3 LNBR. ;AZWC0KO@%t:؋MCBbTnGc*J[jbL%`-g Pq[>dAzM;\Ʌ.ߋT$c 9 l\K>;7Yg/~J 8bc Ƒ`-#' NGF+L#6h}kkd/9t3L -F,3U|ɱT \=s݅К0!҉jR&|QA@wP&}tg+pqv9 s! ]k8mZ/^b32uN]S_ʢKpg9b+}l |mo ^>v3oz X1 K2adψ5_ *U3Jh 6ddX@D/I>NKF-'4Ӷn3l,"RF ",, ,:G/oB4A+Epe ]iU& ݏ 6WsX59r*3Y1-+yVXLED _bjDw*C="ta-FW ە61.u L Hb)cΪAŬLx --AWh@;JGDZUϞRٝ8s3()q$q"pB8C1]gL *4clMLٷ_#Ox2J!X|{/߂m#o^od+Tu(KDh5:aN+b89x>#'' rcqNAM $ |l` hJ-al5kY}_kϞ+ȳznyIBq\ˍÿ"T ;rK(~Q)߀^bm*9 btH-V)!J[wz=9` W(UI# _ī0fN?\Gaq H YA{4tx2- \ϱT$9h_V44@; %/a0bP $Bk/@4h?`בMXٚ匔k@Ը,%"z}pj3:.S!d^&r& %cdqˀr%ɧ>t+j +M2 |d; Z$MLϹ;[Ԝt[l뙙Q\"-"U[ab[/=#X@ɛnaUNr#.q ߏ}9ND*u c:o@t B,.h0ЙB&ŀR?a)ϯ5rɜ3i XP.PdțvޅLN!`Hȷ "?yc?+uF؃DNr+a@r~ x,g&VdsW 3c+ܜ+ WRhM_1·zE:& [=^EK[': 8* =4rMVٕOӂ<$/P^6)YF*XY^pg00G[ជXxASGT[OY $KiJ8 M/'.Rsmu+B䖄qᴗax|bbrBp<'Tm >< QcE ;0 e<6t9\Vpa MlQ0UP2OuJMe\dk%X6p<Z| 9i'\M tIVf{x;\V}! ~>]ԭpu-q&0_Y5yrV&\@A2q*^F%NZcPut(oL]@v vߺǯfKJ3e `e _qoOËOԦYQ; _wc5ȭC1DtmA[2[I-P8 ` ^Sɓ0o6qұiQN~nyzVG /- y :JPer/CKX -(o~u9zVBWvkP6 j kɭ PIX-&%Fb8+2ю@DԬ4{+z˱=aR5{< U;P髭sB k,߯g>QrUJ_, ziOHQ)ЧXW `EsP5[Ln[x p~~<I,خᆏl8cyݰT0&0_t"C0EQ4BQDXX e.BclgVUO7;zbDVҰjB%@A~V&tK۶BTؿrY&;X%/ `uly38! P>@vgN*lB^٬GRy*) CR%pWD#`@E8OO GtnUAdqKeÅ* @:9]++`q^+O;9m6",0@H. q8'՚T(ͰY51[xGIX8|WbtF#[l&0MS a-,l}x$(a0TM r\aW;7ugCBIW n+ơlmPajTƅ6 bEU}8Nn soD/ȿ5 c+sV3ߓ56<P`B>zAݪ:!N T!*L =è4ӌ1R;yp\yJ6MY njw  _aG[TAoA>C@g[oq$.BuMW=!=~65a&|[? Ƞ %rڶ-$#j-S\6ӟEvd(#C~#j䩋ؒ3l pQ ""C8ěCT{D%}Hy"uSdsb;X& < M [in* /2LĒ(3I$ =_m=۰ރx$|0B}1vY*rqhTg@aUQt*ʚtp]XC~?GI h qX:nvY=ҺJ^fSO˦'G>i(oX!Cr7г[|uUuIbhM%iЎ_I@TuP(uܜdž GZh iuT3CȾ6pR T.QJ0ftC+upoŬ]TتE>òT"z a"P ZqaydPOxBIZ8/pcW?ĻГXE9`=P(֚ɭ $}[̖AUM(5ޓ"q»N[* .cY :L';X>&XaE`qJDL̜Cp4J@kGHLb#E8Υ>x?r9QΡdy;BU2HkձV x_`ZJ7@R1-dk ۧxd++? ֖{³g ~5\86Adl4i(At_R6T;t)*L \@O}ۖ JJ+ U(+gs`p %񪯷V7S @&gcW݊_D5XɿiLgr wkW%ntUhl܋\Pʠڠ$ ol{&%{ B3,,`|b+hM S)J|Ucnf;?l?8Ohx97nV0oV12WzP -Ap_Gw.lK8R >:On_Y‹ϝMW,m4I6㹌2U ȸjJ(O߳gDi*2 @M[;gY|)tH p6 Efzȟ6$[!$"I VIE_mmyP8ʲTlWc a03w*A흭4:xNe)^:~r[\\~JR6tBȕT6#&I{Ea/nR\hb];<g[7=+P(ڄS*³K⁎ؐ= ,dڴ0ӫ>ec9B_.j0rX v2v r@vW43z6+D^mm̔*D) ]x١y#MɞtS+A`۾.eaW>wQy2 4̜Y ?\5AB̑Nযw9Qk#HR c8TZQА 'S$XW5rv~ĺn{Y'"_#y-H]A ,_hyXv 22~9ϡ?HS`Q+:Q3"eU#kn{UqFO~jr`[ pۥT]Ҷ ɶD׬xd2(-?zE(qV,B2X\%|5>1LŖ_4r 69WY\e>i9iET^A޲=˃{e."l',,ZUf)I%ͩ ]^c'x o<9 {ñ<߅_:^Cе;;BYZ[M~kca@ $ lo.RUln?oj{^"k#0wnn I3%Ѽ(AvH<ЍW];Ays0hûY(Yצ~"a Ty?DIKxe/{YYDc*s(s{ט]e{8|,*;4}ߞŹuz^̡qm~ju<[>> qX?VpLcb# O$Ǒ.bPwv\R%C/^VQS#ȩb+hJ S>6,2 ̜] 7b{tJJ7P+#YJ2wo\ka)@ 01ݲ1VFPtýMYXOwD-&rͺJlтs'sbw8> |cf֕moh|QyPU z{nwmHm␇x-2(:Z\FMW"C?: 58wq=* ZtQ˥8y{,ek2a (]S}~lQ0Fp b)Rld/ #Nz#: #9 ECkv/0 P]P"țDd_qg7btMS5JGNGv=NRpKALC*`-c&aN s4t =7 FԃizOw.jJ@dv%0vGpT' *]*S/(MJ[nWd>RV Q3~B{{[;yCtZP<8e@;<i(ar :$p# 'QL|#$ri7gY0Xk\A#'"*jx6p([0?M'ˈa1L0U$usn){4&X0sBc\f`PǬ 7!pD/ڼB{*ԌF@;#(rV͢VFVSP\Yy1(͒(HA DtY@y,QONT9`qVd͓ /I|(A} ݹ(O /@^)VElUMAnG^@_([;5JnJ~\JV>OiOCɠT3i0jP~%JB,-6gd:r«Nۿq$`@lja31meލT1o+M f-Z$(I:JnJ~=3 ,Ro^߻.9ydGF}7Q/BKHW}ȬD8r ` N+@p*j>]yןӧ 0jŰ:~v񴒛Ӛk.w*?tI>~dc?=}s2E$sF]yQ)(Λs_:ۧ g&Ub !b!5ߪ5ř{?Ţ.B|MJ_~n񌒗<帪:zf)SftJ3>(s˳WͿj؎V{t*Iw>f7:bEڼ1v^zYߋ7I'q䉪9w!닜+Vbk'x}Ě\6;'(nҚ/aRt9ٙ,fRer\rj9 o} ~r6T+`\ZZ|s`tg2OǣQA\@֚wSZS<hW={aCn[< ,`ȋ<ŘSgo 5h!b]sWޕyy9FwQr.,ǏO?4t萯qQ|ǴU;nmG?>W~6 }ѵ{7J, $dT*5PCO[JWGu9||G|%y5Vp]5}׿u&c?7/XcI >J_W\H9I9u;ֿtKOCp U3Z61"6Ю`xG|qaN-CbY+u pEX5>/`_2?ўe!J {Ðý"<@B xUʉ,{T]E~IENDB`uget-2.0.2/pixmaps/icons/hicolor/96x96/0000775000175000017500000000000012574544076014540 500000000000000uget-2.0.2/pixmaps/icons/hicolor/96x96/apps/0000775000175000017500000000000012574544076015503 500000000000000uget-2.0.2/pixmaps/icons/hicolor/96x96/apps/uget-icon.png0000664000175000017500000001420112317407515020010 00000000000000PNG  IHDR``w8tEXtSoftwareAdobe ImageReadyqe<#IDATx]YWZuս؎LNd`4K`&3 B <$xaX$$i^x` 2b$8p=qvowSuunǶ>[ݺUN!v` gvHwe燧N #tNѓK.9w|Sx/]#>36e3y5!UX<877\5/Dae|l;WWW0E ~_OC(Ȼ۶w6Ή|pU1@!jtoO_Zfwaw F-h@V؟Xv{X0 [W:mq 1'ۿ716ڽ W;[XkPu_4444+imH~a~fgfpQB+$RMN'p-˿ɇ0! u< L&hfbz 7;sC?r=diACAKASIHҀ,ZPl7P{Ft9[tQ4zU6Y->p1 T@<:.T&SD$C} RY9UPт #:R>ħK f| jIv+AKASM4afFm?o`s˟ PҚ'`&f̯2崑;|bZ3*~rJNr&' t=?Z- v䙷j>AԅEF"9ESS#;_gZ^hpk eN`yKT?2xWˋ@!`L3`9j&j92Wbon  8H+LZ*v<dvJH~Iђ ?z1%/zx'wz~_;ov& SDhi-18"Hf@ R"=EKϾ|nnCX}OdɟT+.Z+n b$#6TT&%Ԁ@rHh8W6ӵmm[\H9}"-Vs,vz%`kĄi; !0I̠<#j0z*.,wJﵛ@1q^87"3~&)Eր\obz̋<Ӥފ/LKr5DCuWNڵ1trGg!  (ZTG_ZKtHjzaҗ'f 1b&lAD5veoSaUe[ GJ=97' ###E&E96[t&]MjrT NxY%6{~\* zD]<>Bяi_h8;So=JA%aR ϭL"̈́vb,"`\c AV7H4d"#I.];ak!/I!ݨf 2{҆EnЭGazBS^P5A^!p19=үTN#B#8a; B]-# t"2H;N7Hr(Zi}'lʂ3y5#EA;a氾Nj *MNKcA\5#^s%p5;1DVS,89 #{[m`pZ'&?Xӥ>`O'>wfw&$o!/:63;[9tUq%)Ld(?/B4бT3g:.,٦Ků/ ꚧ@3=FD7R"0A]h D(᥏QI*"Ayo6]&hDG= ȹuj"  HJahCC<}AФπBLX -.Iڝ2j۪VF(fi!_tI^/oC{c4y8J's#vEd>@(t=(>3tQQh,aR^x±0 JL;:&D4b&ψigGIG<‰!z{rzE(! tf O1$;QD"=,nPZݮ ~[bfdF=@ w2w%O9fo`&v"̗N=`묡lqBC΄XyF ,uFP@wv~ ,eKI֤E%Dm&b0BEo= 2J(䟹4K;U5H` ^[SȀCͤ.^KF EgjA?3j]a1A X?Lp]h_Z,Z-ڵ/n%Go\PO?mri@F r&btsaȁݨ!h?2>369_-.C!B ALL=ǬEdI9X3bE2)-/,T9>}_ ~^~>Mǀ.z׀ 1EUP=pEd8t|c{{kGpנ2_*ג8oBkv%w) 3bP͵$LgXD&xkkw nv?@U&d^4L09_,AVnܧbkùw(^7sTd轶"u)l/#-q2D6ոOh5śk0}ǟv+p].T!>AcAD#]UDT) \ &Twgœ-nyjXyVCqH*L 6 ͒ 2a}m&+HeCP б ԙ79\`.OסCsGzMBX"Iȅ1l&,91|Qi:/)w9jvy$&9aGdn,%cwO{<BIn+Kߛ;1Unˬ` <ݷIh>d.- WsɏyUEg5]DhQ+"( J1'naYGZ M^taluW>ڂTss5L49$S|GS^c},*ŗ5AhJw+307UL%ܧZP&"*%hwRllx49+CD:CSHhxZ9`t46 .j&KW#(tܼ֛_.GP9X2e~3+蘶ġbC6fL\]}UXWfaeyzP裿{>=rib[p ؼL~cd-)/*2Qg6|UY'\eA+bX]0('m^d՞ o.kp&O֒x?J|gcz2tT4-N J4D: Ңm2كKso@a=a,\n,񅚄8eHҌ嚒:5g?;S#dz!*dr`v^Kt% ؖ Hl20ݱҌsGɧ&eYgԅ\ah4*eIXNϹpq<fmteR>1Dpg ~b/ؤ%bY}'1<"mDLgt-a djJ 6xR k1ﺄcƸ03W)PbGJҀtmW,U`ڠ`Q^[ ξy;GŜ SZ'Iz#,|fD}>*H_@_9{ЙP='op'Z}hu} țs9:Pf ,0K|I-NuCGnF: uJcbZwUc>=FdX5;lI|1oDi̟Gu?~BNpaE:=hmZT T&(`4(e)q%SwgfnAI}HlQ~Vd9%0fx]{sO7;^: #` wHUA (h l[ #ŀiV=ɓgd c#]@ ?5b}Ԕ91Lŝ5AKASI۞鿺3<ٓ+~{rSkz}Tt8˷̱o"'ShM>d%r)2#Κm[b@KKn,u&^+'1cG~bb~Xu2Y4Ps_kEt9K;EkBX6ȘNdMH]ϔ0fqWGW%M7S$ڂ!ⶫ|(becP܎[&lk|ܐĿ>V'&HQ[ C [R3m/3`(lI#$_|ۙwۆO 靶k3MtJ#hPhgP mɀNOҍ)!}[aJ~LXuɀH hI Rzmܧq)͆J6_[bIENDB`uget-2.0.2/pixmaps/icons/hicolor/48x48/0000775000175000017500000000000012574544076014532 500000000000000uget-2.0.2/pixmaps/icons/hicolor/48x48/apps/0000775000175000017500000000000012574544076015475 500000000000000uget-2.0.2/pixmaps/icons/hicolor/48x48/apps/uget-tray-downloading.png0000664000175000017500000000217412317407515022342 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<IDATxb?PL Cz`#,FFF 8E*^1@ b~}`l)Q@ـ4 NC` Q5RϾ~?|spp׷?NBuK]}v7|j"۬zǟT0T)!u}^S$?8d7!Ef*SRg:ƧG"!EUd?6#FXhtSX IUTHkg>O {<t<Ez xzMG""6_i @EDy⎇Eǟiz`)c"bk`)"&hr%*C;UbT$i`xxͻO@7_>{%) qp_zye;h9xm;wHR:NtK 'Os$aŔDuX+12avq5R43@]*@}I]RZdbPS\P b[_/Bb+ Nde iڡcRi 6.O"/A"* ;G$4LZŽ^J@~肎)QCs7 Zv54Otb='WT(`i'}{R2k{>1.VY^jcm-CHQ 9^}S l,HE7q %κa-C8Aezfac˘j(%$H[>o~2+cE` fB(xHz"&\SAMmP/8r@n9ҨU<- A-HHuiAInN9^l1bϿ~yǣo>8 l@d=DH8;ƥ 4Jn#t"gp QP\71:= @ɣz9IENDB`uget-2.0.2/pixmaps/icons/hicolor/48x48/apps/uget-tray-default.png0000664000175000017500000000165612317407515021465 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<PIDATxb?PL Cz`#,FFF 8E*^1@pL vb~5`liS@ـ C` Q5R؆I뇟.ZxHe`r=Cq5O$'0+2`&UR!=V$¿Dy_{<t<Ez WG=+1t761?R/Dy⎇ >H^ 3Rg:oGU~KXDp Lo?\p<H O,~}A3  >1 #Ӑ' `R ?O!$,=d< Pr󵠹ĹD͌ /)i̽[p2̢8TJOIvQqQ5;ꇑ?6&38 BjY[ ]׳>? lso ~yt^o~2X<ǷcipW AOUD1ݶz2^w`ͣ"ɉ`)*ӫo*@]m*@cJb*K_LC-!AZ:ʗw?;1@p,6fK]9)Z8,8r뇟; C ;zj|aj"r\@DL w?~>O^;P2Wgj{@c>4JA TixbPwQf;h["*5y`jӥd>F 1ӿ XIENDB`uget-2.0.2/pixmaps/icons/hicolor/48x48/apps/uget-tray-error.png0000664000175000017500000000253212317407515021164 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe<IDATxZ}L[Uo__ -¬6 %E1+a]ܨ%FctAd32q9 52Ba-/υ){I~~{=ۉ#(- X@FżTysy`V (V'ȃAe| (K` L dL7(: H+N>ϧr(-K@.M0[ǚk!Y9ҝUŅi 4fn7LZ=~7? [W * K23ƌN8 n$eĴP贶n`O Y=.hT1G!#J8CZr+z/+/r?Q}wvڠ:v۱ M@;猒,zq 6CէlJ_FwuB8ǜlk庈%4ќese 0!4@y":ӳH<4Nftgi< ܁ks+K?9DJpB>wg8)qK< sGZ"&A>#WB:bd2wdoAxD'zCs$waU4ĵ[t]g/ tǿا3;8P.km-*?L(\@W_C({ Xasu:u`!x5BX jurSvo'., [dP{lo-P)\)SLYtR/u\@#i^BMZZ(uF ]oOVZXB ersf{=I@g~aB[m0_Q  y xul)&C!c:|HuP?ZL1#;3Ih18z~.Y۰s>C[Z%o}v,ONC&S$&֏z)qe#kB8וR>I7|@Z|yݟoݐW%QRC!+hL+SwWr7۱BPu[ > )e5KEyU&Se08 U A:@5NnDrS=Z#p@6Cl#<4,ݼX{Yä#2KIENDB`uget-2.0.2/pixmaps/icons/hicolor/48x48/apps/uget-icon.png0000664000175000017500000000627212317407515020013 00000000000000PNG  IHDR00WtEXtSoftwareAdobe ImageReadyqe< \IDATxZ]]U^{s\_%j ڄ` $<`& } F 1"EHCV jҙ;v)MN;wk}[k}ʼn'ZB]5Y򆘛E{Ȳ_Ӵw}74 j 333⡇~d_}U5<2DY2M볩;oݩy䗢n[)%P-0wg;n~RIoJi2zag/6zɩ {yo+IFv~<(k.byG$2xTv;ߚ{]?U?5m7]'aEG{0PZ<,( "7j,F2֒0*5M|IQCu Zhk@ZYZŋ%Od*eϭF~}z{vuFu""*W~=bނž`)lKIok'"1?݅:c[1X?'Yi_00Ͻk) }+Vq? (Ye gk F,1 ( kv% $IB$0I 7~mԚD%uvv8y2AnFӿ? cC 5pYpN )z"s6bTv a$1 a7UӓEv! @]wsl6,{gcx-O(6i#S, O*Tsak 7wT] y 2'/W6 PVmsMxN~c.+C0)+G;ۙłW9 )_߉+yp}QXf:u<;іcA d(cJ p酩Yro(>+,?/~& Xe k})d5/%.89uDqb< q4.V튅~_#4]8n@c,D "RFt/["Z?KAxrgS,gnu O Y#B u?(- C`wv+DA!Q~.b"4=mjîۮ/ѐ.b463JhKc 8t qp \X?<jMd7^ϦPPƾbQ)BOpNY ;w"B, NDN6iR-o\ J]OV=-"MgPU Q\ Uӝ8›$5Ulߵ7(JC"6J 9z@6 Cѭ"QxUڍe[:@}sxn \CP@ɲS˥t"=;"Z:ȍbυsÞ .0vekUCǥ8K\IJpEyMa\3üh^P"bdAmZ:\s~Tիx1 _Md KJp/'.Tܝɠ-kv(#pl0zlqWxA!$0~Kшt J /%P»O o<axS㲻sw1倌s sBUцTX_^;@Ł"C Wř O8{pQ 2m&q4TUHV2,gMCga p Os}'9zSSHEiHh31k)QDbˇ h7֜34aK4w ^:dwԀbJ*n>T'TQ6vX,m Èt6;hqR -]K#o{?ԁRZ_>c "BLN)bxTKH.I] #z4$&%d h!G2y.їN9q eIb%}TJMP*Knk2p S=#37h?$o~r ~zGf%[<}S- -vum؂N1rBA6\:rb Hf&\ƻo9o*x)pg.!\oC#8xA0[Ǵ% TAr*Iס'f%8B _ۂ985>1@lkW8˂uק0ʶx@x墉_Sԩvqk0<\MX}h"7bV]+?ԹEJ"DCt`e<ﲁ皫u'&d7'U [ v ,g&;=O+}'RJp-u;99t1pAz*_Z[%IO_2H~Q2p C98sf-[D A*MH7{Cxkl %0 OCG\\cVyB!ʸ ae%mCn_  0o!L+m6A%XG[wBTxp*6Kyw\~W-7Vﰙjsdq‹O ZDWrԆ츻FA$kmvSp* c:gd|atrJ;@wCޠC<_ ; rR^^ᓝ+9ii&zFJ ܽ{h5r_9L[[ͭ-^ʕsy}Iӆ[6HX 3aOY/WJ<ljgpͭaHx6|ƇNZE8V$IXJ4C g;q LlVLW yr/ P7MqN5IpyE{H#[=ع{W ~zp>cTotj}?۷-@kN<VZ?\|V!R&׽ޣJ[nEٳ'b獗IENDB`uget-2.0.2/pixmaps/icons/hicolor/16x16/0000775000175000017500000000000012574544076014520 500000000000000uget-2.0.2/pixmaps/icons/hicolor/16x16/apps/0000775000175000017500000000000012574544076015463 500000000000000uget-2.0.2/pixmaps/icons/hicolor/16x16/apps/uget-tray-downloading.png0000664000175000017500000000104512317407515022324 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb8@ `" ?1M ;!?Ω$MSuT5f.~vw%܏Z @?V323-⎇o 2`&]f|v;o߿ @;'_L.r%!  d'0דko?YYma<얌0$t (-*[lwM*fpoC ~}߿<\ >ȼd?v309bD6. f#6<0#kvɋ/~fV&/r)] #[K'L7`dbdDS7hP"3#ǟ2" e2Teyq=톎{ѳ33 JxW > S E?IENDB`uget-2.0.2/pixmaps/icons/hicolor/16x16/apps/uget-tray-default.png0000664000175000017500000000061212317407515021442 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<,IDATxb8@ `"W?1M [L>l&E3?V&5 @^8Ȓ/ys 01|!. " ΋{g_vOp;':603F-ǗN,D#V?vbVp}fD΍t)?tfMhJ_0O0X>pfIENDB`uget-2.0.2/pixmaps/icons/hicolor/16x16/apps/uget-tray-error.png0000664000175000017500000000106412317407515021151 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxb8@ `"?1M ;8r/{I (.ڡE8=LL\B)Y[?60 33[GKr9v $xK4;[贈B?AUĸ ;'_hI dP&Hx TjY;H  &F!!{ qOKaqE#$<+o ?[Z~ Bsŝa&_Ҽ뇞3EA ش {x6. 6f3/]zI*PeT 0q [ K+Lzu'N* aN^6VR#*jmD>}f:&oC 5>AKIJM7>qz#zvbbXO4O0~+IENDB`uget-2.0.2/pixmaps/icons/hicolor/16x16/apps/uget-icon.png0000664000175000017500000000121412317407515017770 00000000000000PNG  IHDRatEXtSoftwareAdobe ImageReadyqe<.IDATxڔn@Ol"hR$EY </ѾoMJT4Җ^r{.f(* ɖ||1yՋBM9ޥI.t:<K !,#${u~(0Sh 0! #,ZUXq!%$ǻmϟ> RG,"&p:82DL]č%1b,LJ774"lr\ȎLjq5s-*bԍDYiLo>(9xGЩ6"ܞ(cX29+jTڨw慲Un|_&eS'WZy#~@60 Sd'AIENDB`uget-2.0.2/pixmaps/icons/hicolor/scalable/0000775000175000017500000000000012574544076015501 500000000000000uget-2.0.2/pixmaps/icons/hicolor/scalable/apps/0000775000175000017500000000000012574544076016444 500000000000000uget-2.0.2/pixmaps/icons/hicolor/scalable/apps/uget-icon.svg0000664000175000017500000004366712317407515021006 00000000000000 image/svg+xml uget-2.0.2/pixmaps/icons/hicolor/index.theme0000664000175000017500000000130512317407515015774 00000000000000[Icon Theme] Name=hicolor Comment=Uget icons for hicolor Directories=16x16/apps,22x22/apps,24x24/apps,32x32/apps,48x48/apps,64x64/apps,96x96/apps,128x128/apps,scalable/apps Inherits=default [16x16/apps] Size=16 Type=Fixed Context=Applications [22x22/apps] Size=24 Type=Fixed Context=Applications [24x24/apps] Size=24 Type=Fixed Context=Applications [32x32/apps] Size=32 Type=Fixed Context=Applications [48x48/apps] Size=48 Type=Fixed Context=Applications [64x64/apps] Size=64 Type=Fixed Context=Applications [96x96/apps] Size=64 Type=Fixed Context=Applications [128x128/apps] Size=128 Type=Fixed Context=Applications [scalable/apps] Size=128 Type=Scalable MinSize=1 MaxSize=256 Context=Applications uget-2.0.2/pixmaps/icons/hicolor/32x32/0000775000175000017500000000000012574544076014514 500000000000000uget-2.0.2/pixmaps/icons/hicolor/32x32/apps/0000775000175000017500000000000012574544076015457 500000000000000uget-2.0.2/pixmaps/icons/hicolor/32x32/apps/uget-tray-downloading.png0000664000175000017500000000153212317407515022321 00000000000000PNG  IHDR szztEXtSoftwareAdobe ImageReadyqe<IDATxb?@&`1j1,lJbE >XalFay8 A?Hsr/adbDQvg7C^,HEY__LdbTpٗ¦u@*D@J'/ u ]3ղS/ R4Z/|}STCO 8׿,lLnH?. X|r>,R ix𓲤*B w)%!@r9@ x|prWe u7߅p}yCr;ۇW~Gހ,:д80Z˻`G\Ʀv6\,k}R:a_ Je[!e -5{٥vt'&fF?`J Ҙ(* y8$s @KlpX$o~MlTȖ o+l[" p:kk>XG02I-[ &tf&e8soOfj譨 7OYJD#XmP\w .>RmFފ!DŽ#=j{ Π_Tl2Tuw6"Y~"7Ju8 Jqj*sU󇟿x绀 I@TCibtbk :70'nIENDB`uget-2.0.2/pixmaps/icons/hicolor/32x32/apps/uget-tray-default.png0000664000175000017500000000121212317407515021433 00000000000000PNG  IHDR szztEXtSoftwareAdobe ImageReadyqe<,IDATxb?@&`1j1,l4bE ZalFaysA>" HsrW勁Sf>.Fr"DjX7=(4,>Z.[ %  ~P0Ū?}4 Ag6Jv>1=}^?,*pW_$"{H#9H pw`2\~~Ŋoe4 GhmHRAD zN^6f&&- i'_>bT(Hp@x8ɫ[K^80yC8p`5_~NK| (xrL Xٙa&~R"

Xal^bu-Yt'%> Zi@Y) / 󙈰ϯa96@1bacUb$/1T1`8BT.4Rgbf{ځ'/,]+3S$CO^m շ=3/?Aw¯tojiőI[FX5k[$1`|oRHBw<(dcuNYk FwNs&@1Kcbb| gx~2h0J(Ͽ@k$r.0>_!:`faRBhR@BfFV5D ]@ 8d UE/;o73)F jXWvcD,؉5A\ɂrJj4hE~D(@3̼w;ymiQ0M99ORXZsGkM9#wٙ+Ny\OXEEuf_oR\&uywޮQ5fJ/q gtϜ8!8vJ=z߿ةOk C+`K3=3K)I̚j{'m8%du Pw{!^kP{cs}4|{aB+9,> ,˘EE!Z6`t7*xie4:rnN6^oI8\p6-W$`7!ʈ6ouII<#6ƵsGhַXƃƐxJ)jYOEKCK%|P֖+02 U>73mJxW2E۞\KOZ$'>Zd `QXF\NŜ/NѭZ> /m\8$p" &yQ+Ge9񢉹-۷O/ ˦g!93 Y.R1/>O$ E}VXRJA cVd^7u`]:{~0bD77@BIk-g-2=:YHըB+ֺ[&S*sX2h1#{e0 J,RI`A-Ɂ+d9+AgJ"mjɵ%Gԉ>p v"]$ޗ -,r[ ˽WXJUNqb֯YԿl?F#\mRTQaNƠ5.~^$v\: 5-@#OǶ= ǯ>%l\lBK3ʩA&BpwX(J+KTOڐ~:MB <;B9eFg=e!b񍝐tvdnsЅUJL5yF?_I ""{I'+`@kodBC-G{8WU`f;+ h? aj8ݮMBi0B4Z|6?VpyREKvm!u/&j5h :[DC,𯌆m:E=m8BC-Dgt6}JJjTߠ)`TR\SHs,JEI(p'ЃkWNgPk΢n[ac?]^JQGNCC:0`xQ6f@XV~ob9PvBkj]&]6,'(a5q4NiS`e¤$SvB$+ya\S v.! 8 %T0 Xq"NQW8pe6Y$LҺvKɣJJbũ-9ς6 h7y~) ^܄iL3ޱsN[>S -СCkeFj8p@#@jٳpرPBrG}q }_u?Οq◎`xL&eWHB ֨ <=Ks$GOs/@_i?HB"Ȝ,e72Bp"j'Ofku)ʘJ> ,rU (n~i ȗ;ޒmT8qu"̯ D5N‡L1qj gr7jD*7dB!r6AC_n&eϰ@8\KFϹ Ҙy 9exKGW E\?c}`f] .T%2|mAx f*0W3/X$`GP"POV3=B.8*TĽŸyA!cZ6J6(F9;ӰhQ+8ËSpHĀq.٨x:os?2w`;?BqoAP$:Pc&2~l'ڬ0*W+E@-`]2 (O#6#lVCVM8ӝ4֗D>)?` L&ahAp /.*%>cmq\qCb)Fݳx tH#)( 0*Ӵ֔{k'X tY {аR6Bw4FۦJT=u|hMb0 &C>އ"|+kAU2OZ> Q6Qsun4efR sgarXxfܗܓQF mQ@50/:ֱ$k =&GzK*EϤyB=P) PZ,M׼@\&P r:wbmO[z zukn@AНK!B0`0`Uzc &C X%~l%Wў7B3 o/*sȝL(7fu _!LpБnp+%̌m)$)EMbqJYsH=-) VjCiIy9a*?ڶI⑨y3١Jc!PTQ},:/$((So3X?!lf[u%선6;~`HaU(l& =!%4 "ǀAezX)BbE,"(*+UmѠBX{VDshm@<+Ai5 j)NV ""UqzH[wp@ƗB4\0r&wcd(BaF@TM<=<z\#lݫR,HJUBX'`6we0@X]HaUVE!cmV+.BR7b+i M(Sx~MhGVl6:Uph#G%CdVT`ߦ'͙5 W RqѧskhMFh'`GEUz azaMkeJ^]HArx7Z6hITppKłNfrc;cP~һNL=5bc=0yvk+ )L~؂-{ؕ,deqm6f+X<%РEȐk ruConI ak"d(OUlKK9;s} ugA7]&] MÿMR%zpw6OV|7-"/C]W$/Qf!$};Zb ϾsuYdKL"8Sؑ&7$<#v9,̧e|Cݤ:PnI 'nXе$uO8K̴-Fʡ H>P̻Fm]S'1Btسo ,V2ȦX{^b"Ma{~ Ze-\noM_5%re^W""lDUZc&Е .)y{z9!>{~Ν;avKWxVdž MGaݑg]~c TNGN8EYtkr]#{ڋEkl WBat>rkX\24OZ \)%eRfvGQnSk$y%V@5 Q_`VqG)H_{>QRc<,IRfFykS?Ƿhn⚪N1YA]Gd=Ǖ{4{*xċ #UNJֽqyߟ9t{Jʘe٢Y#lرcӧOJ4{T|"$CxGܱ!ɩS/ ~&dÇo?~+6 N/v_xY 8ŅWԌ +bQ7`IL~JU`:t$aʾ{?dd'X3uY[oA(Y55݋W^!1\p\3p`rʥ*IENDB`uget-2.0.2/pixmaps/Makefile.am0000664000175000017500000000364412317407515013133 00000000000000# icons installing path: # $(datadir)/icons/hicolor/16x16/apps/uget-icon.png # $(datadir)/icons/hicolor/22x22/apps/uget-icon.png # $(datadir)/icons/hicolor/24x24/apps/uget-icon.png # $(datadir)/icons/hicolor/32x32/apps/uget-icon.png # $(datadir)/icons/hicolor/48x48/apps/uget-icon.png # $(datadir)/icons/hicolor/64x64/apps/uget-icon.png # $(datadir)/icons/hicolor/96x96/apps/uget-icon.png # $(datadir)/icons/hicolor/128x128/apps/uget-icon.png # $(datadir)/icons/hicolor/scalable/apps/uget-icon.svg # iconsdir = $(datadir) nobase_dist_icons_DATA = \ icons/hicolor/16x16/apps/uget-icon.png \ icons/hicolor/22x22/apps/uget-icon.png \ icons/hicolor/24x24/apps/uget-icon.png \ icons/hicolor/32x32/apps/uget-icon.png \ icons/hicolor/48x48/apps/uget-icon.png \ icons/hicolor/64x64/apps/uget-icon.png \ icons/hicolor/96x96/apps/uget-icon.png \ icons/hicolor/128x128/apps/uget-icon.png \ icons/hicolor/scalable/apps/uget-icon.svg \ icons/hicolor/16x16/apps/uget-tray-default.png \ icons/hicolor/22x22/apps/uget-tray-default.png \ icons/hicolor/24x24/apps/uget-tray-default.png \ icons/hicolor/32x32/apps/uget-tray-default.png \ icons/hicolor/48x48/apps/uget-tray-default.png \ icons/hicolor/16x16/apps/uget-tray-downloading.png \ icons/hicolor/22x22/apps/uget-tray-downloading.png \ icons/hicolor/24x24/apps/uget-tray-downloading.png \ icons/hicolor/32x32/apps/uget-tray-downloading.png \ icons/hicolor/48x48/apps/uget-tray-downloading.png \ icons/hicolor/16x16/apps/uget-tray-error.png \ icons/hicolor/22x22/apps/uget-tray-error.png \ icons/hicolor/24x24/apps/uget-tray-error.png \ icons/hicolor/32x32/apps/uget-tray-error.png \ icons/hicolor/48x48/apps/uget-tray-error.png # pixmaps # ugetpixmapdir = $(datadir)/pixmaps/uget dist_ugetpixmap_DATA = logo.png # icons/hicolor/index.theme is needed by gtk_icon_theme_append_search_path() # EXTRA_DIST = icons/hicolor/index.theme uget-2.0.2/pixmaps/logo.png0000664000175000017500000001640612317407515012545 00000000000000PNG  IHDR]ҙtEXtSoftwareAdobe ImageReadyqe<IDATx] |E֯}@@p.X!HVCD]@UEa/r|"࢟zs(7BBr]߫NLMOO+Lϯ~t~U`y1kNbBO3 0*"t4^00*uqD„'0ouf$(>/ RF$ <)c:=oŲLL} p"\+CsT˻+mϔёqA[`ZU `^l()( Y`Qt6M~tHAy[-"bEDLp '@ң4h Do)'Ɉ9t١A>!4b@d}em%l B#I{luF򺷿V:&5P+420LJN̤9i3:e]`MEXrEnW?dL(fД/¹ZWr|υş,0"m{$~YoAsh$]"_nXaofbiL6 a1 Sso$`5] 5gf(g;Qgx† R52gay9mz$EEŇSfNF`AZ vHCCC '][BhS$!6%?I: 6CG60GV5=Cͣ" ѤQ닀0DpPS Xۮ&iQXAtU &̘4Q hB cš:tx3,zM.PV5@`[@]R>F瓘y-fձϓBZnoAQ 1:F=\(M1ݞ ?V TTzz6xWmseG6NtcӬUQǫ@ZYP+\^S @2rq,NX-NUr+>SŊi^i8f0[@{oZMWϗI((N HjKr3 ܄->YrT:CϘ_JKAv3~/j%//)xm=OaJd9iF0ϲ6%<P HurfLY1'+jLKZeg3Jj JǬ?Pē)}yv 8Y&iAnq n'0 \e(E4O#ԋ.Vڲz&뾁d)L(g-; ΀=E/8f`|҆aqf$ߊ29> P )c(Tue8r*ޠIt PuV+IA@ա(c?V8ƄK V 9XKVM喒O>%BJ=2T^S*G6Q!}vK.㭍u"ԭLi=!.}|`V|zQނmV<`@+wA$Ti|݀M7^:"z~8sd.]6L&+>tistj3jF#pk{F3! o%4g[! ~ޜ醑o-ê"Iv0=lOa9%K:nK!E׎1hzj^ ‚Q94al96@pt@GXJ׷nblP^ p>c0D=m<{Hh7Ӎ%cH]QO@ I*tefD qpPP(xP~uotO)ՓpC[3 ẬSr|yia)D>Wr@UdϸŚ&a?S 8O{Xqȧ3$`{lTx 7pgCR7ݨۆ0P S?I7 +l{G2 jFMjp-+S^$#М}PMj5!ȋ04yί^W|RzsynLM<1Mg`2a5}MVyMe~S/ǁxFX׿3҅gpuZl h*B2?4+=YOɽBZ:.GWtQ7 RzJOtFk vYP^xd hU xE4?eNi&r7B"Ma9y><].&8k'>yK4 ~rwԁ 8 6AY?p38y"[-π=|3b>cԲCX(%F}I@]FaLx9wkgg@'1CLR<=_ļ;x/KLmhΏt#5C7IF* ݀'Mb K r3!p-j/6=l ]pU`9?,WrV̺{Mejj>pn^]X?d?UXe$&6kLI [4^Ҋp^K5zeGSӔ?k+􉙑OHվZe9i` &YM̡`Ś&C֐ftiŃw'wz˅^p 0Wzx\@7tR-S2ZŴ,$YbѓFk OҴ/);@agw;Zi:m1DI$2x:I?G?~ 浮'na~MSɊ5v,-8U;!khӿCdu6?sh@ cwtӤtD&X UExH;h+ꑠ9]t{lon2ARbHЇrKߏoyL92N/xM⇖YCp2~eFcߎ50܅o#zl6ײVK/Td϶Ub@ Z%[Fj{ ޗ;*z>P[i-Z"9Rd $Nef5 )fp PcVZǟa6zεئG @u\8;@+)/Q$M87w|pcA czw ܋Q?e5aYgDjo" [];*gmuÏ)S23×Z~窫."i0 $:{7^P⇰ĬUKT389e1c@Rh_q3Uf 4`³_q'gE!~ěG  !k2fB44&2 ̟O;Q5`}^lZe !mdSt͛qFc ,:J-1%QH1SKt ^ak9@-~A'o<)i7)suu5n,trր&VBm و3nOi_we@M _TE' ˤS|^d.A!@zuX v#BM-r {W^:Oͦ#Ƃ] 'L:cű|IR;JxʱQV6-N9X#gA 'Lf8L}PShWa*!MVm!C׷Yn ׃,٤_"2}gk%bߎ黦+I6+{tT֨2cԷl7tU$Dr-Z v:FnmN|xƸZt Dž_-s]"#GK^)wFzSZ Ė-nO V|ϗ_T"t %Pks_PF%nzm\!A*'k@n[  ss_,gnct1p|!&uIYߔf#$y嚲ȅaG\]2zܣ2[:/L=~E^:7.븦{ H/7 pB%wyQ)iv;= B[슂2~owu ߒY})to,i1"q?ȲrYLjE zʂt珯Gnh0P@l y@19?Xo^-,1EDVE09n^GmxK39u'3@f?.qх9訂ylpL20&&kiiKVZҥK]m{9걒Hsرc/_wƍE4 ~Ux]{A_X0yf0gz`٥`B #(%K䧥m5ުU=_:͚5k2(tYGUo{5m5%|o}FjE_L;7+S K}օj'/eY rJ-.ˆEonjuZpСܭ[miӦzq! Cp:2E΍(J6UUUF1ZƠf)ykа’3>J|.Vʃ H9֒)VCl{M˅`^?NÕ7) bhZSj֬+W^|7Dy,XyeeW_}u]֭,SPP0pH-[l;EW&Mꓒgf7ono%//Gz>0{ |+Ȱ}TTdS +W^žǀ=N~ ;ŋ:!33s sd3wYmo1 r} uõHr|sI;vX |B;_sٱ%ǫV _62Z=*_OK7TۦvL2wbl&YD?a8%X~{ԾĪKE칹́6mt.^8x<}V;R|rn^ r5pؑ\ fwM[r.\ȃ;+Ӈ~ƌcH `:tJݧp7""Qjr?$nocׯ_tƍ p ׮]{ܩS 1 mdJ4@7/ͭ<6e06aPtX7 '}Fr"&iw$;H!;b̙3g(pPp0s̡ݺu{hӧ~zρbŊ/9r5k֐nN0pݻA$-x-!z!>y  }!'*lG !ەHBs@tפzk#WѣG߈ seee[-ZD}txxx_IMC\aTIItG7^=e99DǤtL1kQQdXb\(ϗ5"#N D 6`PF2"V,|9++k=Q]enBKT39J5I8e=j[Ϲƒ!T<&>:t\oBBBeJz8$'G}SvR 9L']VJ-c$ti SP2r'aɹ@v̝;P #X;2oڴ ,5ˉG騨:Jq QxJoDa 7o&Ԓ+Jd2ףzq@t\V$].U*ڋE:MTQn+zrAVL8H=lذ,Qsqcp3g ;55uQJBle ` E + eĉ[Kגe {5cn>nݔ)Sz|z3PAǏ=]ᾚ^r۷39߷otB}pOzn#{.ȁS_Kk9I gϞݗt,==}%(h^{`]g@{?t[M-hiڵ߽+@^p$~ u/ٙn4{fϞM4YQ8N2ͪdZgPoX!pw:uj6 |-OkMY:9IOYqq1Ue@#piR+mfÎ;.A5u\PA1ooΝx7 &#`aR_]z>{_~I&ż>QTTƍɘUӦM; ,*le\9v=͛7!߿p!>%%%  $8&fټ|ѣt]tNpOwᄍlٲ#7o s,' 6rB$>{%e7![<8tA&ѓjsyV.#"֬"@]:qr*:&~,ӢVIENDB`uget-2.0.2/pixmaps/Makefile.in0000664000175000017500000003746712574542540013161 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = pixmaps DIST_COMMON = $(dist_ugetpixmap_DATA) $(nobase_dist_icons_DATA) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(ugetpixmapdir)" "$(DESTDIR)$(iconsdir)" DATA = $(dist_ugetpixmap_DATA) $(nobase_dist_icons_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # icons installing path: # $(datadir)/icons/hicolor/16x16/apps/uget-icon.png # $(datadir)/icons/hicolor/22x22/apps/uget-icon.png # $(datadir)/icons/hicolor/24x24/apps/uget-icon.png # $(datadir)/icons/hicolor/32x32/apps/uget-icon.png # $(datadir)/icons/hicolor/48x48/apps/uget-icon.png # $(datadir)/icons/hicolor/64x64/apps/uget-icon.png # $(datadir)/icons/hicolor/96x96/apps/uget-icon.png # $(datadir)/icons/hicolor/128x128/apps/uget-icon.png # $(datadir)/icons/hicolor/scalable/apps/uget-icon.svg # iconsdir = $(datadir) nobase_dist_icons_DATA = \ icons/hicolor/16x16/apps/uget-icon.png \ icons/hicolor/22x22/apps/uget-icon.png \ icons/hicolor/24x24/apps/uget-icon.png \ icons/hicolor/32x32/apps/uget-icon.png \ icons/hicolor/48x48/apps/uget-icon.png \ icons/hicolor/64x64/apps/uget-icon.png \ icons/hicolor/96x96/apps/uget-icon.png \ icons/hicolor/128x128/apps/uget-icon.png \ icons/hicolor/scalable/apps/uget-icon.svg \ icons/hicolor/16x16/apps/uget-tray-default.png \ icons/hicolor/22x22/apps/uget-tray-default.png \ icons/hicolor/24x24/apps/uget-tray-default.png \ icons/hicolor/32x32/apps/uget-tray-default.png \ icons/hicolor/48x48/apps/uget-tray-default.png \ icons/hicolor/16x16/apps/uget-tray-downloading.png \ icons/hicolor/22x22/apps/uget-tray-downloading.png \ icons/hicolor/24x24/apps/uget-tray-downloading.png \ icons/hicolor/32x32/apps/uget-tray-downloading.png \ icons/hicolor/48x48/apps/uget-tray-downloading.png \ icons/hicolor/16x16/apps/uget-tray-error.png \ icons/hicolor/22x22/apps/uget-tray-error.png \ icons/hicolor/24x24/apps/uget-tray-error.png \ icons/hicolor/32x32/apps/uget-tray-error.png \ icons/hicolor/48x48/apps/uget-tray-error.png # pixmaps # ugetpixmapdir = $(datadir)/pixmaps/uget dist_ugetpixmap_DATA = logo.png # icons/hicolor/index.theme is needed by gtk_icon_theme_append_search_path() # EXTRA_DIST = icons/hicolor/index.theme all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pixmaps/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_ugetpixmapDATA: $(dist_ugetpixmap_DATA) @$(NORMAL_INSTALL) test -z "$(ugetpixmapdir)" || $(MKDIR_P) "$(DESTDIR)$(ugetpixmapdir)" @list='$(dist_ugetpixmap_DATA)'; test -n "$(ugetpixmapdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ugetpixmapdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(ugetpixmapdir)" || exit $$?; \ done uninstall-dist_ugetpixmapDATA: @$(NORMAL_UNINSTALL) @list='$(dist_ugetpixmap_DATA)'; test -n "$(ugetpixmapdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ugetpixmapdir)'; $(am__uninstall_files_from_dir) install-nobase_dist_iconsDATA: $(nobase_dist_icons_DATA) @$(NORMAL_INSTALL) test -z "$(iconsdir)" || $(MKDIR_P) "$(DESTDIR)$(iconsdir)" @list='$(nobase_dist_icons_DATA)'; test -n "$(iconsdir)" || list=; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo "$(MKDIR_P) '$(DESTDIR)$(iconsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(iconsdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(iconsdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(iconsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_dist_iconsDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_dist_icons_DATA)'; test -n "$(iconsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(iconsdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(ugetpixmapdir)" "$(DESTDIR)$(iconsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_ugetpixmapDATA \ install-nobase_dist_iconsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_ugetpixmapDATA \ uninstall-nobase_dist_iconsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_ugetpixmapDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nobase_dist_iconsDATA install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am \ uninstall-dist_ugetpixmapDATA uninstall-nobase_dist_iconsDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: uget-2.0.2/sounds/0000775000175000017500000000000012574544076011013 500000000000000uget-2.0.2/sounds/notification.wav0000664000175000017500000002540012317407515014130 00000000000000RIFF*WAVEfmt DXdata*EQJKF&0^$rA=W*{ u(0;7Vl=aZ>j|%@g!wou:_G.i;STe=_9J@358. 'cS?#u4DUK/I?u&Auv&3Yq@5tK>+02r2{/s*h9 ^2wZY)*^.GCWP3]b_`P]Q2yend8,)O?7+k(o<0dNX`Gy<;8F*KLT;(Dx(Z]~XW]*k}HfjI 107dqQOZ<ZB>p|fXGt2;L+p7yb.N|[!F uKh3 T dM>Uux_& H zyO?#jZS& .@hLK8n\jBG5 V1XF 3xb(Z|6%S6$[sr%Q]+ ` y[eN-W2v/L &?VHELL\0%qz\^ ,9)|$nSXC4ko !J"4E.kCF5UxUdpI B "Q( ] e@ +V9<2q}b@{ 7uEgI{ +Xp&x 0&aZ 2=[#N 9N\mi K,/a'Y z/dV/)oz5-#h+:) j Ob>eq[I} _ zY 2 qG8` J? 7gJ . zo  d Yr'uY -Zk h\  +iKYo7OEI# 'e9 EV{ +.n$ϓ> [S *WMYX^ C9.k B$|oLKۅ*6ZF [ !bVٹu_Iݵ ,F˔) ' Iĉ3/` ' d-9+2X_?VRZxd3C#8 ')l%K/&3?>'-#Ԥah2M'4AC=_#AAG])"w1<<=B_ mlKqۯD78q{B2/S0GC'`ߒ&M$8oY@V$a>Ph-ݳ$43:*c4! 6֜>!L7$K!$&.?PO@S@,-( : Yfb. K<4۷8P(7 ?B_(t5\) !>A?WK QUlI5փ(6<ZYϧ,☦o 2`*Җ76 C x!cy7ϝ+)`$ _ ;.t}h Ԍ[ɨ xHMI3!cܶFŝ P L5B#>/:!V*6 [/Y&޽q )i[<`ߊ gJIGO.%c,%_2!UD#4)c"8% Ej}\Jd+X9%J $s'! TY E )H) NԼ G #iPߠҙ*/3RŗCU HT?< EJ* 0aJT,Hӛ΄4h9jz[8hԴ޶naA07= On0GBG70&)&\=INE8:ImD04>:X ~[[ ;"lӥZ8+ȼōʸ /$3Gp#P#GἹdI| 0 = -%~X),) oYħx%*Е ܍ާǼ PB=? ':q= D- $=)4>599(/"CfF ',37Kl5!!&7XEB:P38b:&"?a ?EԼ?,U$@8  * Lh&*R*g?>DNOLK!TO=;#BXPA=9?;gAMjPKGB;];J5!U3Z.6 , v t:hK*zj,-z 2,& ~/QCH9L6,B::t..7|OYGG?PFKQU?\-87?#7s D'-6+ j&  Xί%`wp-7s0< * 6b)hn-2%Vl(UU|-y+kBH7# 184! Pg!  Te.p ۍe7 (Ґ`QfXv mj<O  _ m 1d+0J-\$#)r(QPQ+* +  nkwj#:ӱL%FNt&pk\* M "HK O|U pq2\iߕQݷ*ކ=ǚEΓէqvnҰߑ*AaUg$7\ }  7LL 4 ]o rF-mפO݀pطU)԰ '}!X1  \S z 9 ; b  {f{`E{g(8gٚB֣oޣݐOո)?OY?@ n p _##!0W1]ffS+7'UgD>XY tir 'Fbd_$!!!L M D @nz+/' 'ON/fߑ |.R.1 " 5 O a#!!%"s5; ' 9  "4=3c-y.vC[=T] 9KcyI'?e ='0  /H 4@\qib = 2 { `)7?axd, = 7kG m HW+  " h]H1eB]G@ L | 8z4tLpE#9OARSi^ & B $8(1 r|Du d[Jp_OQ~d$V[ ~r="zD N s qJQ>$4k|S6vE"p"6 r c "j \ |6sMj j]c^I1{L5O}k?YjnT ouf  i - W<;n`Zpd _D@W{IxeUoG2  5 b S j5o x C j !Ac\';Qa {C 6g y- S +V *  4  : _ , y&9/[W8X:*mUD/ )1< v Y m+],dQ Q_C!n=> (Jr$3UkrZ)  " 5v_zi4/i[vIE (iI\ sd 7   S 2 Q Co'LGD)@|$G+p)@\V0M-^5(-+:>+Z`|SY8bi{G+'UN<>G"M6-pmV d>!vQf; "Lh';.-Dbj~zB#z`$c Q  W/q' B84A#jofP=+R0 ?:<[ jWb3eK6.9PkD7u ^r\{5]4It'k*3%gt^P4hhb= >W~5B>g :d 8 ~\/PV(ZB2bSseK F]j}piXIc ] xUu}8}NOw% .'hKjmd]4`'D,b3;iFJ(o$=c8ZYL|W ;:0o;U`Le.iDB<V2Dk5 z3kV:JEj`A(-k5O  |7O#"X-L>xw9C .Ot5Zjro#tK@Jm@?]BKQMXC#5^nYM9Y,7mo8-rIs,~j@bZ2}6 { KUDqIiE\dLry.R&N&S78(}w <~B$'PFo)E}Bcpvqw| 9saX|>8h\w( X2Nie@.4R>]Ffhc[qs;  J-6$ 0yIVyub>JMSe"(Qz 9;Oxx,B2ec:3pE^}$eq I(21Gp\nZ[P6T[JA6!@1NcF[yunk=36%O9 7} hT ,`ksy<%?mb@ZR\>npS\fsw`C8 YW}@u}yuI@2rjb| 6+*PsH,#(<O-A^!yw`@MjE8SjU=k 0aRz#"'f[I63mF#D3+:Um;rsFbkk%8&Jzg3WYTs[rDAmXO-+D0Gvss`fZF4g~5-:/T && m[YZzv?6Ze^z|` ,;C{bBcocn:]eM% =jqkz.5 Sub^g%6Oa:=31iB) 2Rsh]c 8 8RQg{rnzx\QfhrH18%|'7r 4;JuywqX=M>-E^O*vuSJM:&Lq!#,?Obv{YVSN( xwqvrhnt\KIYPRhsaSg3b}s\|\cdsjR5=8"  oZ`]T}"1_#0~7 kP_vwgVVfiPQq|qmgz<fj~uget-2.0.2/sounds/Makefile.am0000664000175000017500000000014112317407515012752 00000000000000soundsdir = $(datadir)/sounds/uget sounds_DATA = notification.wav EXTRA_DIST = $(sounds_DATA) uget-2.0.2/sounds/Makefile.in0000664000175000017500000003121712574542540012776 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = sounds DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(soundsdir)" DATA = $(sounds_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ soundsdir = $(datadir)/sounds/uget sounds_DATA = notification.wav EXTRA_DIST = $(sounds_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sounds/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sounds/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-soundsDATA: $(sounds_DATA) @$(NORMAL_INSTALL) test -z "$(soundsdir)" || $(MKDIR_P) "$(DESTDIR)$(soundsdir)" @list='$(sounds_DATA)'; test -n "$(soundsdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(soundsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(soundsdir)" || exit $$?; \ done uninstall-soundsDATA: @$(NORMAL_UNINSTALL) @list='$(sounds_DATA)'; test -n "$(soundsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(soundsdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(soundsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-soundsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-soundsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-soundsDATA install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-soundsDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: uget-2.0.2/AUTHORS0000664000175000017500000000000012206517010010432 00000000000000uget-2.0.2/configure.ac0000664000175000017500000001442412574542505011706 00000000000000AC_INIT(uget, 2.0.2) ## Use automake (add automake to autogen.sh) AM_INIT_AUTOMAKE ## --- Use config.h (autogen.sh add autoheader) AC_CONFIG_HEADERS([config.h]) ## --- Determine a C compiler to use. AC_PROG_CC ## --- Check C compiler -c -o options. AM_PROG_CC_C_O ## --- Determine a C++ compiler to use. # AC_PROG_CXX ## --- Check for the ar command to use AM_PROG_AR ## Use library (static library) AC_PROG_RANLIB ## ---------------------------------------------- ## L10N (add intltoolize to autogen.sh) AC_PROG_INTLTOOL ## replace ALL_LINGUAS with po/LINGUAS # ALL_LINGUAS="" GETTEXT_PACKAGE="$PACKAGE" AC_SUBST(GETTEXT_PACKAGE) AM_GLIB_GNU_GETTEXT AM_GLIB_DEFINE_LOCALEDIR(LOCALEDIR) ## Use AM_GLIB_DEFINE_LOCALEDIR with AC_CONFIG_HEADERS ## ---------------------------------------------- ## GTK+ PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.4) ## ---------------- ## glib (add HAVE_GLIB definition to config.h) PKG_CHECK_EXISTS([glib-2.0], [have_glib="yes"], [have_glib="no"]) if test x$have_glib = xyes ; then PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if glib support is required.]) fi ## ---------------- ## pthread AC_CHECK_LIB(pthread, pthread_create,, [AC_MSG_ERROR([required library pthread missing])]) PTHREAD_CFLAGS="-pthread" PTHREAD_LIBS="-pthread" AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) ## ---------------- ## LFS AC_PATH_PROG(GETCONF, getconf) if test "x$GETCONF" != "x" ; then LFS_CFLAGS=`$GETCONF LFS_CFLAGS` LFS_LDFLAGS=`$GETCONF LFS_LDFLAGS` fi AC_SUBST(LFS_CFLAGS) AC_SUBST(LFS_LDFLAGS) ## ---------------- ## cURL AC_PATH_PROG(CURL_CONFIG, curl-config) if test "x$CURL_CONFIG" = "x" ; then AC_MSG_ERROR(Unable to find curl-config, please install libcurl) fi CURL_CFLAGS=`$CURL_CONFIG --cflags` CURL_LIBS=`$CURL_CONFIG --libs` let CURL_VERNUM=0x0`$CURL_CONFIG --vernum` let CURL_VERMIN=0x071301 # 7.19.1 if test $CURL_VERNUM -lt $CURL_VERMIN; then AC_MSG_ERROR(Requires libcurl version >= 7.19.1) fi AC_SUBST(CURL_CFLAGS) AC_SUBST(CURL_LIBS) ## ---------------- ## GnuTLS AC_ARG_WITH( [gnutls], AC_HELP_STRING([--with-gnutls[=@<:@no/auto/yes@:>@]], [Enable GnuTLS support. (default is auto)]), [with_gnutls="$withval"], [with_gnutls="no"] ) if test "x$with_gnutls" != "xno"; then # AC_CHECK_HEADER(gcrypt.h, [USE_GNUTLS_GCRYPT=1], [USE_GNUTLS_GCRYPT=0]) # if test "$USE_GNUTLS_GCRYPT" = "1"; then # LIBGCRYPT_CFLAGS="" # AC_SUBST(LIBGCRYPT_CFLAGS) # fi # AC_CHECK_HEADER(gcrypt/gcrypt.h, [USE_GNUTLS_GCRYPT=1], [USE_GNUTLS_GCRYPT=0]) # if test "$USE_GNUTLS_GCRYPT" = "1"; then # LIBGCRYPT_CFLAGS="" # AC_SUBST(LIBGCRYPT_CFLAGS, [""]) # fi # AC_CHECK_LIB(gcrypt, gcry_control, [USE_GNUTLS_GCRYPT=1], [USE_GNUTLS_GCRYPT=0]) # if test "$USE_GNUTLS_GCRYPT" = "1"; then # LIBGCRYPT_LIBS="-lgcrypt" # AC_SUBST(LIBGCRYPT_LIBS, ["-lgcrypt"]) # fi AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config) if test "x$LIBGCRYPT_CONFIG" = "x" ; then if test "x$with_gnutls" = "xyes"; then AC_MSG_ERROR(Unable to find libgcrypt-config, please install libgcrypt) fi else LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` AC_SUBST(LIBGCRYPT_CFLAGS) AC_SUBST(LIBGCRYPT_LIBS) AC_DEFINE(USE_GNUTLS, 1, [Define to 1 if gnutls support is required.]) fi fi ## ---------------- ## OpenSSL AC_ARG_WITH( [openssl], AC_HELP_STRING([--with-openssl[=@<:@no/yes@:>@]], [Enable OpenSSL support.]), [with_openssl="$withval"], [with_openssl="yes"] ) if test "x$LIBGCRYPT_CONFIG" = "x" ; then if test "x$with_openssl" = "xyes"; then PKG_CHECK_MODULES(LIBCRYPTO, libcrypto) AC_SUBST(LIBCRYPTO_CFLAGS) AC_SUBST(LIBCRYPTO_LIBS) AC_DEFINE(USE_OPENSSL, 1, [Define to 1 if openssl support is required.]) fi fi ## ---------------- ## libnotify AC_ARG_ENABLE( [notify], AC_HELP_STRING([--disable-notify], [Disable libnotify support.]), [enable_notify="$enableval"], [enable_notify="yes"] ) if test "x$enable_notify" = "xyes"; then PKG_CHECK_MODULES(LIBNOTIFY, libnotify) AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define to 1 if libnotify support is required.]) # for ArchLinux AC_SUBST(LIBNOTIFY_CFLAGS) AC_SUBST(LIBNOTIFY_LIBS) fi ## ---------------- ## appindicator AC_ARG_ENABLE( [appindicator], AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators.]), [enable_appindicator=$enableval], [enable_appindicator="auto"] ) if test x$enable_appindicator = xauto ; then PKG_CHECK_EXISTS([appindicator3-0.1], [enable_appindicator="yes"], [enable_appindicator="no"]) fi if test x$enable_appindicator = xyes ; then PKG_CHECK_MODULES(APP_INDICATOR, appindicator3-0.1) AC_SUBST(APP_INDICATOR_CFLAGS) AC_SUBST(APP_INDICATOR_LIBS) AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator]) fi ## ---------------- ## gstreamer AC_ARG_ENABLE( [gstreamer], AC_HELP_STRING([--disable-gstreamer], [Disable GStreamer audio support.]), [enable_gstreamer="$enableval"], [enable_gstreamer="yes"] ) if test "x$enable_gstreamer" = "xyes"; then PKG_CHECK_EXISTS([gstreamer-1.0], [enable_gstreamer1="yes"], [enable_gstreamer1="no"]) fi if test "x$enable_gstreamer1" = "xyes"; then PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0) AC_DEFINE(HAVE_GSTREAMER, 1, [Define to 1 if gstreamer support is required.]) # for ArchLinux AC_SUBST(GSTREAMER_CFLAGS) AC_SUBST(GSTREAMER_LIBS) elif test "x$enable_gstreamer" = "xyes"; then PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10) AC_DEFINE(HAVE_GSTREAMER, 1, [Define to 1 if gstreamer support is required.]) # for ArchLinux AC_SUBST(GSTREAMER_CFLAGS) AC_SUBST(GSTREAMER_LIBS) fi ## ----------------- ## libpwmd AC_ARG_ENABLE( [pwmd], AC_HELP_STRING([--enable-pwmd], [Enable pwmd support.]), [enable_pwmd="$enableval"], [enable_pwmd="no"] ) if test "x$enable_pwmd" = "xyes"; then PKG_CHECK_MODULES(LIBPWMD, [libpwmd-7.0 >= 7.0.0]) AC_DEFINE(HAVE_LIBPWMD, 1, [Define to 1 if libpwmd support is required.]) fi AM_CONDITIONAL([WITH_LIBPWMD], [test "x$enable_pwmd" = "xyes"]) ## ---------------------------------------------- ## output AC_CONFIG_FILES([ Makefile doc/Makefile tests/Makefile uget/Makefile uglib/Makefile ui-gtk/Makefile ui-gtk-1to2/Makefile pixmaps/Makefile sounds/Makefile po/Makefile.in Windows/Makefile ]) AC_OUTPUT uget-2.0.2/doc/0000775000175000017500000000000012574544077010246 500000000000000uget-2.0.2/doc/JSON-RPC_interface.txt0000664000175000017500000000124512520536321014124 00000000000000uGet JSON-RPC interface uGet provides JSON-RPC over TCP (localhost:14777). --------------------------------------- Method: uget.sendCommand This method send command-line arguments to uGet. Request sample { "jsonrpc": "2.0", "method": "uget.sendCommand", "params": [ "--user=foo", "--password=bar", "http://foo.bar.idv/test.mp4" ], "id": 1 } Response sample { "jsonrpc": "2.0", "result": true, "id": 1 } --------------------------------------- Method: uget.present This method can present uGet main window in screen. Request sample { "jsonrpc": "2.0", "method": "uget.present", "id": 1 } Response sample { "jsonrpc": "2.0", "result": true, "id": 1 } uget-2.0.2/doc/uget.txt0000664000175000017500000000457412332110677011670 00000000000000 UgNode | `- UgetNode (Root, Category, Download, File) ------------------------------------------------------------------------------- UgetNode Tree chart: Root -+- Category1 -+- Download1 (URI) -+- File | | | | | + X cookie or post file (attachment) | | | +- Download2 (URI) -+- File1 | | (torrent path) | | | +- File2 | | | | | +- torrent file (attachment) | | | +- Download3 (URI) -+- File | (metalink path) | | +- metalink file (attachment) +-- Category2 ------------------------------------------------------------------------------- UgetNode Tree chart for "All Category" Real node and Fake node: Real Fake L1 Fake L2 Category0 -+ Category1 -+--> all ------+--> all active Category2 -+ +--> all queuing +--> all finished +--> all recycled ------------------------------------------------------------------------------- UgetNode Tree chart for "All Status" Real node and Fake node: Real Fake Category -+--> active +--> queuing +--> finished +--> recycled | +--> sorted ------------------------------------------------------------------------------- 1 category has 1 json file. Below is sample file. Category-Home.json { "name": "Home", "info": { "common": {}, "proxy": {}, "http": {}, "ftp": {} }, "children": [ { "name": "download-file1", "info": { "common": {}, "proxy": {}, "http": {}, "ftp": {} }, "children": [ ] }, { "name": "download-file2", "info": { "common": {}, "proxy": {}, "http": {}, "ftp": {} }, "children": [ ] }, { "name": "download-file3", "info": { "common": {}, "proxy": {}, "http": {}, "ftp": {} }, "children": [ ] } ] } uget-2.0.2/doc/folders.txt0000664000175000017500000000173712520536143012357 00000000000000Source code folders: uglib (LGPL) This is low-level library for uget. It based on Standard C library, POSIX/Windows threads, Socket API, and libcurl. This folder has Android.mk, user can use it to build static library in Android. Add definition HAVE_GLIB if your program works with glib. uget (LGPL) This is is application core logic. (see functions defined in UgetApp.h) It contains curl and aria2 plug-in, download control, command line, and Queuing. This folder has Android.mk, user can use it to build static library in Android. Add definition HAVE_GLIB if your program works with glib. Add definition NDEBUG to disable debug code & message in plug-in. Add definition NO_RETRY_IF_CONNECT_FAILED to disable retry if connection failed. Add definition NO_URI_HASH to disable URI Hash Table (UgetHash). ui-gtk (LGPL) This is GTK+ user interface for uget. Some platform (or library) dependent code place here. ui-gtk-1to2 (LGPL) It can convert uGet for GTK+ data file from 1.10.x to 2.x uget-2.0.2/doc/Makefile.am0000664000175000017500000000010712520536321012200 00000000000000EXTRA_DIST = \ uget.txt \ folders.txt \ JSON-RPC_interface.txt uget-2.0.2/doc/Makefile.in0000664000175000017500000002501312574542540012225 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURL_CFLAGS = @CURL_CFLAGS@ CURL_CONFIG = @CURL_CONFIG@ CURL_LIBS = @CURL_LIBS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETCONF = @GETCONF@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@ GSTREAMER_LIBS = @GSTREAMER_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LDFLAGS = @LDFLAGS@ LFS_CFLAGS = @LFS_CFLAGS@ LFS_LDFLAGS = @LFS_LDFLAGS@ LIBCRYPTO_CFLAGS = @LIBCRYPTO_CFLAGS@ LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@ LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@ LIBOBJS = @LIBOBJS@ LIBPWMD_CFLAGS = @LIBPWMD_CFLAGS@ LIBPWMD_LIBS = @LIBPWMD_LIBS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ uget.txt \ folders.txt \ JSON-RPC_interface.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: uget-2.0.2/uglib/0000775000175000017500000000000012574544074010600 500000000000000uget-2.0.2/uglib/UgJsonrpcSocket.h0000664000175000017500000000747312477443373013771 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_JSONRPC_SOCKET_H #define UG_JSONRPC_SOCKET_H #include #ifdef __cplusplus extern "C" { #endif typedef struct UgJsonrpcSocket UgJsonrpcSocket; typedef struct UgSocketServer UgSocketServer; // ---------------------------------------------------------------------------- // UgJsonrpcSocket: JSON-RPC over Socket // +-----------------------------+ // | UgJsonrpcSocket | UgJsonrpcArray // buffer <--+--> UgJson <--> UgJsonrpc <--+--> or // | | UgJsonrpcObject // +-----------------------------+ #define UG_JSONRPC_SOCKET_MEMBERS \ UgJson json; \ UgJsonrpc rpc; \ UgBuffer buffer; \ int socket struct UgJsonrpcSocket { UG_JSONRPC_SOCKET_MEMBERS; // UgJson json; // UgJsonrpc rpc; // UgBuffer buffer; // int socket; }; void ug_jsonrpc_socket_init (UgJsonrpcSocket* jrsock); void ug_jsonrpc_socket_final (UgJsonrpcSocket* jrsock); // ------------------------------------ // Client API void ug_jsonrpc_socket_close (UgJsonrpcSocket* jrsock); int ug_jsonrpc_socket_connect (UgJsonrpcSocket* jrsock, const char* addr, const char* port_or_serv); #if !(defined _WIN32 || defined _WIN64) int ug_jsonrpc_socket_connect_unix (UgJsonrpcSocket* jrsock, const char* path, int path_len); #endif // ! (_WIN32 || _WIN64) int ug_jsonrpc_socket_send (UgJsonrpcSocket* jrsock); int ug_jsonrpc_socket_receive (UgJsonrpcSocket* jrsock); // ------------------------------------ // Server API // one thread handle all connection void ug_jsonrpc_socket_use_server (UgJsonrpcSocket* jrsock, UgSocketServer* server, UgJsonrpcServerFunc callback, void* data, void* data2); // one thread handle one connection void ug_socket_server_run_jsonrpc (UgSocketServer* server, UgJsonrpcServerFunc callback, void* data, void* data2); #ifdef __cplusplus } #endif #endif // UG_JSONRPC_SOCKET_H uget-2.0.2/uglib/UgJsonrpc.h0000664000175000017500000001737112477443373012616 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_JSONRPC_H #define UG_JSONRPC_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgJsonrpc UgJsonrpc; typedef struct UgJsonrpcError UgJsonrpcError; typedef struct UgJsonrpcObject UgJsonrpcObject; typedef UG_ARRAY(UgJsonrpcObject*) UgJsonrpcArray; typedef void (*UgJsonrpcServerFunc) (UgJsonrpc* jrpc, void* data, void* data2); // UgEntry for JSON parser and writer extern const UgEntry UgJsonrpcErrorEntry[]; extern const UgEntry UgJsonrpcObjectEntry[]; // ---------------------------------------------------------------------------- // UgJsonrpcError: JSON-RPC error object struct UgJsonrpcError { // JSON-RPC error code: // -32700 Parse error. Invalid JSON was received by the server. // An error occurred on the server while parsing the JSON text. // -32600 Invalid Request The JSON sent is not a valid Request object. // -32601 Method not found The method does not exist / is not available. // -32602 Invalid params Invalid method parameter(s). // -32603 Internal error Internal JSON-RPC error. int code; char* message; // This may be omitted. // A Primitive or Structured value that contains additional information about the error. // The value of this member is defined by the Server // (e.g. detailed error information, nested errors etc.). UgValue data; }; // ---------------------------------------------------------------------------- // UgJsonrpcObject struct UgJsonrpcObject { // char* jsonrpc; // version string // A Notification is a Request object without an "id" member. UgValue id; // request char* method; const char* method_static; // This member MAY be omitted. UgValue params; // response // This member MUST NOT exist if there was an error. UgValue result; // This member MUST NOT exist if there was no error. UgJsonrpcError error; }; UgJsonrpcObject* ug_jsonrpc_object_new (void); void ug_jsonrpc_object_free (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_init (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_clear (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_clear_request (UgJsonrpcObject* jrobj); void ug_jsonrpc_object_clear_response (UgJsonrpcObject* jrobj); // check request, and return error code. //int ug_jsonrpc_object_check (UgJsonrpcObject* jrobj); // parser: ug_json_parse_entry // writer: ug_json_write_entry will output all value in UgJsonrpcObject. // use below function to output JSON-RPC request and response object void ug_json_write_rpc_object (UgJson* json, UgJsonrpcObject* jrobj); // ---------------------------------------------------------------------------- // UgJsonrpcArray: a UgJsonrpcObject array for batch //void ug_jsonrpc_array_init (UgJsonrpcArray* joarray, int allocated_len); #define ug_jsonrpc_array_init(array, allocated_len) \ ug_array_init (array, sizeof (UgJsonrpcObject*), allocated_len) // bool free_objects void ug_jsonrpc_array_clear (UgJsonrpcArray* joarray, int free_objects); UgJsonrpcObject* ug_jsonrpc_array_find (UgJsonrpcArray* joarray, UgValue* id, int* index); UgJsonrpcObject* ug_jsonrpc_array_alloc (UgJsonrpcArray* joarray); // ------------------------------------ UgJsonError ug_json_parse_rpc_array (UgJson* json, const char* name, const char* value, void* jrarray, void* none); // bool noArrayIfOk void ug_json_write_rpc_array (UgJson* json, UgJsonrpcArray* objects, int noArrayIfOk); // If program doesn't known incoming data type, // this function can parse UgJsonrpcArray or UgJsonrpcObject. // This function used by server. UgJsonError ug_json_parse_rpc_unknown (UgJson* json, const char* name, const char* value, void* jrarray, void* jrobject); // ---------------------------------------------------------------------------- // UgJsonrpc: JSON-RPC Client & Server // +-----------------------------+ // | UgJsonrpcXXXX | UgJsonrpcArray // buffer <--+--> UgJson <--> UgJsonrpc <--+--> or // | | UgJsonrpcObject // +-----------------------------+ // send/receive return input or output size // send/receive return -1 = error // receive return 0 if connection close typedef int (*UgJsonrpcFunc) (void* target); struct UgJsonrpc { UgJson* json; UgBuffer* buffer; UgJsonError error; // input/output function struct { UgJsonrpcFunc func; void* data; } send, receive; union { // client struct { intptr_t current; intptr_t previous; } id; // server struct { UgJsonrpcObject* object; UgJsonrpcArray* array; } request; } data; }; void ug_jsonrpc_init (UgJsonrpc* jrpc, UgJson* json, UgBuffer* buffer); void ug_jsonrpc_clear (UgJsonrpc* jrpc); // ------------------------------------ // client API : set response == NULL if this is notify request // if error occurred, return -1 int ug_jsonrpc_call (UgJsonrpc* jrpc, UgJsonrpcObject* request, UgJsonrpcObject* response); int ug_jsonrpc_call_batch (UgJsonrpc* jrpc, UgJsonrpcArray* request, UgJsonrpcArray* response); // ------------------------------------ // server API // return 0 if remote disconnected. // return -1 if error occurred. // if ok, return UG_JSON_ARRAY or UG_JSON_OBJECT and set jr_array or jr_object. int ug_jsonrpc_receive (UgJsonrpc* jrpc, UgJsonrpcObject* jr_object, UgJsonrpcArray* jr_array); int ug_jsonrpc_response (UgJsonrpc* jrpc, UgJsonrpcObject* jr_object); int ug_jsonrpc_response_batch (UgJsonrpc* jrpc, UgJsonrpcArray* jr_array); // This function used by UgJsonrpc server mode. UgJsonError ug_json_parse_rpc_request (UgJson* json, const char* name, const char* value, void* jsonrpc, void* type); #ifdef __cplusplus } #endif #endif // UG_JSONRPC_H uget-2.0.2/uglib/UgBuffer.h0000664000175000017500000000627412456470652012406 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_BUFFER_H #define UG_BUFFER_H #include #ifdef __cplusplus extern "C" { #endif typedef struct UgBuffer UgBuffer; typedef int (*UgBufferFunc) (UgBuffer* buffer); struct UgBuffer { char* beg; char* cur; char* end; // for writing: expand or flush buffer // for reading: expand or fill buffer // return > 0 if ok // return < 0 if error. // return = 0 if no more data (read) UgBufferFunc more; // flush/expand (write) or fill/expand (read) void* data; // extra data for UgBuffer.more() }; void ug_buffer_init_external (UgBuffer* buffer, char* exbuf, int length); void ug_buffer_init (UgBuffer* buffer, int length); void ug_buffer_clear (UgBuffer* buffer, int free_buffer); void ug_buffer_set_size (UgBuffer* buffer, int length); // UgBuffer.more() default function for external buffer. int ug_buffer_restart (UgBuffer* buffer); // UgBuffer.more() default function for internal buffer. int ug_buffer_expand (UgBuffer* buffer); void ug_buffer_fill (UgBuffer* buffer, char ch, int count); int ug_buffer_write (UgBuffer* buffer, const char* string, int length); void ug_buffer_write_data (UgBuffer* buffer, const char* binary, int length); #define ug_buffer_write_char(buffer, ch) \ { if ((buffer)->cur >= (buffer)->end) \ (buffer)->more (buffer); \ *(buffer)->cur++ = (char)(ch); \ } #define ug_buffer_length(buffer) (int)((buffer)->cur - (buffer)->beg) #define ug_buffer_allocated(buffer) (int)((buffer)->end - (buffer)->beg) #define ug_buffer_remain(buffer) (int)((buffer)->end - (buffer)->cur) #ifdef __cplusplus } #endif #endif // UG_BUFFER_H uget-2.0.2/uglib/UgDefine.h0000664000175000017500000000537512477443373012373 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_DEFINE_H #define UG_DEFINE_H #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_GLIB #include #define ug_malloc g_malloc #define ug_malloc0 g_malloc0 #define ug_realloc g_realloc #define ug_free g_free #else #include // malloc, calloc, free #define ug_malloc malloc #define ug_malloc0(size) calloc (1, size) #define ug_realloc realloc #define ug_free free #endif #ifdef __cplusplus extern "C" { #endif typedef void (*UgInitFunc) (void* instance); typedef void (*UgFinalFunc) (void* instance); typedef void* (*UgCreateFunc) (void); typedef void (*UgDeleteFunc) (void* instance); typedef void (*UgNotifyFunc) (void* user_data); typedef void (*UgForeachFunc)(void* instance, void* data); typedef int (*UgCompareFunc)(const void* a, const void* b); #if defined _WIN32 || defined _WIN64 #define UG_DIR_SEPARATOR '\\' #define UG_DIR_SEPARATOR_S "\\" #else #define UG_DIR_SEPARATOR '/' #define UG_DIR_SEPARATOR_S "/" #endif // _WIN32 || _WIN64 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #ifdef __cplusplus } #endif #endif // UG_DEFINE_H uget-2.0.2/uglib/UgStdio.c0000664000175000017500000002207112477443373012246 00000000000000/* * * Copyright (C) 2005-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #if defined _WIN32 || defined _WIN64 #define _CRT_SECURE_NO_DEPRECATE // avoid some warning (MS VC 2005) #include #include // _wmkdir(), _wrmdir() #endif #include #include #include #include #if defined _WIN32 || defined _WIN64 int ug_open (const char* filename_utf8, int flags, int mode) { int retval; int save_errno; wchar_t *wfilename = ug_utf8_to_utf16 (filename_utf8, -1, NULL); if (wfilename == NULL) { errno = EINVAL; return -1; } retval = _wopen (wfilename, flags, mode); save_errno = errno; ug_free (wfilename); errno = save_errno; return retval; } int ug_creat (const char* filename_utf8, int mode) { int retval; int save_errno; wchar_t *wfilename = ug_utf8_to_utf16 (filename_utf8, -1, NULL); if (wfilename == NULL) { errno = EINVAL; return -1; } retval = _wcreat (wfilename, mode); save_errno = errno; ug_free (wfilename); errno = save_errno; return retval; } int ug_truncate (int fd, int64_t length) { HANDLE h_file; if (ug_seek (fd, length, SEEK_SET) == 0) { h_file = (HANDLE)_get_osfhandle(fd); if (SetEndOfFile (h_file)) return 0; } return -1; } FILE* ug_fopen (const char *filename, const char *mode) { FILE *retval; int save_errno; wchar_t *wfilename = ug_utf8_to_utf16 (filename, -1, NULL); wchar_t *wmode; if (wfilename == NULL) { errno = EINVAL; return NULL; } wmode = ug_utf8_to_utf16 (mode, -1, NULL); if (wmode == NULL) { ug_free (wfilename); errno = EINVAL; return NULL; } retval = _wfopen (wfilename, wmode); save_errno = errno; ug_free (wfilename); ug_free (wmode); errno = save_errno; return retval; } // ---------------------------------------------------------------------------- // UNIX #else #if defined (HAVE_GLIB) int ug_open (const char* filename_utf8, int flags, int mode) { if (g_get_filename_charsets (NULL)) return g_open (filename_utf8, flags, mode); else { gchar *cp_filename = g_filename_from_utf8 (filename_utf8, -1, NULL, NULL, NULL); int retval; int save_errno; if (cp_filename == NULL) { errno = EINVAL; return -1; } retval = g_open (cp_filename, flags, mode); save_errno = errno; g_free (cp_filename); errno = save_errno; return retval; } } int ug_creat (const char* filename_utf8, int mode) { if (g_get_filename_charsets (NULL)) return g_open (filename_utf8, mode); else { gchar *cp_filename = g_filename_from_utf8 (filename_utf8, -1, NULL, NULL, NULL); int retval; int save_errno; if (cp_filename == NULL) { errno = EINVAL; return -1; } retval = g_creat (cp_filename, mode); save_errno = errno; g_free (cp_filename); errno = save_errno; return retval; } } FILE* ug_fopen (const char *filename, const char *mode) { if (g_get_filename_charsets (NULL)) return g_fopen (filename, mode); else { gchar *cp_filename = g_filename_from_utf8 (filename, -1, NULL, NULL, NULL); FILE *retval; int save_errno; if (cp_filename == NULL) { errno = EINVAL; return NULL; } retval = g_fopen (cp_filename, mode); save_errno = errno; g_free (cp_filename); errno = save_errno; return retval; } } #endif // HAVE_GLIB #endif // _WIN32 || _WIN64 #ifdef __ANDROID__ #include int fseek_64 (FILE *stream, int64_t offset, int origin) { int fd; if (feof (stream)) { rewind (stream); } else { setbuf (stream, NULL); // clear buffer of fread() } fd = fileno (stream); if (lseek64 (fd, offset, origin) == -1) { return errno; } return 0; } int64_t ftell_64 (FILE *stream) { int fd; fd = fileno (stream); return lseek (fd, 0L, SEEK_CUR); } #endif // __ANDROID__ int ug_ftruncate (FILE* file, int64_t size) { int fd; ug_fflush (file); ug_fseek (file, size, SEEK_SET); fd = ug_fileno (file); return ug_truncate (fd, size); } // ---------------------------------------------------------------------------- // file & directory functions #if defined _WIN32 || defined _WIN64 int ug_rename (const char *old_filename, const char *new_filename) { wchar_t *wold_filename = ug_utf8_to_utf16 (old_filename, -1, NULL); wchar_t *wnew_filename = ug_utf8_to_utf16 (new_filename, -1, NULL); int save_errno; int retval; if (wold_filename == NULL || wnew_filename == NULL) { ug_free (wold_filename); ug_free (wnew_filename); errno = EINVAL; return -1; } retval = _wrename (wold_filename, wnew_filename); save_errno = errno; ug_free (wold_filename); ug_free (wnew_filename); errno = save_errno; return retval; } int ug_unlink (const char *filename) { wchar_t *wfilename = ug_utf8_to_utf16 (filename, -1, NULL); int save_errno; int retval; if (wfilename == NULL) { errno = EINVAL; return -1; } retval = _wunlink (wfilename); save_errno = errno; ug_free (wfilename); errno = save_errno; return retval; } int ug_create_dir (const char *dir_utf8) { wchar_t *wfilename = ug_utf8_to_utf16 (dir_utf8, -1, NULL); int save_errno; int retval; if (wfilename == NULL) { errno = EINVAL; return -1; } retval = _wmkdir (wfilename); save_errno = errno; ug_free (wfilename); errno = save_errno; return retval; } int ug_delete_dir (const char *dir_utf8) { wchar_t *wfilename = ug_utf8_to_utf16 (dir_utf8, -1, NULL); int save_errno; int retval; if (wfilename == NULL) { errno = EINVAL; return -1; } retval = _wrmdir (wfilename); save_errno = errno; ug_free (wfilename); errno = save_errno; return retval; } // ---------------------------------------------------------------------------- // UNIX #else #if defined (HAVE_GLIB) int ug_rename (const gchar *old_filename, const gchar *new_filename) { if (g_get_filename_charsets (NULL)) return g_rename (old_filename, new_filename); else { gchar *cp_old_filename = g_filename_from_utf8 (old_filename, -1, NULL, NULL, NULL); gchar *cp_new_filename = g_filename_from_utf8 (new_filename, -1, NULL, NULL, NULL); int save_errno; int retval; if (cp_old_filename == NULL || cp_new_filename == NULL) { g_free (cp_old_filename); g_free (cp_new_filename); errno = EINVAL; return -1; } retval = g_rename (cp_old_filename, cp_new_filename); save_errno = errno; g_free (cp_old_filename); g_free (cp_new_filename); errno = save_errno; return retval; } } int ug_unlink (const gchar *filename) { if (g_get_filename_charsets (NULL)) return g_unlink (filename); else { gchar *cp_filename = g_filename_from_utf8 (filename, -1, NULL, NULL, NULL); int save_errno; int retval; if (cp_filename == NULL) { errno = EINVAL; return -1; } retval = g_unlink (cp_filename); save_errno = errno; g_free (cp_filename); errno = save_errno; return retval; } } int ug_create_dir (const gchar *dir_utf8) { if (g_get_filename_charsets (NULL)) return g_mkdir (dir_utf8, 0755); else { gchar *cp_filename = g_filename_from_utf8 (dir_utf8, -1, NULL, NULL, NULL); int save_errno; int retval; if (cp_filename == NULL) { errno = EINVAL; return -1; } retval = g_mkdir (cp_filename, 0755); save_errno = errno; g_free (cp_filename); errno = save_errno; return retval; } } int ug_delete_dir (const gchar *dir_utf8) { if (g_get_filename_charsets (NULL)) return g_rmdir (dir_utf8); else { gchar *cp_filename = g_filename_from_utf8 (dir_utf8, -1, NULL, NULL, NULL); int save_errno; int retval; if (cp_filename == NULL) { errno = EINVAL; return -1; } retval = g_rmdir (cp_filename); save_errno = errno; g_free (cp_filename); errno = save_errno; return retval; } } #endif // HAVE_GLIB #endif // _WIN32 || _WIN64 uget-2.0.2/uglib/UgString.c0000664000175000017500000002011712574542505012424 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include // vsnprintf #include #include #include // ---------------------------------------------------------------------------- // String #if !(defined HAVE_GLIB) char* ug_strdup_printf (const char* format, ...) { va_list arg_list; char* string; int string_len; va_start (arg_list, format); #ifdef _MSC_VER /* for M$ C only */ string_len = _vscprintf (format, arg_list); #else /* for C99 standard */ string_len = vsnprintf (NULL, 0, format, arg_list); #endif va_end (arg_list); string = ug_malloc (string_len + 1); va_start (arg_list, format); vsprintf (string, format, arg_list); va_end (arg_list); return string; } char* ug_strndup (const char* string, size_t length) { char* result; result = ug_malloc (length + 1); result[length] = 0; strncpy (result, string, length); return result; } #endif // ! (HAVE_GLIB) // return length of new string int ug_str_remove_crlf (const char* src, char* dest) { int length = 0; if (src) { for (; ; src++) { if (src[0] == '\r' || src[0] == '\n') continue; if (dest) *dest++ = *src; if (src[0] == 0) break; length++; } } return length; } // return number of characters was replaced by to_char int ug_str_replace_chars (char* str, const char* from_chars, int to_char) { char* cur; int counts; for (counts = 0, cur = str; ; counts++) { cur = strpbrk (cur, from_chars); if (cur == NULL) break; cur[0] = to_char; } return counts; } /* * convert double to string * If value large than 1024, it will append unit string like "KiB", * "MiB", "GiB", "TiB", or "PiB" to string. */ char* ug_str_from_int_unit (int64_t value, const char* tail) { static const char* unit_array[] = {"", " KiB", " MiB", " GiB", " TiB", " PiB"}; static const int unit_array_len = sizeof (unit_array) / sizeof (char*); int index; for (index=0; index < unit_array_len -1; index++) { // if (value < 1024) if (value < 10000) break; // value /= 1024; value >>= 10; } return ug_strdup_printf ("%d%s%s", (int)value, unit_array[index], (tail) ? tail : ""); } /* * convert seconds to string (hh:mm:ss) */ char* ug_str_from_seconds (int seconds, int limit_99_99_99) { int hour, minute; int day, year; minute = seconds / 60; hour = minute / 60; minute = minute % 60; seconds = seconds % 60; if (hour < 100) return ug_strdup_printf ("%.2d:%.2d:%.2d", hour, minute, seconds); else if (limit_99_99_99) return ug_strdup ("99:99:99"); else { day = hour / 24; year = day / 365; if (year) return ug_strdup ("> 1 year"); else return ug_strdup_printf ("%u days", day); } } /* * convert time_t to string */ char* ug_str_from_time (time_t ptt, int date_only) { struct tm* timem; timem = localtime (&ptt); if (timem == NULL) return NULL; if (date_only) { return ug_strdup_printf ("%.4d-%.2d-%.2d", timem->tm_year + 1900, timem->tm_mon + 1, timem->tm_mday); } else { return ug_strdup_printf ("%.4d-%.2d-%.2d" " %.2d:%.2d:%.2d", timem->tm_year + 1900, timem->tm_mon + 1, timem->tm_mday, timem->tm_hour, timem->tm_min, timem->tm_sec); } } static const char* month_string[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; time_t ug_str_rfc822_to_time (const char* string) { struct tm timem; const char* cur; const char* end; int idx; end = string + strlen (string); // day if ((cur = string + 5) >= end) return -1; timem.tm_mday = strtoul (cur, NULL, 10); // month if ((cur += 3) >= end) return -1; for (idx = 0; idx < 12; idx++) { if (strncmp (cur, month_string[idx], 3) == 0) break; } if (idx == 12) return -1; timem.tm_mon = idx; // year if ((cur += 4) >= end) return -1; timem.tm_year = strtoul (cur, NULL, 10); // if (timem.tm_year < 50) // timem.tm_year += 100; // else if (timem.tm_year > 1000) timem.tm_year -= 1900; if ((cur = strchr (cur, ' ')) == NULL) return -1; cur++; // hour timem.tm_hour = strtoul (cur, NULL, 10); // minute if ((cur += 3) >= end) return -1; timem.tm_min = strtoul (cur, NULL, 10); // second if ((cur += 3) >= end) return -1; timem.tm_sec = strtoul (cur, NULL, 10); // zone // if ((cur += 3) >= end) // return -1; // other timem.tm_wday = 0; timem.tm_yday = 0; timem.tm_isdst = -1; return mktime (&timem); } time_t ug_str_rfc3339_to_time (const char* string) { struct tm timem; const char* cur; const char* end; end = string + strlen (string); // year timem.tm_year = strtoul (string, NULL, 10); timem.tm_year -= 1900; if ((cur = strchr (string, '-')) == NULL) return -1; cur++; // month timem.tm_mon = strtoul (cur, NULL, 10); if (timem.tm_mon > 0) timem.tm_mon -= 1; // day if ((cur += 3) >= end) return -1; timem.tm_mday = strtoul (cur, NULL, 10); // hour if ((cur += 3) >= end) return -1; timem.tm_hour = strtoul (cur, NULL, 10); // minute if ((cur += 3) >= end) return -1; timem.tm_min = strtoul (cur, NULL, 10); // second if ((cur += 3) >= end) return -1; timem.tm_sec = strtoul (cur, NULL, 10); // zone if ((cur = strpbrk (cur, "+-")) == NULL) return -1; // other timem.tm_wday = 0; timem.tm_yday = 0; timem.tm_isdst = -1; return mktime (&timem); } // ------------------------------------ // command-line char** ug_argv_from_cmd (const char* cmd, int* argc, int reserve_len) { int argn; char** argv; char* buf; char* beg; char* cur; char* end; char* quote = NULL; // pointer to '\"' for (argn = 0, cur = (char*)cmd; ; argn++) { if (cur[0] == 0) { end = cur; break; } while (cur[0] != ' ' && cur[0]) cur++; while (cur[0] == ' ') cur++; } // malloc size include buffer and null-terminated argv = ug_malloc (sizeof (char*) * (argn+2+reserve_len)); buf = ug_strdup (cmd); end = buf + (end - cmd); // argv[-1] == buf *argv++ = buf; for (argn = reserve_len, beg = buf, cur = buf; cur[0]; ) { switch (cur[0]) { default: cur++; break; case '\"': // overwrite '\"', must include null-terminated memmove (cur, cur+1, end - cur); if (quote == NULL) quote = cur; else quote = NULL; break; case ' ': if (quote == NULL) { argv[argn++] = beg; while (cur[0] == ' ') *cur++ = 0; beg = cur; } break; } } if (beg[0]) argv[argn++] = beg; if (argc) argc[0] = argn; argv[argn++] = NULL; // null-termainate return argv; } void ug_argv_free (char** ug_argv) { ug_free (ug_argv[-1]); ug_free (ug_argv-1); } uget-2.0.2/uglib/UgJson.c0000664000175000017500000006225512520536321012066 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif // parser & writer #include // uintptr_t #include // offsetof () #include // strlen // writer #include // INT_MAX #include // va_list, va_start, va_end #include // vsnprintf // uglib #include #include #define BUFFER_SIZE 128 #define IGNORE_ERROR_IN_SEPARATOR 1 #define IGNORE_ERROR_IN_OBJECT 1 #define IGNORE_ERROR_IN_ARRAY 1 void ug_json_init (UgJson* json) { // initialize buffer json->buf.allocated = BUFFER_SIZE; json->buf.length = 0; json->buf.at = ug_malloc (json->buf.allocated); // initialize stack json->stack.allocated = 16 * 4; // 16 x PARSER_STACK_UNIT json->stack.length = 0; json->stack.at = ug_malloc (sizeof (void*) * json->stack.allocated); } void ug_json_final (UgJson* json) { ug_free (json->buf.at); ug_free (json->stack.at); } // ---------------------------------------------------------------------------- // JSON Parser functions // UgJsonState (include UgJsonType) are used by UgJson.state // for internal use only enum UgJsonState { UG_JSON_CONTROL = UG_JSON_N_TYPE, UG_JSON_UNICODE, UG_JSON_END_OA, // End of Object or Array UG_JSON_VALUE, // start of value UG_JSON_SEPARATOR, // ',' }; enum { PARSER_STACK_BASE, // 0 PARSER_STACK_TYPE, // 1 PARSER_STACK_DATA2, // 2 PARSER_STACK_DATA1, // 3 PARSER_STACK_FUNC, // 4 PARSER_STACK_UNIT = PARSER_STACK_FUNC, // equal with STACK_MULTIPLY_VALUE }; static void ug_json_call_parser (UgJson* json); void ug_json_begin_parse (UgJson* json) { // reset state json->count = 0; json->colon = 0; json->numberPoint = 0; json->numberPm = 0; json->numberEe = 0; json->index[0] = 0; json->index[1] = 0; // initialize state json->type = UG_JSON_VALUE; json->scope = 0; json->state = UG_JSON_VALUE; json->error = 0; // initialize buffer json->buf.at[0] = 0; json->buf.length = 1; } UgJsonError ug_json_end_parse (UgJson* json) { int stack_length; // clear stack stack_length = json->stack.length; json->stack.length = 0; if (stack_length > PARSER_STACK_UNIT) return UG_JSON_ERROR_UNCOMPLETED; if (json->index[0]) return UG_JSON_ERROR_UNCOMPLETED; if (json->index[1]) { if (json->type >= UG_JSON_N_TYPE) return UG_JSON_ERROR_UNCOMPLETED; // check uncompleted string. if (json->type == UG_JSON_STRING) { if (json->buf.at[json->buf.length-1] != 0) return UG_JSON_ERROR_UNCOMPLETED; } // null-terminated for UG_JSON_NUMBER. else if (json->type == UG_JSON_NUMBER) { if (json->stack.allocated == stack_length) { json->stack.allocated *= 2; json->stack.at = ug_realloc (json->stack.at, json->stack.allocated * sizeof (void*)); } json->buf.at[json->buf.length++] = 0; } // parse remain value ug_json_call_parser (json); return (UgJsonError) json->error; } return UG_JSON_ERROR_NONE; } void ug_json_set (UgJson* json, UgJsonParseFunc func, void* dest, void* data) { void** stack; stack = json->stack.at + json->stack.length; *(stack - PARSER_STACK_FUNC) = func; *(stack - PARSER_STACK_DATA1) = dest; *(stack - PARSER_STACK_DATA2) = data; } void ug_json_push (UgJson* json, UgJsonParseFunc func, void* dest, void* data) { void** stack; if (json->stack.allocated < json->stack.length + PARSER_STACK_UNIT) { json->stack.allocated *= 2; json->stack.at = ug_realloc (json->stack.at, json->stack.allocated * sizeof (void*)); } stack = json->stack.at + json->stack.length; *stack++ = func; *stack++ = dest; *stack++ = data; *stack++ = (void*)(uintptr_t)json->scope; json->stack.length += PARSER_STACK_UNIT; } void ug_json_pop (UgJson* json) { void** stack; uintptr_t scope; if (json->stack.length >= PARSER_STACK_UNIT) { stack = json->stack.at + json->stack.length; scope = (uintptr_t) *(stack - PARSER_STACK_TYPE); json->stack.length -= PARSER_STACK_UNIT; // End of Object or Array json->type = UG_JSON_END_OA; // restore state json->scope = scope; json->state = json->scope; // json->index[0] = 0; // json->index[1] = 0; } } UgJsonError ug_json_parse (UgJson* json, const char* string, int len) { const char* cur; const char* end; char vchar; if (len == -1) len = strlen (string); for (cur = string, end = string + len; cur < end; cur++) { if (json->buf.allocated == json->buf.length) { json->buf.allocated *= 2; json->buf.at = ug_realloc (json->buf.at, json->buf.allocated * sizeof (char)); } vchar = cur[0]; // begin of top level switch - select JSON part by state TopLevelSwitch: switch (json->state) { case UG_JSON_VALUE: if (json->index[1]) return UG_JSON_ERROR_EXCESS_VALUE; switch (vchar) { case ' ': case '\t': case '\n': case '\r': continue; // break; case '[': json->type = UG_JSON_ARRAY; ug_json_call_parser (json); json->type = UG_JSON_VALUE; // for ',' in array json->scope = UG_JSON_ARRAY; json->state = UG_JSON_VALUE; continue; // break; case '{': json->type = UG_JSON_OBJECT; ug_json_call_parser (json); json->type = UG_JSON_VALUE; // for ',' in object json->scope = UG_JSON_OBJECT; json->state = UG_JSON_OBJECT; continue; // break; case '\"': json->type = UG_JSON_STRING; json->state = UG_JSON_STRING; json->index[1] = json->buf.length; continue; // break; default: switch (vchar) { case 't': // true json->state = UG_JSON_TRUE; break; case 'f': // false json->state = UG_JSON_FALSE; break; case 'n': // null json->state = UG_JSON_NULL; break; default: // number or not if (vchar == '-' || (vchar >= '0' && vchar <= '9')) { json->type = UG_JSON_NUMBER; json->state = UG_JSON_NUMBER; } else { json->state = json->scope; goto TopLevelSwitch; } break; } json->count = 1; json->index[1] = json->buf.length; json->buf.at[json->buf.length++] = vchar; continue; // break; } break; case UG_JSON_OBJECT: switch (vchar) { case '\"': if (json->index[0]) return UG_JSON_ERROR_EXCESS_NAME; json->index[0] = json->buf.length; json->state = UG_JSON_STRING; continue; // break; case ':': if (json->colon) return UG_JSON_ERROR_EXCESS_COLON; if (json->index[0] == 0) return UG_JSON_ERROR_BEFORE_COLON; json->type = UG_JSON_VALUE; json->colon = 1; json->state = UG_JSON_VALUE; continue; // break; case ' ': case '\t': case '\n': case '\r': continue; // break; case ',': #ifdef IGNORE_ERROR_IN_SEPARATOR // if type is UG_JSON_VALUE or UG_JSON_SEPARATOR if (json->type >= UG_JSON_VALUE) { json->error = UG_JSON_ERROR_IN_SEPARATOR; json->type = UG_JSON_SEPARATOR; continue; // break; } #else // if type is UG_JSON_VALUE or UG_JSON_SEPARATOR if (json->type >= UG_JSON_VALUE) return UG_JSON_ERROR_IN_SEPARATOR; #endif // IGNORE_ERROR_IN_SEPARATOR ug_json_call_parser (json); json->type = UG_JSON_SEPARATOR; continue; // break; case '}': #ifdef IGNORE_ERROR_IN_OBJECT if (json->type == UG_JSON_SEPARATOR) { json->error = UG_JSON_ERROR_IN_OBJECT; ug_json_pop (json); continue; // break; } #else if (json->type == UG_JSON_SEPARATOR) return UG_JSON_ERROR_IN_OBJECT; #endif // IGNORE_ERROR_IN_OBJECT ug_json_call_parser (json); ug_json_pop (json); continue; // break; default: #ifdef IGNORE_ERROR_IN_OBJECT json->error = UG_JSON_ERROR_IN_OBJECT; continue; // break; #else return UG_JSON_ERROR_IN_OBJECT; #endif // IGNORE_ERROR_IN_OBJECT } break; case UG_JSON_ARRAY: switch (vchar) { case ' ': case '\t': case '\n': case '\r': continue; // break; case ',': #ifdef IGNORE_ERROR_IN_SEPARATOR // if type is UG_JSON_VALUE or UG_JSON_SEPARATOR if (json->type >= UG_JSON_VALUE) { json->error = UG_JSON_ERROR_IN_SEPARATOR; json->type = UG_JSON_SEPARATOR; json->state = UG_JSON_VALUE; continue; // break; } #else // if type is UG_JSON_VALUE or UG_JSON_SEPARATOR if (json->type >= UG_JSON_VALUE) return UG_JSON_ERROR_IN_SEPARATOR; #endif // IGNORE_ERROR_IN_SEPARATOR ug_json_call_parser (json); json->type = UG_JSON_SEPARATOR; json->state = UG_JSON_VALUE; continue; // break; case ']': #ifdef IGNORE_ERROR_IN_ARRAY if (json->type == UG_JSON_SEPARATOR) { json->error = UG_JSON_ERROR_IN_ARRAY; ug_json_pop (json); continue; // break; } #else if (json->type == UG_JSON_SEPARATOR) return UG_JSON_ERROR_IN_ARRAY; #endif // IGNORE_ERROR_IN_ARRAY ug_json_call_parser (json); ug_json_pop (json); continue; // break; default: #ifdef IGNORE_ERROR_IN_ARRAY json->error = UG_JSON_ERROR_IN_ARRAY; continue; // break; #else return UG_JSON_ERROR_IN_ARRAY; #endif // IGNORE_ERROR_IN_ARRAY } break; case UG_JSON_STRING: switch (vchar) { case '\"': // null-terminated json->buf.at[json->buf.length++] = 0; json->state = json->scope; continue; // break; case '\\': json->state = UG_JSON_CONTROL; continue; // break; default: json->buf.at[json->buf.length++] = vchar; continue; // break; } break; case UG_JSON_CONTROL: json->state = UG_JSON_STRING; switch (vchar) { case '\"': json->buf.at[json->buf.length++] = '\"'; continue; // break; case '\\': json->buf.at[json->buf.length++] = '\\'; continue; // break; case '/': json->buf.at[json->buf.length++] = '/'; continue; // break; case 'b': json->buf.at[json->buf.length++] = '\b'; continue; // break; case 'f': json->buf.at[json->buf.length++] = '\f'; continue; // break; case 'n': json->buf.at[json->buf.length++] = '\n'; continue; // break; case 'r': json->buf.at[json->buf.length++] = '\r'; continue; // break; case 't': json->buf.at[json->buf.length++] = '\t'; continue; // break; case 'u': json->state = UG_JSON_UNICODE; json->count = 0; continue; // break; default: return UG_JSON_ERROR_INVALID_CONTROL; } break; case UG_JSON_UNICODE: // convert unicode UTF-16 to UTF-8 json->buf.at[json->buf.length++] = vchar; if (++json->count == 4) { const char* putf; uint32_t value; json->state = UG_JSON_STRING; json->buf.length -= 4; // json->count = 0; // json->count must reset to 0 // get UTF-16 value from hex string putf = json->buf.at + json->buf.length; for (value = 0; json->count > 0; json->count--, putf++) { value <<= 4; vchar = putf[0]; if (vchar >= '0' && vchar <= '9') value += vchar - '0'; else if (vchar >= 'a' && vchar <= 'f') value += vchar - 'a' + 10; else if (vchar >= 'A' && vchar <= 'F') value += vchar - 'A' + 10; else return UG_JSON_ERROR_INVALID_UNICODE; } if (value >= 1 && value <= 0x7F) json->buf.at[json->buf.length++] = value; else if (value > 0x7FF) { json->buf.at[json->buf.length++] = 0xE0 | ((value >> 12) & 0x0F); json->buf.at[json->buf.length++] = 0x80 | ((value >> 6) & 0x3F); json->buf.at[json->buf.length++] = 0x80 | ((value >> 0) & 0x3F); } else { json->buf.at[json->buf.length++] = 0xC0 | ((value >> 12) & 0x1F); json->buf.at[json->buf.length++] = 0x80 | ((value >> 6) & 0x3F); } } break; case UG_JSON_TRUE: json->buf.at[json->buf.length++] = vchar; if (++json->count == 4) { if (strncmp ("true", json->buf.at + json->buf.length - 4, 4)) return UG_JSON_ERROR_INVALID_VALUE; json->type = UG_JSON_TRUE; json->state = json->scope; json->buf.at[json->buf.length++] = 0; // null-terminated } break; case UG_JSON_FALSE: json->buf.at[json->buf.length++] = vchar; if (++json->count == 5) { if (strncmp ("false", json->buf.at + json->buf.length - 5, 5)) return UG_JSON_ERROR_INVALID_VALUE; json->type = UG_JSON_FALSE; json->state = json->scope; json->buf.at[json->buf.length++] = 0; // null-terminated } break; case UG_JSON_NULL: json->buf.at[json->buf.length++] = vchar; if (++json->count == 4) { if (strncmp ("null", json->buf.at + json->buf.length - 4, 4)) return UG_JSON_ERROR_INVALID_VALUE; json->type = UG_JSON_NULL; json->state = json->scope; json->buf.at[json->buf.length++] = 0; // null-terminated } break; case UG_JSON_NUMBER: switch (vchar) { case '.': if (json->numberPoint || json->numberEe || json->numberPm) return UG_JSON_ERROR_INVALID_NUMBER; json->numberPoint = 1; break; case 'E': case 'e': if (json->numberEe || json->numberPm) return UG_JSON_ERROR_INVALID_NUMBER; json->numberEe = 1; break; case '+': case '-': if (json->numberPm || json->numberEe == 0) return UG_JSON_ERROR_INVALID_NUMBER; json->numberPm = 1; break; default: if (vchar < '0' || vchar > '9') { json->state = json->scope; json->buf.at[json->buf.length++] = 0; goto TopLevelSwitch; } break; } json->buf.at[json->buf.length++] = vchar; break; default: return UG_JSON_ERROR_UNKNOWN; } // end of top level switch } return json->error; } // UgJsonParseFunc for JSON that starting with array. UgJsonError ug_json_parse_array (UgJson* json, const char* name, const char* value, void* dest, void* data) { if (json->type != UG_JSON_ARRAY) { // pop this and previous parser ug_json_pop (json); ug_json_pop (json); return UG_JSON_ERROR_TYPE_NOT_MATCH; } // pop this parser only, use previous parser ug_json_pop (json); return UG_JSON_ERROR_NONE; } // UgJsonParseFunc for JSON that starting with object. UgJsonError ug_json_parse_object (UgJson* json, const char* name, const char* value, void* dest, void* data) { if (json->type != UG_JSON_OBJECT) { // pop this and previous parser ug_json_pop (json); ug_json_pop (json); return UG_JSON_ERROR_TYPE_NOT_MATCH; } // pop this parser only, use previous parser ug_json_pop (json); return UG_JSON_ERROR_NONE; } // UgJsonParseFunc for unknown object or array. UgJsonError ug_json_parse_unknown (UgJson* json, const char* name, const char* value, void* dest, void* data) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_NONE; } // static function static void ug_json_call_parser (UgJson* json) { UgJsonParseFunc parser; void** stack; char error; int stackLen; // get parser and data from stack if (json->stack.length && json->type < UG_JSON_N_TYPE) { stackLen = json->stack.length; stack = json->stack.at + json->stack.length; parser = *(stack - PARSER_STACK_FUNC); error = parser (json, json->buf.at + json->index[0], json->buf.at + json->index[1], *(stack - PARSER_STACK_DATA1), *(stack - PARSER_STACK_DATA2)); if (error) json->error = error; // It must push parser when getting UG_JSON_OBJECT or UG_JSON_ARRAY. // If callback function does NOT push any parser, push default one. if (json->type >= UG_JSON_OBJECT && stackLen == json->stack.length) ug_json_push (json, ug_json_parse_unknown, NULL, NULL); } // reset state // json->type = 0; // UG_JSON_VALUE json->count = 0; json->colon = 0; json->numberPoint = 0; json->numberEe = 0; json->numberPm = 0; json->index[0] = 0; json->index[1] = 0; // reset buffer json->buf.at[0] = 0; json->buf.length = 1; } // ---------------------------------------------------------------------------- // JSON Writer functions #define WRITER_STACK_BASE 1 #define WRITER_INDENT_LEN 1 // 2 // UgJson.state = UgJsonFormat // UgJson.index[0] = level // UgJson.stack.at[0] = UgBuffer // UgJson Writer functions void ug_json_begin_write (UgJson* json, UgJsonFormat format, UgBuffer* buffer) { json->index[0] = 0; json->stack.at[0] = buffer; json->stack.length = WRITER_STACK_BASE; json->state = format; json->error = 0; json->colon = 1; // for calling ug_json_write_head() first time json->type = UG_JSON_N_TYPE; // reset buffer json->buf.length = 0; } void ug_json_end_write (UgJson* json) { UgBuffer* buffer; // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; if (buffer->more != ug_buffer_expand) buffer->more (buffer); // clear stack json->stack.length = 0; } void ug_json_write_head (UgJson* json, char ch) { UgBuffer* buffer; // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; if (json->type < UG_JSON_N_TYPE) ug_buffer_write_char (buffer, ','); // UgJson.state = UgJsonFormat // UgJson.index[0] = level if ((json->state & UG_JSON_FORMAT_INDENT) && json->colon == 0) { ug_buffer_write_char (buffer, '\n'); // ug_buffer_fill (buffer, ' ', json->index[0]); ug_buffer_fill (buffer, '\t', json->index[0]); } // push scope to stack if (json->stack.allocated == json->stack.length) { json->stack.allocated *= 2; json->stack.at = ug_realloc (json->stack.at, json->stack.allocated * sizeof (void*)); } json->stack.at[json->stack.length++] = (void*)(uintptr_t) json->scope; ug_buffer_write_char (buffer, ch); json->scope = (ch == '{') ? UG_JSON_OBJECT : UG_JSON_ARRAY; json->colon = 0; json->type = UG_JSON_N_TYPE; json->index[0] += WRITER_INDENT_LEN; // json->index[0]++; } void ug_json_write_tail (UgJson* json, char ch) { UgBuffer* buffer; // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; // pop scope from stack if (json->stack.length > WRITER_STACK_BASE) json->scope = (uintptr_t)json->stack.at[--json->stack.length]; // UgJson.state = UgJsonFormat // UgJson.index[0] = level if (json->index[0]) json->index[0] -= WRITER_INDENT_LEN; // json->index[0]--; if (json->state & UG_JSON_FORMAT_INDENT) { ug_buffer_write_char (buffer, '\n'); // WRITER_INDENT_LEN // ug_buffer_fill (buffer, ' ', json->index[0]); ug_buffer_fill (buffer, '\t', json->index[0]); } ug_buffer_write_char (buffer, ch); json->type = json->scope; } void ug_json_write_null (UgJson* json) { UgBuffer* buffer; // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; if (json->type < UG_JSON_N_TYPE) ug_buffer_write_char (buffer, ','); // UgJson.state = UgJsonFormat // UgJson.index[0] = level if ((json->state & UG_JSON_FORMAT_INDENT) && json->colon == 0) { ug_buffer_write_char (buffer, '\n'); // WRITER_INDENT_LEN // ug_buffer_fill (buffer, ' ', json->index[0]); ug_buffer_fill (buffer, '\t', json->index[0]); } ug_buffer_write (buffer, "null", 4); json->type = UG_JSON_NULL; json->colon = 0; } void ug_json_write_bool (UgJson* json, int value) { UgBuffer* buffer; // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; if (json->type < UG_JSON_N_TYPE) ug_buffer_write_char (buffer, ','); // UgJson.state = UgJsonFormat // UgJson.index[0] = level if ((json->state & UG_JSON_FORMAT_INDENT) && json->colon == 0) { ug_buffer_write_char (buffer, '\n'); // WRITER_INDENT_LEN // ug_buffer_fill (buffer, ' ', json->index[0]); ug_buffer_fill (buffer, '\t', json->index[0]); } if (value == 0) { ug_buffer_write (buffer, "false", 5); json->type = UG_JSON_FALSE; } else { ug_buffer_write (buffer, "true", 4); json->type = UG_JSON_TRUE; } json->colon = 0; } void ug_json_write_number (UgJson* json, const char* format, ...) { va_list arg_list; int length; UgBuffer* buffer; // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; if (json->type < UG_JSON_N_TYPE) ug_buffer_write_char (buffer, ','); // UgJson.state = UgJsonFormat // UgJson.index[0] = level if ((json->state & UG_JSON_FORMAT_INDENT) && json->colon == 0) { ug_buffer_write_char (buffer, '\n'); // WRITER_INDENT_LEN // ug_buffer_fill (buffer, ' ', json->index[0]); ug_buffer_fill (buffer, '\t', json->index[0]); } va_start (arg_list, format); #ifdef _MSC_VER // for M$ C only length = _vscprintf (format, arg_list) + 1; #else // for C99 standard length = vsnprintf (NULL, 0, format, arg_list) + 1; #endif va_end (arg_list); if (length < buffer->end - buffer->cur) { va_start (arg_list, format); vsprintf ((char*) buffer->cur, format, arg_list); va_end (arg_list); buffer->cur += length - 1; } else { if (length > json->buf.allocated) { json->buf.allocated = (json->buf.allocated + length) * 2; json->buf.at = ug_realloc (json->buf.at, json->buf.allocated); } va_start (arg_list, format); vsprintf (json->buf.at, format, arg_list); va_end (arg_list); ug_buffer_write (buffer, json->buf.at, length - 1); } json->type = UG_JSON_NUMBER; json->colon = 0; } void ug_json_write_string (UgJson* json, const char* string) { static const uint8_t utf8Limits[] = {0xC0, 0xE0, 0xF0, 0xF8, 0xFC}; static const uint8_t hexTable[] = {"0123456789ABCDEF"}; uint8_t ch; int count; uint32_t value; UgBuffer* buffer; if (string == NULL) { ug_json_write_null (json); return; } // UgJson.stack.at[0] = UgBuffer buffer = json->stack.at[0]; if (json->type < UG_JSON_N_TYPE) ug_buffer_write_char (buffer, ','); // UgJson.state = UgJsonFormat // UgJson.index[0] = level if ((json->state & UG_JSON_FORMAT_INDENT) && json->colon == 0) { ug_buffer_write_char (buffer, '\n'); // WRITER_INDENT_LEN // ug_buffer_fill (buffer, ' ', json->index[0]); ug_buffer_fill (buffer, '\t', json->index[0]); } ug_buffer_write_char (buffer, '\"'); while ((ch = string[0])) { string++; if (ch < 0x80 || (json->state & UG_JSON_FORMAT_UTF8)) { switch (ch) { case '\"': ug_buffer_write (buffer, "\\\"", 2); break; case '\\': ug_buffer_write (buffer, "\\\\", 2); break; case '/': ug_buffer_write (buffer, "\\/", 2); break; case '\b': ug_buffer_write (buffer, "\\b", 2); break; case '\f': ug_buffer_write (buffer, "\\f", 2); break; case '\n': ug_buffer_write (buffer, "\\n", 2); break; case '\r': ug_buffer_write (buffer, "\\r", 2); break; case '\t': ug_buffer_write (buffer, "\\t", 2); break; default: ug_buffer_write_char (buffer, ch); break; } continue; } // UTF-8 to UTF-16 "\uXXXX" // If first is less than 0xC0? skip it. if (ch < 0xC0) break; for(count = 1; count < 5; ++count) if(ch < utf8Limits[count]) break; value = ch - utf8Limits[count - 1]; do { uint8_t ch2; ch2 = *string++; if (ch2 == 0) break; if (ch2 < 0x80 || ch2 >= 0xC0) break; value <<= 6; value |= (ch2 - 0x80); } while(--count != 0); if(value < 0x10000) { ug_buffer_write (buffer, "\\u", 2); for (count = 12; count >= 0; count -= 4) ug_buffer_write_char (buffer, hexTable[ (value >> count) & 0xF]); } else { value -= 0x10000; if(value >= 0x100000) break; ug_buffer_write (buffer, "\\u", 2); for (count = 12 + 10; count >= 0 + 10; count -= 4) ug_buffer_write_char (buffer, hexTable[ (value >> count) & 0xF]); ug_buffer_write (buffer, "\\u", 2); value &= 0x3FF; for (count = 12; count >= 0; count -= 4) ug_buffer_write_char (buffer, hexTable[ (value >> count) & 0xF]); } // End of UTF-8 to UTF-16 } ug_buffer_write_char (buffer, '\"'); if (json->scope == UG_JSON_OBJECT) { if (json->colon) { json->colon = 0; json->type = UG_JSON_STRING; } else { json->colon = 1; json->type = UG_JSON_N_TYPE; ug_buffer_write_char (buffer, ':'); // json->state = UgJsonFormat if (json->state & UG_JSON_FORMAT_INDENT) ug_buffer_write_char (buffer, ' '); } } else json->type = UG_JSON_STRING; } uget-2.0.2/uglib/UgUri.c0000664000175000017500000002015712456470652011723 00000000000000/* * * Copyright (C) 2005-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include // ---------------------------------------------------------------------------- // UgUri int ug_uri_init (UgUri* upart, const char* uri) { const char* cur; const char* tmp; // scheme #if defined _WIN32 || defined _WIN64 cur = strpbrk (uri, ":\\/?#"); // make sure ':' before '/', '?', and '#' #else cur = strpbrk (uri, ":/?#"); // make sure ':' before '/', '?', and '#' #endif if (cur && cur[0] == ':') { if (upart == NULL) return cur - uri; upart->scheme_len = cur - uri; cur++; } else { if (upart == NULL) return 0; upart->scheme_len = 0; cur = uri; } upart->uri = uri; #if defined _WIN32 || defined _WIN64 // Windows Path if (upart->scheme_len == 1) { upart->scheme_len = 0; cur = uri; } #endif // _WIN32 || _WIN64 // authority & path if (upart->scheme_len && cur[0] == '/' && cur[1] == '/') { cur += 2; upart->authority = cur - uri; cur += strcspn (cur, "/"); } else upart->authority = -1; upart->path = cur - uri; // file upart->file = -1; if (cur[0]) { for (; ; ) { #if defined _WIN32 || defined _WIN64 tmp = strpbrk (cur, "\\/?#"); if (tmp == NULL || (tmp[0] != '/' && tmp[0] != '\\')) { #else tmp = strpbrk (cur, "/?#"); if (tmp == NULL || tmp[0] != '/') { #endif // _WIN32 || _WIN64 upart->file = cur - uri; break; } cur = tmp + 1; } } // query if ((tmp = strchr (cur, '?')) == NULL) upart->query = -1; else { cur = tmp + 1; upart->query = cur - uri; } // fragment if ((tmp = strrchr (cur, '#')) == NULL) upart->fragment = -1; else { cur = tmp + 1; upart->fragment = cur - uri; } // host & port upart->port = -1; if (upart->authority == -1) upart->host = -1; else { upart->host = upart->authority; tmp = uri + upart->authority; for (cur = uri + upart->path -1; cur >= tmp; cur--) { if (cur[0] == '@') { upart->host = cur - uri + 1; break; } if (cur[0] == ':') upart->port = cur - uri + 1; } } return upart->scheme_len; } int ug_uri_part_scheme (UgUri* uuri, const char** scheme) { if (scheme && uuri->scheme_len) *scheme = uuri->uri; return uuri->scheme_len; } int ug_uri_part_file (UgUri* uuri, const char** file) { if (uuri->file != -1) { if (file) *file = uuri->uri + uuri->file; if (uuri->query != -1) return uuri->query - uuri->file - 1; // - '?' if (uuri->fragment != -1) return uuri->fragment - uuri->file - 1; // - '#' return strlen (uuri->uri + uuri->file); } return 0; } int ug_uri_part_file_ext (UgUri* uuri, const char** ext) { const char* beg; const char* end; int len; if (uuri->file != -1) { len = ug_uri_part_file (uuri, &beg); end = uuri->uri + uuri->file + len -1; for (; end >= beg; end--) { if (end[0] == '.') { end += 1; // + '.' if (ext) *ext = end; return len - (end - beg); } } } return 0; } int ug_uri_part_query (UgUri* uuri, const char** query) { if (uuri->query != -1) { if (query) *query = uuri->uri + uuri->query; if (uuri->fragment != -1) return uuri->fragment - uuri->query -1; // - '#' return strlen (uuri->uri + uuri->query); } return 0; } int ug_uri_part_fragment (UgUri* uuri, const char** fragment) { if (uuri->fragment != -1) { if (fragment) *fragment = uuri->uri + uuri->fragment; return strlen (uuri->uri + uuri->fragment); } return 0; } int ug_uri_part_referrer (UgUri* uuri, const char** referrer) { if (referrer) *referrer = uuri->uri; if (uuri->file == -1) return uuri->path; return uuri->file; } int ug_uri_part_user (UgUri* uuri, const char** user) { const char* beg; const char* end; if (uuri->authority == uuri->host) return 0; beg = uuri->uri + uuri->authority; end = uuri->uri + uuri->host - 1; // - '@' if (user) *user = beg; for (; beg < end; beg++) { if (beg[0] == ':') break; } return beg - uuri->uri - uuri->authority; } int ug_uri_part_password (UgUri* uuri, const char** password) { const char* tmp; int length; length = ug_uri_part_user (uuri, &tmp); if (length && tmp[length] == ':') { tmp += length + 1; // + ':' if (password) *password = tmp; return uuri->host - (tmp - uuri->uri) - 1; // - '@' } return 0; } int ug_uri_part_host (UgUri* uuri, const char** host) { if (uuri->host != -1) { if (host) *host = uuri->uri + uuri->host; if (uuri->port != -1) return uuri->port - uuri->host - 1; // - ':' else return uuri->path - uuri->host; } return 0; } int ug_uri_part_port (UgUri* uuri, const char** port) { if (uuri->port != -1) { if (port) *port = uuri->uri + uuri->port; return uuri->path - uuri->port; } return 0; } int ug_uri_get_port (UgUri* uuri) { if (uuri->port != -1) return strtol (uuri->uri + uuri->port, NULL, 10); return -1; } char* ug_uri_get_file (UgUri* uuri) { const char* str; char* name; int len; len = ug_uri_part_file (uuri, &str); if (len == 0) return NULL; name = ug_unescape_uri (str, len); if (ug_utf8_get_invalid ((uint8_t*) name, NULL) == -1) return name; ug_free (name); return ug_strndup (str, len); } // ------------------------------------ // match uri functions int ug_uri_match_hosts (UgUri* uuri, char** hosts) { const char* str; const char* end1; const char* end2; int len; int lenHost; int nthHost; len = ug_uri_part_host (uuri, &str); if (len) { for (nthHost = 0; *hosts; hosts++, nthHost++) { lenHost = strlen (*hosts); if (lenHost > len) continue; // compare host from head if (strncasecmp (uuri->uri, *hosts, len) == 0) return nthHost; // compare host from tail end1 = str + len -1; end2 = *hosts + lenHost -1; for (; lenHost > 0; lenHost--, end1--, end2--) { if (end1[0] != end2[0]) break; } if (lenHost == 0) return nthHost; } } return -1; } int ug_uri_match_schemes (UgUri* uuri, char** schemes) { int len; int index; len = ug_uri_part_scheme (uuri, NULL); if (len) { for (index = 0; *schemes; schemes++, index++) { if (strncasecmp (uuri->uri, *schemes, len) == 0) return index; } } return -1; } int ug_uri_match_file_exts (UgUri* uuri, char** exts) { const char* str; int len; int index; len = ug_uri_part_file_ext (uuri, &str); if (len) { for (index = 0; *exts; exts++, index++) { if (strncasecmp (str, *exts, len) == 0) return index; } } return -1; } // ------------------------------------ // Other URI functions char* ug_filename_from_uri (const char* str) { UgUri uuri; ug_uri_init (&uuri, str); return ug_uri_get_file ((UgUri*) &uuri); } uget-2.0.2/uglib/UgHtmlFilter.h0000664000175000017500000000620312456470652013237 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_HTML_FILTER_H #define UG_HTML_FILTER_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgHtmlFilter UgHtmlFilter; typedef struct UgHtmlFilterTag UgHtmlFilterTag; typedef void (*UgHtmlFilterTagFunc) (UgHtmlFilterTag* tag, const char* value, void* user_data); // ---------------------------------------------------------------------------- // UgHtmlFilter struct UgHtmlFilter { UgHtml html; char* base_href; char* charset; const char* element_name; UgList tags; }; UgHtmlFilter* ug_html_filter_new (void); void ug_html_filter_free (UgHtmlFilter* filter); void ug_html_filter_add_tag (UgHtmlFilter* filter, UgHtmlFilterTag* tag); int ug_html_filter_parse_file (UgHtmlFilter* filter, const char* file_utf8); // ---------------------------------------------------------------------------- // UgHtmlFilterTag struct UgHtmlFilterTag { UG_LINK_MEMBERS (UgHtmlFilterTag, UgHtmlFilterTag, self); // UgHtmlFilterTag* self; // UgHtmlFilterTag* next; // UgHtmlFilterTag* prev; int ref_count; char* tag_name; // element name char* attr_name; // attribute name UgList attr_values; // attribute values, string list UgHtmlFilter* filter; // callback UgHtmlFilterTagFunc callback; void* callback_data; }; UgHtmlFilterTag* ug_html_filter_tag_new (char* element_name, char* attr_name); void ug_html_filter_tag_ref (UgHtmlFilterTag* tag); void ug_html_filter_tag_unref (UgHtmlFilterTag* tag); #ifdef __cplusplus } #endif #endif // UG_HTML_FILTER_H uget-2.0.2/uglib/UgOption.h0000664000175000017500000000753012477443373012444 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #ifndef UG_OPTION_H #define UG_OPTION_H #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef struct UgOption UgOption; typedef struct UgOptionEntry UgOptionEntry; // return TRUE if accepted by parse function. typedef int (*UgOptionParseFunc) (UgOption* option, const char* name, const char* value, void* dest, void* data); // type = UG_ENTRY_OBJECT // UgOptionEntry.data pointer to UgEntry // type = UG_ENTRY_ARRAY // UgOptionEntry.data pointer to UgOptionParseFunc // type = UG_ENTRY_CUSTOM // UgOptionEntry.data pointer to UgOptionParseFunc struct UgOptionEntry { char* long_name; char* short_name; int offset; int type; char* description; char* arg_description; void* data; }; void ug_option_entry_print_help (UgOptionEntry* entry, const char* prog_name, const char* parameter_string, const char* summary_string); // ---------------------------------------------------------------------------- struct UgOption { UgArrayStr others; // begin character is not '-' UgArrayStr unaccepted; // Not accepted by parse function uint8_t short_name; uint8_t discard_unaccepted; struct { UgOptionParseFunc func; void* dest; void* data; } parse; }; void ug_option_init (UgOption* option); void ug_option_final (UgOption* option); void ug_option_clear (UgOption* option); void ug_option_set_parser (UgOption* option, UgOptionParseFunc func, void* dest, void* data); int ug_option_parse (UgOption* option, const char* string, int length); // UgOptionEntry* entry int ug_option_parse_entry (UgOption* option, const char* name, const char* value, void* dest, void* entry); // ---------------------------------------------------------------------------- // command-line argument char* ug_args_find_version (int argc, char** argv); char* ug_args_find_help (int argc, char** argv); #ifdef __cplusplus } #endif #endif // UG_OPTION_H uget-2.0.2/uglib/UgSocket.c0000664000175000017500000002355012477443373012417 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include #include #include #if defined _WIN32 || defined _WIN64 //#include // socklen_t, XXXXaddrinfo() //static int ws2_init_count = 0; #define ug_sleep Sleep #else #include // struct addrinfo #include #include #include #define ug_sleep(millisecond) usleep (millisecond * 1000) #endif // _WIN32 || _WIN64 int ug_socket_connect (SOCKET fd, const char* addr, const char* port_or_serv) { struct addrinfo hints; struct addrinfo* result; struct addrinfo* cur; socklen_t len; int type; len = sizeof (type); if (getsockopt (fd, SOL_SOCKET, SO_TYPE, (char*) &type, &len) == -1) return SOCKET_ERROR; // AI_PASSIVE // Socket address will be used in bind() call // AI_CANONNAME // Return canonical name in first ai_canonname // AI_NUMERICHOST // Nodename must be a numeric address string // AI_NUMERICSERV // Servicename must be a numeric port number // get addrinfo memset (&hints, 0, sizeof (hints)); // hints.ai_family = AF_INET; hints.ai_socktype = type; // hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE; if (getaddrinfo (addr, port_or_serv, &hints, &result) != 0) return SOCKET_ERROR; /* struct sockaddr_in saddr; saddr.sin_family = family; saddr.sin_port = htons (80); saddr.sin_addr.S_un.S_addr = inet_addr ("127.0.0.1"); connect (fd, (struct sockaddr *) &saddr, sizeof(saddr)); */ for (cur = result; cur; cur = cur->ai_next) { if (connect (fd, result->ai_addr, result->ai_addrlen) == 0) break; } if (cur == NULL) { freeaddrinfo (result); return SOCKET_ERROR; } freeaddrinfo (result); return fd; } #if !(defined _WIN32 || defined _WIN64) int ug_socket_connect_unix (SOCKET fd, const char* path, int path_len) { struct sockaddr_un saddr; saddr.sun_family = AF_UNIX; saddr.sun_path [sizeof (saddr.sun_path) -1] = 0; if (path_len == -1) { strncpy (saddr.sun_path, path, sizeof (saddr.sun_path) -1); if (connect (fd, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) return SOCKET_ERROR; } else { if (path_len > sizeof (saddr.sun_path) -1) path_len = sizeof (saddr.sun_path) -1; memcpy (saddr.sun_path, path, path_len); // abstract socket names (begin with 0) are not null terminated if (path_len > 0 && path[0] != 0) saddr.sun_path[path_len++] = 0; if (connect (fd, (struct sockaddr *) &saddr, sizeof (saddr.sun_family) + path_len) < 0) return SOCKET_ERROR; } return fd; } #endif // ! (_WIN32 || _WIN64) // ------------------------------------ // Server API int ug_socket_listen (SOCKET fd, const char* addr, const char* port_or_serv, int backlog) { struct addrinfo hints; struct addrinfo* result; struct addrinfo* cur; socklen_t len; int type; len = sizeof (type); if (getsockopt (fd, SOL_SOCKET, SO_TYPE, (char*) &type, &len) == -1) return SOCKET_ERROR; // AI_PASSIVE // Socket address will be used in bind() call // AI_CANONNAME // Return canonical name in first ai_canonname // AI_NUMERICHOST // Nodename must be a numeric address string // AI_NUMERICSERV // Servicename must be a numeric port number // get addrinfo memset (&hints, 0, sizeof (hints)); // hints.ai_family = AF_INET; hints.ai_socktype = type; // hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE; if (getaddrinfo (addr, port_or_serv, &hints, &result) != 0) return SOCKET_ERROR; /* saddr.sin_family = AF_INET; saddr.sin_port = htons (80); saddr.sin_addr.S_un.S_addr = inet_addr ("127.0.0.1"); bind (fd, (struct sockaddr *)&saddr, sizeof (saddr)); */ for (cur = result; cur; cur = cur->ai_next) { if (bind (fd, result->ai_addr, result->ai_addrlen) == 0) break; } if (cur == NULL) goto error_exit; if (listen (fd, backlog) == -1) goto error_exit; freeaddrinfo (result); return fd; error_exit: freeaddrinfo (result); return SOCKET_ERROR; } #if !(defined _WIN32 || defined _WIN64) SOCKET ug_socket_listen_unix (SOCKET fd, const char* path, int path_len, int backlog) { struct sockaddr_un saddr; saddr.sun_family = AF_UNIX; saddr.sun_path [sizeof (saddr.sun_path) -1] = 0; if (path_len == -1) { strncpy (saddr.sun_path, path, sizeof (saddr.sun_path) -1); // delete socket file before server start // ug_unlink (saddr.sun_path); if (bind (fd, (struct sockaddr*) &saddr, sizeof (saddr)) == -1) return SOCKET_ERROR; } else { if (path_len > sizeof (saddr.sun_path) -1) path_len = sizeof (saddr.sun_path) -1; memcpy (saddr.sun_path, path, path_len); // abstract socket names (begin with 0) are not null terminated if (path_len > 0 && path[0] != 0) saddr.sun_path[path_len++] = 0; if (bind (fd, (struct sockaddr*) &saddr, sizeof (saddr.sun_family) + path_len) == -1) return SOCKET_ERROR; } if (listen (fd, backlog) == -1) return SOCKET_ERROR; return fd; } #endif // ! (_WIN32 || _WIN64) // ------------------------------------ // UgSocketServer static UG_THREAD_RETURN_TYPE server_thread (UgSocketServer* server); UgSocketServer* ug_socket_server_new (SOCKET server_fd) { UgSocketServer* server; server = ug_malloc0 (sizeof (UgSocketServer)); server->ref_count = 1; server->socket = server_fd; server->stopped = TRUE; server->stopping = FALSE; server->client_addr_len = sizeof (server->client_addr); return server; } UgSocketServer* ug_socket_server_new_addr (const char* addr, const char* port_or_serv) { SOCKET server_fd; server_fd = socket (AF_INET, SOCK_STREAM, 0); if (server_fd == INVALID_SOCKET) return NULL; if (ug_socket_listen (server_fd, addr, port_or_serv, 5) == SOCKET_ERROR) { closesocket (server_fd); return NULL; } return ug_socket_server_new (server_fd); } #if !(defined _WIN32 || defined _WIN64) UgSocketServer* ug_socket_server_new_unix (const char* path, int path_len) { SOCKET server_fd; server_fd = socket (AF_UNIX, SOCK_STREAM, 0); if (server_fd == -1) return NULL; if (ug_socket_listen_unix (server_fd, path, path_len, 5) == -1) { close (server_fd); return NULL; } return ug_socket_server_new (server_fd); } #endif // ! (_WIN32 || _WIN64) void ug_socket_server_ref (UgSocketServer* server) { server->ref_count++; } void ug_socket_server_unref (UgSocketServer* server) { if (--server->ref_count == 0) { if (server->destroy.func) server->destroy.func (server->destroy.data); shutdown (server->socket, 0); closesocket (server->socket); ug_free (server); } } void ug_socket_server_close (UgSocketServer* server) { if (server->socket != -1) { closesocket (server->socket); server->socket = -1; } } void ug_socket_server_set_receiver (UgSocketServer* server, UgSocketServerFunc func, void* data) { server->receiver.func = func; server->receiver.data = data; } int ug_socket_server_start (UgSocketServer* server) { if (server->receiver.func == NULL) return FALSE; if (server->stopped) { server->stopped = FALSE; server->stopping = FALSE; ug_socket_server_ref (server); ug_thread_create (&server->thread, (UgThreadFunc) server_thread, server); ug_thread_unjoin (&server->thread); return TRUE; } return FALSE; } void ug_socket_server_stop (UgSocketServer* server) { if (server->stopped == FALSE) { server->stopping = TRUE; // ug_thread_join (&server->thread); } } static UG_THREAD_RETURN_TYPE server_thread (UgSocketServer* server) { struct timeval timeout; int client_fd; int result; while (server->stopping == FALSE) { // reset fd_set and timeout because select() will change them. FD_ZERO (&server->read_fds); FD_SET (server->socket, &server->read_fds); timeout.tv_sec = 1; timeout.tv_usec = 0; // select() will change fd_set and timeout (reduce timeout to 0) result = select (server->socket + 1, &server->read_fds, NULL, NULL, &timeout); // exit thread if user stop server if (server->stopping || result < 0) break; // select() time limit expired if result == 0 if (result == 0) { // ug_sleep (200); continue; } client_fd = accept (server->socket, (struct sockaddr *) &server->client_addr, &server->client_addr_len); server->receiver.func (server, client_fd, server->receiver.data); } server->stopping = FALSE; server->stopped = TRUE; ug_socket_server_unref (server); return UG_THREAD_RETURN_VALUE; } uget-2.0.2/uglib/UgArray.c0000664000175000017500000002006312456470652012236 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include // NULL #include #include #include #include #if defined(_MSC_VER) #define strtoll _strtoi64 #endif // ---------------------------------------------------------------------------- // UgArray: for UG_ENTRY_ARRAY void ug_array_init (void* arr, int element_size, int allocated_len) { UgArrayChar* array = arr; if (allocated_len) array->at = ug_malloc (element_size * allocated_len); else array->at = NULL; array->length = 0; array->allocated = allocated_len; array->element_size = element_size; } void ug_array_clear (void* arr) { UgArrayChar* array = arr; ug_free (array->at); array->at = NULL; array->length = 0; array->allocated = 0; } void* ug_array_alloc (void* arr, int nElements) { UgArrayChar* array = arr; int len; len = array->length + nElements; if (array->allocated < len) { array->allocated = len * 2; // if (array->allocated < 16) // array->allocated = 16; array->at = ug_realloc (array->at, array->allocated * array->element_size); } arr = array->at + array->length * array->element_size; array->length += nElements; return arr; } void ug_array_foreach (void* array, UgForeachFunc func, void* data) { char* cur; char* end; cur = ((UgArrayChar*)array)->at; end = cur + ((UgArrayChar*)array)->element_size * ((UgArrayChar*)array)->length; for (; cur < end; cur+= ((UgArrayChar*)array)->element_size) func (cur, data); } void ug_array_foreach_ptr (void* array, UgForeachFunc func, void* data) { char* cur = ((UgArrayChar*)array)->at; char* end = cur + ((UgArrayChar*)array)->element_size * ((UgArrayChar*)array)->length; for (; cur < end; cur+= ((UgArrayChar*)array)->element_size) func (*(void**)cur, data); } // ---------------------------------------------------------------------------- // UgJsonParseFunc for JSON array elements UgJsonError ug_json_parse_array_bool (UgJson* json, const char* name, const char* value, void* array, void* none) { int boolValue; if (json->type != UG_JSON_TRUE && json->type != UG_JSON_FALSE) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } if (json->type == UG_JSON_TRUE) boolValue = TRUE; else boolValue = FALSE; ((UgArrayInt*)array)->element_size = sizeof (int); *((int*) ug_array_alloc (array, 1)) = boolValue; return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_array_int (UgJson* json, const char* name, const char* value, void* array, void* none) { if (json->type != UG_JSON_NUMBER) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } ((UgArrayInt*)array)->element_size = sizeof (int); *((int*) ug_array_alloc (array, 1)) = strtol (value, NULL, 10); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_array_uint (UgJson* json, const char* name, const char* value, void* array, void* none) { if (json->type != UG_JSON_NUMBER) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } ((UgArrayInt*)array)->element_size = sizeof (unsigned int); *((unsigned int*) ug_array_alloc (array, 1)) = strtoul (value, NULL, 10); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_array_int64 (UgJson* json, const char* name, const char* value, void* array, void* none) { if (json->type != UG_JSON_NUMBER) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } ((UgArrayInt*)array)->element_size = sizeof (int64_t); *((int64_t*) ug_array_alloc (array, 1)) = strtoll (value, NULL, 10); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_array_double (UgJson* json, const char* name, const char* value, void* array, void* none) { if (json->type != UG_JSON_NUMBER) { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } ((UgArrayInt*)array)->element_size = sizeof (double); *((double*) ug_array_alloc (array, 1)) = strtod (value, NULL); return UG_JSON_ERROR_NONE; } UgJsonError ug_json_parse_array_string (UgJson* json, const char* name, const char* value, void* array, void* none) { char* string; if (json->type == UG_JSON_STRING) string = ug_strdup (value); else if (json->type == UG_JSON_NULL) string = NULL; else { // if (json->type >= UG_JSON_OBJECT) // ug_json_push (json, ug_json_parse_unknown, NULL, NULL); return UG_JSON_ERROR_TYPE_NOT_MATCH; } ((UgArrayInt*)array)->element_size = sizeof (char*); *((char**) ug_array_alloc (array, 1)) = string; return UG_JSON_ERROR_NONE; } // ---------------------------------------------------------------------------- // write JSON array elements void ug_json_write_array_bool (UgJson* json, UgArrayInt* array) { // UgArrayInt* array = src; int index; for (index = 0; index < array->length; index++) ug_json_write_bool (json, array->at[index]); } void ug_json_write_array_int (UgJson* json, UgArrayInt* array) { // UgArrayInt* array = src; int index; for (index = 0; index < array->length; index++) ug_json_write_int (json, array->at[index]); } void ug_json_write_array_uint (UgJson* json, UgArrayUint* array) { int index; for (index = 0; index < array->length; index++) ug_json_write_uint (json, array->at[index]); } void ug_json_write_array_int64 (UgJson* json, UgArrayInt64* array) { int index; for (index = 0; index < array->length; index++) ug_json_write_int64 (json, array->at[index]); } void ug_json_write_array_double (UgJson* json, UgArrayDouble* array) { int index; for (index = 0; index < array->length; index++) ug_json_write_double (json, array->at[index]); } void ug_json_write_array_string (UgJson* json, UgArrayStr* array) { int index; char* string; for (index = 0; index < array->length; index++) { string = array->at[index]; if (string == NULL) ug_json_write_null (json); else ug_json_write_string (json, string); } } uget-2.0.2/uglib/UgRegistry.c0000664000175000017500000000711612456470652012774 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include // ---------------------------------------------------------------------------- // UgPairs void ug_registry_init (UgRegistry* reg) { ug_array_init (reg, sizeof (UgPair), 16); reg->sorted = FALSE; } void ug_registry_final (UgRegistry* reg) { ug_array_clear (reg); } void ug_registry_add (UgRegistry* reg, const UgDataInfo* info) { UgPair* pair; int index; if (reg->sorted == FALSE || reg->length == 0) pair = ug_array_alloc (reg, 1); else { pair = ug_registry_find (reg, info->name, &index); if (pair == NULL) { ug_array_alloc (reg, 1); memmove (reg->at + index + 1, reg->at + index, sizeof (UgPair) * (reg->length - index - 1)); pair = reg->at + index; } } pair->key = (void*) info->name; pair->data = (void*) info; } void ug_registry_remove (UgRegistry* reg, const UgDataInfo* info) { UgPair* cur; cur = ug_registry_find (reg, info->name, NULL); if (cur) { memmove (cur, cur +1, sizeof (UgPair) * (reg->length - (cur - reg->at) -1)); } } UgPair* ug_registry_find (UgRegistry* reg, const char* key, int* inserted_index) { UgPair* low; UgPair* cur; UgPair* high; int diff; low = reg->at; high = reg->at + reg->length; cur = low; if (reg->sorted == FALSE) { for (; low < high; low++) { if (strcmp (low->key, key) == 0) { if (inserted_index) inserted_index[0] = low - reg->at; return low; } } return NULL; } while (low < high) { cur = low + (high - low) / 2; diff = strcmp (cur->key, key); if (diff == 0) { if (inserted_index) inserted_index[0] = cur - reg->at; return cur; } else if (diff > 0) high = cur; else if (diff < 0) low = cur + 1; } if (inserted_index) { if (cur < low) cur++; *inserted_index = cur - reg->at; } return NULL; } static int compare_key_string (UgPair* pair1, UgPair* pair2) { return strcmp (pair1->key, pair2->key); } void ug_registry_sort (UgRegistry* reg) { ug_array_sort (reg, (UgCompareFunc) compare_key_string); reg->sorted = TRUE; } uget-2.0.2/uglib/UgHtmlFilter.c0000664000175000017500000001667512456470652013250 00000000000000/* * * Copyright (C) 2012-2015 by C.H. Huang * plushuang.tw@gmail.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * --- * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU Lesser General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. * */ #include #include #include static UgHtmlParser default_parser; static UgHtmlParser script_parser; static UgHtmlParser head_parser; UgHtmlFilter* ug_html_filter_new (void) { UgHtmlFilter* filter; filter = ug_malloc (sizeof (UgHtmlFilter)); ug_html_init ((UgHtml*) filter); filter->base_href = NULL; filter->charset = NULL; ug_list_init (&filter->tags); ug_html_push ((UgHtml*)filter, &default_parser, NULL, NULL); return (UgHtmlFilter*) filter; } void ug_html_filter_free (UgHtmlFilter* filter) { ug_free (filter->base_href); ug_free (filter->charset); ug_list_foreach (&filter->tags, (UgForeachFunc) ug_html_filter_tag_unref, NULL); ug_list_clear (&filter->tags, FALSE); ug_free (filter); } void ug_html_filter_add_tag (UgHtmlFilter* filter, UgHtmlFilterTag* tag) { ug_list_prepend (&filter->tags, (UgLink*) tag); ug_html_filter_tag_ref (tag); tag->filter = filter; } int ug_html_filter_parse_file (UgHtmlFilter* filter, const char* file_utf8) { UgHtml* uhtml; uhtml = (UgHtml*) filter; ug_html_push (uhtml, &default_parser, NULL, NULL); return ug_html_parse_file (uhtml, file_utf8); } // ---------------------------------------------------------------------------- // UgHtmlFilterTag UgHtmlFilterTag* ug_html_filter_tag_new (char* element_name, char* attr_name) { UgHtmlFilterTag* tag; tag = ug_malloc0 (sizeof (UgHtmlFilterTag)); tag->self = tag; tag->tag_name = ug_strdup (element_name); tag->attr_name = ug_strdup (attr_name); ug_list_init (&tag->attr_values); tag->ref_count = 1; return tag; } void ug_html_filter_tag_ref (UgHtmlFilterTag* tag) { tag->ref_count++; } void ug_html_filter_tag_unref (UgHtmlFilterTag* tag) { tag->ref_count--; if (tag->ref_count == 0) { ug_free (tag->tag_name); ug_free (tag->attr_name); ug_list_foreach (&tag->attr_values, (UgForeachFunc) ug_free, NULL); ug_list_clear (&tag->attr_values, TRUE); ug_free (tag); } } // ---------------------------------------------------------------------------- // default parser static void cb_start_element (UgHtml* uhtml, const char* element_name, const char** attribute_names, const char** attribute_values, void* dest) { UgHtmlFilter* filter = (UgHtmlFilter*) uhtml; UgHtmlFilterTag* tag; UgLink* link; UgLink* strlink; if (strcasecmp (element_name, "script") == 0) { ug_html_push (uhtml, &script_parser, NULL, NULL); return; } if (strcasecmp (element_name, "head") == 0) { ug_html_push (uhtml, &head_parser, NULL, NULL); return; } // filter tag for (link = filter->tags.head; link; link = link->next) { tag = link->data; if (strcasecmp (element_name, tag->tag_name) != 0) continue; for (; *attribute_names; attribute_names++, attribute_values++) { if (strcasecmp (*attribute_names, tag->attr_name) != 0) continue; if (tag->callback) tag->callback (tag, *attribute_values, tag->callback_data); else { strlink = ug_link_new (); strlink->data = ug_strdup (*attribute_values); ug_list_prepend (&tag->attr_values, strlink); } } } } static UgHtmlParser default_parser = { (void*) cb_start_element, (void*) NULL, (void*) NULL, }; // ---------------------------------------------------------------------------- // parser -