diffstat for flickcurl-1.22 flickcurl-1.24 ChangeLog | 917 ++++++++++++++++ INSTALL | 9 LICENSE.html | 6 Makefile.in | 159 +- NEWS | 553 ++++++---- NEWS.html | 178 +++ README | 190 +-- README.html | 152 +- aclocal.m4 | 185 ++- autogen.sh | 87 + build/ar-lib | 270 ++++ build/compile | 228 +++- build/config.guess | 49 build/config.sub | 74 - build/depcomp | 190 ++- build/install-sh | 29 build/libtool.m4 | 28 build/ltmain.sh | 4 build/missing | 53 configure | 1206 ++++++++++++++-------- configure.ac | 210 ++- coverage.html | 16 debian/changelog | 12 debian/control | 6 docs/Makefile.am | 1 docs/Makefile.in | 81 + docs/flickcurl-authenticate.xml | 98 + docs/flickcurl-docs.xml | 3 docs/flickcurl-oauth.xml | 422 +++++++ docs/flickcurl-sections.txt | 36 docs/flickcurl.1 | 27 docs/html/flickcurl-auth-authenticate.html | 140 +- docs/html/flickcurl-auth-build.html | 60 + docs/html/flickcurl-auth-register.html | 42 docs/html/flickcurl-auth-upgrade.html | 60 + docs/html/flickcurl-auth-use.html | 15 docs/html/flickcurl-auth.html | 49 docs/html/flickcurl-legacy-auth-authenticate.html | 92 + docs/html/flickcurl-legacy-auth-build.html | 63 + docs/html/flickcurl-legacy-auth-register.html | 123 ++ docs/html/flickcurl-legacy-auth-use.html | 43 docs/html/flickcurl-legacy-auth.html | 48 docs/html/flickcurl-searching-search-example.html | 34 docs/html/flickcurl-searching.html | 4 docs/html/flickcurl-section-auth.html | 637 +++++++++++ docs/html/flickcurl-section-core.html | 143 -- docs/html/flickcurl-section-general.html | 2 docs/html/flickcurl-section-group.html | 79 + docs/html/flickcurl-section-misc.html | 41 docs/html/flickcurl-section-photo.html | 39 docs/html/flickcurl.devhelp2 | 55 - docs/html/index.html | 26 docs/html/index.sgml | 36 docs/html/indexes.html | 54 docs/search-photos.c | 18 docs/tmpl/section-auth.sgml | 227 ++++ docs/tmpl/section-core.sgml | 63 - docs/tmpl/section-group.sgml | 15 docs/tmpl/section-misc.sgml | 9 docs/tmpl/section-photo.sgml | 11 docs/version.xml | 2 examples/Makefile.in | 103 + examples/print-photo-info.c | 35 examples/search-photos.c | 20 flickcurl.spec | 2 libmtwist/mt.c | 3 src/Makefile.am | 60 - src/Makefile.in | 292 +++-- src/activity-api.c | 33 src/activity.c | 20 src/args.c | 10 src/auth-api.c | 110 -- src/blog.c | 19 src/blogs-api.c | 41 src/category.c | 7 src/collection.c | 14 src/collections-api.c | 27 src/comments.c | 10 src/common.c | 498 +++------ src/commons-api.c | 10 src/config.c | 60 - src/config.h.in | 3 src/contacts-api.c | 52 src/contacts.c | 5 src/context.c | 11 src/exif.c | 17 src/favorites-api.c | 82 - src/flickcurl.h | 92 + src/flickcurl_internal.h | 67 - src/galleries-api.c | 146 +- src/gallery.c | 20 src/group.c | 100 + src/groups-api.c | 44 src/groups-members-api.c | 22 src/groups-pools-api.c | 77 - src/institution.c | 5 src/interestingness-api.c | 15 src/legacy-auth.c | 300 +++++ src/location.c | 19 src/machinetags-api.c | 96 - src/machinetags.c | 26 src/md5.c | 1 src/members.c | 5 src/method.c | 5 src/note.c | 13 src/oauth.c | 696 +++++++++--- src/panda-api.c | 31 src/people-api.c | 92 - src/perms.c | 7 src/person.c | 27 src/photo.c | 57 - src/photos-api.c | 537 ++++----- src/photos-comments-api.c | 72 - src/photos-geo-api.c | 155 +- src/photos-licenses-api.c | 33 src/photos-notes-api.c | 65 - src/photos-people-api.c | 95 - src/photos-transform-api.c | 16 src/photos-upload-api.c | 13 src/photoset.c | 15 src/photosets-api.c | 198 +-- src/photosets-comments-api.c | 56 - src/place.c | 23 src/places-api.c | 283 ++--- src/prefs-api.c | 34 src/reflection-api.c | 27 src/serializer.c | 12 src/sha1.c | 6 src/shape.c | 5 src/size.c | 8 src/stat.c | 7 src/stats-api.c | 265 ++-- src/tags-api.c | 99 - src/tags.c | 37 src/test-api.c | 29 src/ticket.c | 8 src/upload-api.c | 63 - src/urls-api.c | 2 src/user_upload_status.c | 10 utils/Makefile.am | 12 utils/Makefile.in | 167 +-- utils/codegen.c | 4 utils/flickcurl.c | 244 +++- utils/flickrdf.c | 4 utils/list-methods.c | 2 utils/oauth-test.c | 406 ------- utils/raptor_fake.c | 2 utils/raptor_fake.h | 2 148 files changed, 9507 insertions(+), 4725 deletions(-) diff -Nru flickcurl-1.22/ChangeLog flickcurl-1.24/ChangeLog --- flickcurl-1.22/ChangeLog 2011-12-29 00:16:42.000000000 +0000 +++ flickcurl-1.24/ChangeLog 2013-04-11 05:13:55.000000000 +0000 @@ -1,3 +1,920 @@ +2013-04-10 Dave Beckett + + * Snapshotted flickcurl_1_24 for 1.24 release (GIT + 874b9f7033ac681925a2f9f260c4d5af510e55d2) + + * utils/flickrdf.c: Casts for C++ + + * src/favorites-api.c, src/group.c, src/oauth.c, src/sha1.c: Casts + for C++ + + * src/oauth.c: + (flickcurl_oauth_create_access_token): Handle NULL username, + user_nsid [clang] + + * src/group.c: + (flickcurl_build_groups): Do not lose malloced attr values [clang] + + * configure.ac: Only add libcurl and libxml to .pc if they were + configured via pkg-config + +2013-04-09 Dave Beckett + + * src/.gitignore: Ignore more + +2013-04-08 Dave Beckett + + * examples/print-photo-info.c: Include flickcurl_config_read_in() + example code + + * examples/search-photos.c: Use flickcurl_config_read_ini() to get + config + + * examples/search-photos.c: Updated for reading OAuth config using + flickcurl_config_var_handler() + + * src/md5.c: Do not destroy MD5 digest + +2013-04-07 Dave Beckett + + * build/.gitignore: ignore more + + * autogen.sh: autoconf + + * configure.ac: autoconf warnings + + Make AC_RUN_IFELSE assume failure when cross compiling and checking + for vsnprintf return; pessimisim will work + + * configure.ac: Modernize LT_INIT call for libtool 2.2+ + + * README.html: words + + * docs/flickcurl-oauth.xml: update example tokens + + * LICENSE.html, NEWS.html, README.html, docs/flickcurl-docs.xml: + 2013 + + * examples/print-photo-info.c: Use OAuth + + * docs/flickcurl-sections.txt: 1.24 new functions + + * src/common.c, src/md5.c: memset fixes [gcc 4.8] + + * NEWS.html: 1.24 + + * ChangeLog: #changes + + * src/oauth.c: + (flickcurl_oauth_free): Free oauth username and user_nsid + + * Merge pull request #18 from jcsogo/userid + Make available the username and user_nsid when oauth + authentication happens + +2013-02-22 Dave Beckett + + * utils/flickcurl.c: Add missing command contacts.getPublicList + Fixes https://github.com/dajobe/flickcurl/issues/19 + +2013-02-14 Jose Carlos Garcia Sogo + + * src/oauth.c: Commit forgotten code + +2013-02-13 Dave Beckett + + * utils/flickcurl.c: Allow photos.getInfo to take an optional + SECRET arg + + Call flickcurl_photos_getInfo2() instead of deprecated + flickcurl_photos_getInfo() + + * utils/flickcurl.c: Add description of PER-PAGE and PAGE into + manpage + See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=635989 + + * utils/flickcurl.c: Make PER-PAGE PAGE docs match code + See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=635989 + + * src/flickcurl.h, src/photos-api.c: + (flickcurl_photos_getInfo2): Added replacing + flickcurl_photos_getInfo + + Adds optional 'secret' parameter that was added sometime to the API. + See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637746 + +2013-02-13 Jose Carlos Garcia Sogo + + * src/flickcurl.h, src/flickcurl_internal.h: Make available the + username and user_nsid when oauth authentication is done + +2013-01-16 Dave Beckett + + * src/common.c: + (win32 gettimeofday): Use tp-> not tv-> + +2013-01-11 Dave Beckett + + * src/tags.c: + Grab text from child text node correctly. + + Fixes https://github.com/dajobe/flickcurl/issues/16 + +2013-01-10 Dave Beckett + + * src/location.c: Parse double latitude and longitude with atof() + not atoi() + + Bug report from Clemens Arth - thanks + +2012-12-15 Dave Beckett + + * autogen.sh: Handle AM_CONFIG_HEADER AND newer + AC_CONFIG_HEADER(S) + +2012-12-03 Dave Beckett + + * src/flickcurl.h, src/group.c, utils/flickcurl.c: Add a pile of + group response fields. + + Added iconfarm icon farm number; is_moderator and is_member + booleans, rules description; pool_count, topic_count counts and + group restriction booleans: photos_ok, videos_ok, images_ok, + screens_ok, art_ok, safe_ok, moderate_ok, restricted_ok, has_geo. + +2012-09-02 Dave Beckett + + * NEWS.html, configure.ac: Bumped version to 1.24 + +2012-09-01 Dave Beckett + + * Snapshotted flickcurl_1_23 for 1.23 release (GIT + 29b6f5b550599ce9398504b975c784eac4cb2ba1) + + * docs/flickcurl-authenticate.xml, docs/flickcurl-oauth.xml: docs + + * utils/flickcurl.c: Add oauth.verify command to upgrade legacy + auth to OAuth + + * docs/flickcurl-authenticate.xml, docs/flickcurl-oauth.xml: More + oauth docs + + * docs/Makefile.am, docs/flickcurl-authenticate.xml, + docs/flickcurl-docs.xml, docs/flickcurl-oauth.xml: OAuth docs + +2012-08-31 Dave Beckett + + * autogen.sh: autogen.sh docs + + * autogen.sh, configure.ac: Update autogen.sh and configure.ac via + autoupdate + +2012-08-29 Dave Beckett + + * NEWS.html: words + + * NEWS.html: html + +2012-08-28 Dave Beckett + + * src/oauth.c: + (test_request_token): Fix call to + flickcurl_oauth_create_request_token + + * utils/Makefile.am, utils/oauth-test.c: Remove oauth-test utility + no longer needed + + * docs/tmpl/section-auth.sgml, docs/tmpl/section-core.sgml, + docs/tmpl/section-misc.sgml: Update tmpls + + * docs/flickcurl-sections.txt: Add new functions to sections + + * src/collection.c, src/common.c, src/gallery.c, src/person.c, + src/photo.c: Replace strncpy with memcpy + + * ChangeLog: #changes + + * src/oauth.c: Remove final strcat from OAuth code + + (flickcurl_oauth_prepare_common): replaced strcat with pointer + movement and memcpy + + * src/oauth.c: Remove strcpy and stract from OAuth code + + (flickcurl_oauth_prepare_common): strcpy and strcat replaced with + pointer movement and memcpy + + * src/photo.c: + (flickcurl_user_icon_uri): 42 + + * src/photo.c: + (flickcurl_photo_as_source_uri): Remove strcpy + + * src/machinetags.c: Switch to strlen / malloc / memcpy form + + (flickcurl_build_tag_namespaces, + flickcurl_build_tag_predicate_values): + Switch from sequence: + dest = malloc(strlen(str) + 1); + strcpy(dest, str); + to + len = strlen(str) + dest = malloc(len + 1) + memcpy(dest, str, len + 1) + + to get rid of strcpy for known string length + + * src/legacy-auth.c: Remove strcpy from legacy auth code + + (flickcurl_legacy_prepare_common): Lots of url and parameter + counting. strcpy and strcat replaced with pointer movement and + memcpy + + * src/args.c: + (flickcurl_build_args): Fix strlen/malloc/memcpy cut-n-pasto + + * src/activity.c, src/args.c, src/blog.c, src/category.c, + src/comments.c, src/contacts.c, src/context.c, src/exif.c, + src/gallery.c, src/group.c, src/members.c, src/note.c, + src/oauth.c, src/panda-api.c, src/perms.c, src/photos-api.c, + src/photos-licenses-api.c, src/photoset.c, src/place.c, + src/reflection-api.c, src/serializer.c, src/size.c, src/stat.c, + src/tags.c, src/ticket.c, src/user_upload_status.c, src/common.c: + Switch to strlen / malloc / memcpy form for setters + + Switch from sequence: + dest = malloc(strlen(str) + 1); + strcpy(dest, str); + to + len = strlen(str) + dest = malloc(len + 1) + memcpy(dest, str, len + 1) + + to get rid of strcpy for known string length + + (flickcurl_set_user_agent, flickcurl_set_proxy, + flickcurl_set_http_accept): swtich from "malloc(strcpy); strcpy" + to "strlen(); malloc(); memcpy()" sequence + + (flickcurl_invoke_common): Use same for raptor building URIs from + filename. + + * src/common.c, src/legacy-auth.c, src/oauth.c, src/photo.c: + Change slightly unportable strdup() with malloc + memcpy + + * src/group.c: Free attribute values if not used [clang] + + (flickcurl_build_groups): Free value from child node always + + * libmtwist: Update submodule libmtwist + + * src/upload-api.c: Free status on error path [clang] + + (flickcurl_photos_upload_params, flickcurl_photos_replace): Free + status on error exist. + + * src/ticket.c: Free attribute values if not used [clang] + + (flickcurl_build_tickets): Free attr_value + + * src/tags.c: Free attribute values if not used. Free vars in loop + [clang] + + (flickcurl_build_tags): Free attr_value + + (flickcurl_build_tags_from_string): Use memcpy for known length + string. + + (flickcurl_build_tag_clusters): Free tc on loop skip Free tag + cluster on error exit. + + * src/stats-api.c: Initialise vars for errors. Free results on an + error [clang] + + (flickcurl_stats_getCollectionStats, + flickcurl_stats_getPhotosetStats, + flickcurl_stats_getPhotostreamStats): Initialize count vars for + error case. + + (flickcurl_stats_getTotalViews): Initialize count vars for error + case. Free views on error exits + + * src/stat.c: + Free attribute values if not used [clang] + + (flickcurl_build_stats): Free attr_value + + * src/size.c: + Free attribute values if not used [clang] + + (flickcurl_build_sizes): Free attr_value + + * src/shape.c: + Free results on an error [clang] + + (flickcurl_build_shapes): Free shapes on error exits + + * src/place.c: Free results on an error, attribute values, calloc + fixes [clang] + + (flickcurl_build_places): Free places on error exits + + (flickcurl_build_place_types): Calloc correct object + pointer (semantic error but not dangerous). Calloc correct + parameter order. Free attribute value if not used. + + * src/photos-licenses-api.c: Free attribute values if not used + [clang] + + (flickcurl_read_licenses): Free attr_value + + * src/photos-api.c: Free attribute values if not used and objects + on error path [clang] + + (flickcurl_build_photocounts): Free attr_value + + (flickcurl_photos_getCounts): Free counts on error exit + + * src/photo.c: Free results on an error [clang] + + (flickcurl_build_photos): Free photos on error exits + + (flickcurl_invoke_photos_list): Check for NULL photos_list before + trying to call it + + * src/perms.c: + Free attribute values if not used [clang] + + (flickcurl_build_perms): Free attr_value + + * src/panda-api.c: + Free results on an error [clang] + + (flickcurl_panda_getList): Free pandas on error exits + + * src/note.c: + Free attribute values if not used [clang] + + (flickcurl_build_notes): Free attr_value + + * src/method.c: + Free results on an error [clang] + + (flickcurl_build_method): Free method on error exits + + * src/machinetags.c: Free attribute values if not used [clang] + + (flickcurl_build_tag_namespaces, + flickcurl_build_tag_predicate_values): Free attr_value + + * src/location.c: Memcpy and attribute value fixes [clang] + + (flickcurl_build_location): memcpy instead of strcpy. Always free + attribute value. + + * src/institution.c: Free results on an error [clang] + + (flickcurl_build_institutions): Free institutions on error exits + + * src/favorites-api.c: Free results on an error [clang] + + (flickcurl_favorites_getContext): Do not set an unused value. Free + photos lists on error exits + + * src/exif.c: Free attribute values if not used [clang] + + (flickcurl_build_exifs): Free attr_value + + * src/context.c: Fix allocation and freeing attribute values + [clang] + + (flickcurl_build_contexts): Calloc correct sized pointer (no + danger, but a semantic error). Free unused attribute values. + + * src/common.c: Set a return value always [clang] + + (flickcurl_prepare_common): Set rc and use memcpy for string + + * src/collection.c: Free results on an error [clang] + + (flickcurl_build_collections): Free collections on error exits + + * src/category.c: Free attribute values if not used [clang] + + (flickcurl_build_categories): Free attr_value + + * src/blog.c: Free attribute values if not used [clang] + + (flickcurl_build_blogs, flickcurl_build_blog_services): Free + attr_value + + * src/.gitignore, src/Makefile.am: Add analyze target for source + + * configure.ac: Add RECHO, RECHO_C, RECHO_N + + * analyze + + * src/oauth.c: Remove final strcat from OAuth code + + (flickcurl_oauth_prepare_common): replaced strcat with pointer + movement and memcpy + + * src/oauth.c: Remove strcpy and stract from OAuth code + + (flickcurl_oauth_prepare_common): strcpy and strcat replaced with + pointer movement and memcpy + + * src/photo.c: + (flickcurl_user_icon_uri): 42 + + * src/photo.c: + (flickcurl_photo_as_source_uri): Remove strcpy + + * src/machinetags.c: Switch to strlen / malloc / memcpy form + (flickcurl_build_tag_namespaces, + flickcurl_build_tag_predicate_values): Switch from sequence: + dest = malloc(strlen(str) + 1) + strcpy(dest, str) + to + len = strlen(str) + dest = malloc(len + 1) + memcpy(dest, str, len + 1) + to get rid of strcpy for known string length + + * src/legacy-auth.c: Remove strcpy from legacy auth code + + (flickcurl_legacy_prepare_common): Lots of url and parameter + counting. strcpy and strcat replaced with pointer movement and + memcpy + + * src/args.c: + (flickcurl_build_args): Fix strlen/malloc/memcpy cut-n-pasto + + * src/activity.c, src/args.c, src/blog.c, src/category.c, + src/comments.c, src/contacts.c, src/context.c, src/exif.c, + src/gallery.c, src/group.c, src/members.c, src/note.c, + src/oauth.c, src/panda-api.c, src/perms.c, src/photos-api.c, + src/photos-licenses-api.c, src/photoset.c, src/place.c, + src/reflection-api.c, src/serializer.c, src/size.c, src/stat.c, + src/tags.c, src/ticket.c, src/user_upload_status.c: Switch to + strlen / malloc / memcpy form for setters + + Switch from sequence: + dest = malloc(strlen(str) + 1) + strcpy(dest, str) + to + len = strlen(str) + dest = malloc(len + 1) + memcpy(dest, str, len + 1) + to get rid of strcpy for known string length + + * src/common.c: Switch to strlen / malloc / memcpy form for + setters + + (flickcurl_set_user_agent, flickcurl_set_proxy, + flickcurl_set_http_accept): swtich from "malloc(strcpy); strcpy" + to "strlen(); malloc(); memcpy()" sequence + + (flickcurl_invoke_common): Use same for raptor building URIs from + filename. + + * src/common.c, src/legacy-auth.c, src/oauth.c, src/photo.c: + Change slightly unportable strdup() with malloc + memcpy + + * src/group.c: Free attribute values if not used [clang] + + (flickcurl_build_groups): Free value from child node always + + * libmtwist: + Update submodule libmtwist + + * src/upload-api.c: Free status on error path [clang] + + (flickcurl_photos_upload_params, flickcurl_photos_replace): Free + status on error exist. + + * src/ticket.c: Free attribute values if not used [clang] + + (flickcurl_build_tickets): Free attr_value + + * src/tags.c: Free attribute values if not used. Free vars in loop + [clang] + + (flickcurl_build_tags): Free attr_value + + (flickcurl_build_tags_from_string): Use memcpy for known length + string. + + (flickcurl_build_tag_clusters): Free tc on loop skip Free tag + cluster on error exit. + + * src/stats-api.c: Initialise vars for errors. Free results on an + error [clang] + + (flickcurl_stats_getCollectionStats, + flickcurl_stats_getPhotosetStats, + flickcurl_stats_getPhotostreamStats): Initialize count vars for + error case. + + (flickcurl_stats_getTotalViews): Initialize count vars for error + case. Free views on error exits + + * src/stat.c: Free attribute values if not used [clang] + + (flickcurl_build_stats): Free attr_value + + * src/size.c: Free attribute values if not used [clang] + + (flickcurl_build_sizes): Free attr_value + + * src/shape.c: Free results on an error [clang] + + (flickcurl_build_shapes): Free shapes on error exits + + * src/place.c: Free results on an error, attribute values, calloc + fixes [clang] + + (flickcurl_build_places): Free places on error exits + + (flickcurl_build_place_types): Calloc correct object + pointer (semantic error but not dangerous). Calloc correct + parameter order. Free attribute value if not used. + + * src/photos-licenses-api.c: Free attribute values if not used + [clang] + + (flickcurl_read_licenses): Free attr_value + + * src/photos-api.c: Free attribute values if not used and objects + on error path [clang] + + (flickcurl_build_photocounts): Free attr_value + + (flickcurl_photos_getCounts): Free counts on error exit + + * src/photo.c: Free results on an error [clang] + + (flickcurl_build_photos): Free photos on error exits + + (flickcurl_invoke_photos_list): Check for NULL photos_list before + trying to call it + + * src/perms.c: Free attribute values if not used [clang] + + (flickcurl_build_perms): Free attr_value + + * src/panda-api.c: Free results on an error [clang] + + (flickcurl_panda_getList): Free pandas on error exits + + * src/note.c: Free attribute values if not used [clang] + + (flickcurl_build_notes): Free attr_value + + * src/method.c: Free results on an error [clang] + + (flickcurl_build_method): Free method on error exits + + * src/machinetags.c: Free attribute values if not used [clang] + + (flickcurl_build_tag_namespaces, + flickcurl_build_tag_predicate_values): Free attr_value + + * src/location.c: Memcpy and attribute value fixes [clang] + + (flickcurl_build_location): memcpy instead of strcpy. Always free + attribute value. + + * src/institution.c: Free results on an error [clang] + + (flickcurl_build_institutions): Free institutions on error exits + + * src/favorites-api.c: Free results on an error [clang] + + (flickcurl_favorites_getContext): Do not set an unused value. + Free photos lists on error exits + + * src/exif.c: Free attribute values if not used [clang] + + (flickcurl_build_exifs): Free attr_value + + * src/context.c: Fix allocation and freeing attribute values + [clang] + + (flickcurl_build_contexts): Calloc correct sized pointer (no + danger, but a semantic error). Free unused attribute values. + + * src/common.c: Set a return value always [clang] + + (flickcurl_prepare_common): Set rc and use memcpy for string + + * src/collection.c: Free results on an error [clang] + + (flickcurl_build_collections): Free collections on error exits + + * src/category.c: Free attribute values if not used [clang] + + (flickcurl_build_categories): Free attr_value + + * src/blog.c: Free attribute values if not used [clang] + + (flickcurl_build_blogs, flickcurl_build_blog_services): Free + attr_value + + * src/.gitignore, src/Makefile.am: Add analyze target for source + + * configure.ac: Add RECHO, RECHO_C, RECHO_N + + * src/Makefile.am: analyze + +2012-08-27 Dave Beckett + + * NEWS.html: 1.23 + + * NEWS.html: new APIs + + * src/common.c, src/flickcurl.h, src/oauth.c, utils/flickcurl.c: + Split oauth request token/secret setting into two functions + + (flickcurl_set_oauth_request_credentials): Deleted + + (flickcurl_set_oauth_request_token, + flickcurl_set_oauth_request_token_secret): Added, replacing above. + + * NEWS.html: OAuth API calls + + * NEWS.html: 1.23 + +2012-08-27 Dave Beckett + + * src/oauth.c: Remove unused parameters vars + (flickcurl_oauth_create_request_token, + flickcurl_oauth_create_access_token): Use flickcurl_end_params() + and count for form field counting + + * src/flickcurl.h, src/flickcurl_internal.h, + src/win32_flickcurl_config.h: 2012 + + * utils/codegen.c, utils/flickcurl.c, utils/flickrdf.c, + utils/list-methods.c, utils/oauth-test.c, utils/raptor_fake.c, + utils/raptor_fake.h: 2012 + + * src/activity-api.c, src/auth-api.c, src/blogs-api.c, + src/collection.c, src/collections-api.c, src/common.c, + src/commons-api.c, src/config.c, src/contacts-api.c, + src/favorites-api.c, src/galleries-api.c, src/groups-api.c, + src/groups-members-api.c, src/groups-pools-api.c, + src/interestingness-api.c, src/machinetags-api.c, src/oauth.c, + src/panda-api.c, src/people-api.c, src/person.c, src/photo.c, + src/photos-api.c, src/photos-comments-api.c, src/photos-geo-api.c, + src/photos-licenses-api.c, src/photos-notes-api.c, + src/photos-people-api.c, src/photos-transform-api.c, + src/photos-upload-api.c, src/photosets-api.c, + src/photosets-comments-api.c, src/places-api.c, src/prefs-api.c, + src/reflection-api.c, src/serializer.c, src/stats-api.c, + src/tags-api.c, src/test-api.c, src/upload-api.c, src/urls-api.c: + 2012 + +2012-08-26 Dave Beckett + + * src/places-api.c, src/reflection-api.c: Update count parameter + use to new style here too + + * src/activity-api.c, src/auth-api.c, src/blogs-api.c, + src/collections-api.c, src/common.c, src/commons-api.c, + src/contacts-api.c, src/favorites-api.c, src/flickcurl_internal.h, + src/galleries-api.c, src/groups-api.c, src/groups-members-api.c, + src/groups-pools-api.c, src/interestingness-api.c, + src/legacy-auth.c, src/machinetags-api.c, src/oauth.c, + src/panda-api.c, src/people-api.c, src/photos-api.c, + src/photos-comments-api.c, src/photos-geo-api.c, + src/photos-licenses-api.c, src/photos-notes-api.c, + src/photos-people-api.c, src/photos-transform-api.c, + src/photos-upload-api.c, src/photosets-api.c, + src/photosets-comments-api.c, src/places-api.c, src/prefs-api.c, + src/reflection-api.c, src/stats-api.c, src/tags-api.c, + src/test-api.c, src/upload-api.c: Move all use of 'count' var to + use fc->count + + (flickcurl_init_params, flickcurl_add_param, flickcurl_end_param): + Added and used in every API call to replace by-hand construction + of params and adjusting count variable. + + (flickcurl_prepare_common, flickcurl_legacy_prepare_common, + flickcurl_oauth_prepare_common, flickcurl_prepare_noauth, + flickcurl_prepare): Lose count param and use fc->count directly + for computing parameters and requests. + + (flickcurl_call_get_one_string_field): Use flickcurl_add_param + etc. + + (flickcurl_append_photos_list_params): Lose count param and use + flickcurl_add_param instead. Update all callers. + + * src/favorites-api.c, src/galleries-api.c, + src/groups-pools-api.c, src/interestingness-api.c, + src/people-api.c, src/photos-api.c, src/photos-comments-api.c, + src/photos-geo-api.c, src/photosets-api.c, src/stats-api.c: Update + flickcurl_append_photos_list_params calls without parameters + + * src/common.c, src/flickcurl_internal.h, src/legacy-auth.c, + src/oauth.c: Move parameters into flickcurl object as a fixed + array + + (flickcurl_prepare_common, flickcurl_prepare_noauth, + flickcurl_prepare_upload, flickcurl_append_photos_list_params, + flickcurl_sort_args, flickcurl_oauth_prepare_common): Remove + parameters argument from multiple calls, replacing it with use of + fc->parameters + + (flickcurl_call_get_one_string_field): use fc->parameters Declared + largest array of parameters once using + FLICKCURL_MAX_OAUTH_PARAM_COUNT and FLICKCURL_MAX_PARAM_COUNT + + * src/config.c, src/flickcurl.h, src/oauth.c: Replace + flickcurl_set_oauth_client_credentials() with two calls + + (flickcurl_set_oauth_client_key, + flickcurl_set_oauth_client_secret): Added. + + * src/config.c: + (flickcurl_config_var_handler): client key/secret get switched + + * src/oauth.c: Now legal C + + * utils/flickcurl.c: Add oauth-create and oauth-verify commands to + invoke OAuth flow + + (command_oauth_create): Added to create the request token/secret + + (command_oauth_verify): Added to verify the request from the OAuth + frob to give the access tokens. Saves the OAuth tokens to the + config file too. + + * src/oauth.c: Allow setting NULL fields in OAuth credential set + calls + + (flickcurl_set_oauth_client_credentials, + flickcurl_set_oauth_token, flickcurl_set_oauth_token_secret, + flickcurl_set_oauth_request_credentials): Allow NULL args and + set/cleanup correctly. + +2012-08-25 Dave Beckett + + * utils/flickcurl.c: + oauth docs + + * utils/oauth-test.c: Just use public APIs + + (oauth_prepare, oauth_test_echo): Removed + + (main): Remove flickcurl_set_oauth_client_credentials - the client + key/secret must be in the configuration file now. Call + flickcurl_test_echo(). + + * utils/oauth-test.c: + Allow callback URI + + * src/flickcurl.h, src/oauth.c, utils/oauth-test.c: + (flickcurl_oauth_create_request_token): Allow optional callback + + * src/flickcurl.h, src/flickcurl_internal.h, src/oauth.c, + utils/oauth-test.c: Expose oauth authentication calls to public + API + + (flickcurl_oauth_create_request_token): Made public, was + flickcurl_oauth_request_token internally. + + (flickcurl_oauth_create_request_token): Was + flickcurl_oauth_request_token + + (flickcurl_oauth_get_authorize_uri): + Made public. + + (flickcurl_oauth_create_access_token): Made public, + was flickcurl_oauth_access_token internally. + + (flickcurl_get_oauth_request_token, + flickcurl_get_oauth_request_token_secret, + flickcurl_set_oauth_request_credentials): Added to get/set the + request tokens. + + * src/person.c: + (flickcurl_build_persons): Tidy up better on loop exit and error + path Fixed leaks of - xpathNodeCtx always - person object and + persons array on errors + + * src/photo.c: + (flickcurl_build_photos): Fix leak of string_value for tags + + * configure.ac: + Curl version line fix + +2012-08-24 Dave Beckett + + * configure.ac: Use xml2-config and curl-config as well as + pkg-config + + * src/common.c: + (flickcurl_prepare_common): Make legacy auth work again + + * utils/flickcurl.c: OAuth + + * src/config.c: oauth_token_secret + + * src/config.c: Read oauth fields from config + + * utils/oauth-test.c: Use flickcurl_set_oauth_client_credentials() + + * src/flickcurl.h, src/oauth.c: Added getter/setters for OAuth + client key and secret + + (flickcurl_get_oauth_client_key, + flickcurl_get_oauth_client_secret): Added getters + + (flickcurl_set_oauth_client_credentials): Added setter. + + * src/common.c: + docs + + * src/auth-api.c: + (flickcurl_auth_oauth_getAccessToken): old secret becomes + client_secret + +2012-08-23 Dave Beckett + + * src/oauth.c: Turn code into a check for test failure + + * docs/tmpl/section-core.sgml: update tmpls + + * src/reflection-api.c: + (flickcurl_reflection_getMethods): No auth needed + + * docs/flickcurl-sections.txt: Added oauth get/setters + flickcurl_get_oauth_token flickcurl_get_oauth_token_secret + flickcurl_set_oauth_token flickcurl_set_oauth_token_secret + + * src/Makefile.am, src/common.c, src/flickcurl_internal.h, + src/legacy-auth.c: Move legacy auth code to new module + src/legacy-auth.c + + * src/common.c: Call legacy or OAuth to prepare and sign calls + (flickcurl_legacy_prepare_common): Renamed from + flickcurl_prepare_common. + + (flickcurl_prepare_common): Call legacy Flickr Auth - above - or + OAuth via flickcurl_oauth_prepare_common. + + * src/flickcurl_internal.h: docs for legacy auth fields + + * src/auth-api.c: + (flickcurl_auth_getToken): Store exchanged OAuth token/secret + + * utils/flickcurl.c: Document oauth_token and oauth_secret in + config + + * src/config.c: + (flickcurl_config_write_ini): Write oauth fields if set + + * src/common.c: Switch API Key source from fc->api_key to + fc->od.client_key Update docs to 'legacy Flickr auth' for + get/setters for legacy token and secret. + + * src/flickcurl.h, src/oauth.c: Add get/setters for OAuth tokens + + (flickcurl_get_oauth_token, flickcurl_set_oauth_token, + flickcurl_get_oauth_token_secret, + flickcurl_set_oauth_token_secret): Added + + * configure.ac, src/Makefile.am, src/common.c, + src/flickcurl_internal.h, utils/Makefile.am: Enable OAuth support + always + + * build/.gitignore, configure.ac: Add AM_PROG_AR for linking + +2012-04-18 Dave Beckett + + * src/photos-api.c: + (flickcurl_photos_setDates): Actually send date_taken parameter + Fixes GitHub issue https://github.com/dajobe/flickcurl/issues/15 + +2012-03-11 Dave Beckett + + * src/flickcurl.h: Document sizes + +2011-12-29 Dave Beckett + + * src/auth-api.c: 1.23 + + * NEWS.html: 1.23 + + * coverage.html: 1.22 and 1.23 + +2011-12-28 Dave Beckett + + * NEWS.html, configure.ac: + Bumped version to 1.23 + 2011-11-11 Dave Beckett * Snapshotted flickcurl_1_22 for 1.22 release (GIT diff -Nru flickcurl-1.22/INSTALL flickcurl-1.24/INSTALL --- flickcurl-1.22/INSTALL 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/INSTALL 2012-08-31 20:56:35.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -226,6 +226,11 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended diff -Nru flickcurl-1.22/LICENSE.html flickcurl-1.24/LICENSE.html --- flickcurl-1.22/LICENSE.html 2011-03-26 18:00:57.000000000 +0000 +++ flickcurl-1.24/LICENSE.html 2013-04-08 01:51:15.000000000 +0000 @@ -22,7 +22,7 @@
-

Copyright (C) 2007-2011 David Beckett. +

Copyright (C) 2007-2013 David Beckett. All Rights Reserved.

This package is free software; you can redistribute it and/or @@ -64,7 +64,7 @@

-

Copyright (C) 2007-2011 David Beckett.

+

Copyright (C) 2007-2013 David Beckett.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -85,7 +85,7 @@


-

Copyright (C) 2007-2011 David Beckett

+

Copyright (C) 2007-2013 David Beckett

diff -Nru flickcurl-1.22/Makefile.in flickcurl-1.24/Makefile.in --- flickcurl-1.22/Makefile.in 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/Makefile.in 2013-04-11 04:49:28.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 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. @@ -34,6 +34,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -57,9 +74,9 @@ $(srcdir)/Makefile.in $(srcdir)/flickcurl-config.in \ $(srcdir)/flickcurl.pc.in $(srcdir)/flickcurl.rdf.in \ $(srcdir)/flickcurl.spec.in $(top_srcdir)/configure AUTHORS \ - COPYING COPYING.LIB ChangeLog INSTALL NEWS build/compile \ - build/config.guess build/config.sub build/depcomp \ - build/install-sh build/ltmain.sh build/missing + COPYING COPYING.LIB ChangeLog INSTALL NEWS build/ar-lib \ + build/compile build/config.guess build/config.sub \ + build/depcomp build/install-sh build/ltmain.sh build/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ $(top_srcdir)/build/libtool.m4 \ @@ -97,13 +114,19 @@ 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)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" SCRIPTS = $(bin_SCRIPTS) -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = @@ -114,6 +137,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -127,9 +155,11 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -158,6 +188,8 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -172,6 +204,7 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -235,12 +268,14 @@ RAPTOR_CFLAGS = @RAPTOR_CFLAGS@ RAPTOR_LIBS = @RAPTOR_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ +RECHO = @RECHO@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STANDARD_CFLAGS = @STANDARD_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -321,7 +356,7 @@ .SUFFIXES: .SUFFIXES: .html .txt -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -365,8 +400,11 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ @@ -394,9 +432,7 @@ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) installcheck-binSCRIPTS: $(bin_SCRIPTS) bad=0; pid=$$$$; list="$(bin_SCRIPTS)"; for p in $$list; do \ @@ -423,8 +459,11 @@ -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -438,9 +477,7 @@ @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -617,13 +654,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -655,7 +689,11 @@ $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir @@ -663,7 +701,7 @@ $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -694,6 +732,8 @@ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -703,7 +743,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -713,6 +753,7 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -741,8 +782,16 @@ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -776,10 +825,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -867,20 +921,21 @@ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-generic distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binSCRIPTS 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-pkgconfigDATA install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installcheck-binSCRIPTS installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-pkgconfigDATA + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binSCRIPTS 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-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installcheck-binSCRIPTS \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-binSCRIPTS \ + uninstall-pkgconfigDATA .html.txt: diff -Nru flickcurl-1.22/NEWS flickcurl-1.24/NEWS --- flickcurl-1.22/NEWS 2011-12-29 00:17:38.000000000 +0000 +++ flickcurl-1.24/NEWS 2013-04-11 05:16:37.000000000 +0000 @@ -2,6 +2,149 @@ [1]Dave Beckett +2013-04-10 Flickcurl Version 1.24 Released + + Fixed uploading with OAuth - incorrect signature since it failed to use + POST. + + Added flickcurl_photos_getInfo2() deprecating + flickcurl_photos_getInfo() adding the optional 'secret' parameter that + was added sometime to the API. See [2]Debian bug 637746. + + Updated flickcurl(1) to allow photos.getInfo to take an optional SECRET + arg using the new call below, and to add the missing command + contacts.getPublicList which fixes [3]Issue 19. . + + Added new APIs calls to make available the Flickr username and NSID + when OAuth authentication is done. + const char* flickcurl_get_oauth_username(flickcurl* fc); + const char* flickcurl_get_oauth_user_nsid(flickcurl* fc); + + These new calls were from GitHub [4]pull request 18 from Jose Carlos + Garcia Sogo - thanks. + + Added a pile of fields to flickcurl_group to match what the API returns + rather than what the documentation says: + * iconfarm icon farm number + * is_moderator and is_member booleans + * rules descriptive text + * pool_count and topic_count counts + * group restriction booleans: photos_ok, videos_ok, images_ok, + screens_ok, art_ok, safe_ok, moderate_ok, restricted_ok, has_geo. + + Fixed grabbing text from a child text node correctly Fixes + [5]Issue 16. + p> + + Fixed parsing of latitude and longitude value responses. + + Fixed a few flickcurl(1) utility manual page wordings. See [6]Debian + bug 635989 and [7]Debian bug 635989. + + Updated example code to use OAuth authentication API. + + Fixed a few memory mis-uses via clang and GCC 4.8. + +2012-09-01 Flickcurl Version 1.23 Released + + This release fully supports using Flickr via OAuth 1.0 and converting + from the legacy Flickr authentication to OAuth. It supports both + authentication flows but Flickr has deprecated the legacy + authentication, so it might stop working at any time. + + Flickr [8]Legacy authentication flow with Flickcurl: + 1. The initial configuration needed is the API Key and Shared Secret, + obtained from the [9]Flickr App Garden. + 2. Get the Authentication URL from the Flickr App Garden. + 3. Show the Authentication URL to the user who approves the app + resulting in a user visible Frob. + 4. Authentication completes using flickcurl_auth_getFullToken() which + exchanges the Frob for the final Auth Token. + 5. Optionally, the flickcurl(1) utility will store in the + configuration file: auth_token, api_key and secret. Otherwise the + application should do this. + + Flickr [10]Flickr OAuth 1.0 flow with Flickcurl: + 1. The initial configuration needed is the Client Key (API Key) and + Client Secret (Shared Secret), obtained from the [11]Flickr App + Garden. + 2. Authentication starts with a call to + flickcurl_oauth_create_request_token() to get the Request Token and + Request Token Secret. + 3. Get the Authentication URL using + flickcurl_oauth_get_authorize_uri(). + 4. Show the Authentication URL to the user who approves the app + resulting in a user visible Verifier. + 5. Authentication completes using + flickcurl_oauth_create_access_token() to exchange the request + token, request token secret and verifier for the final Access Token + and Access Token Secret. + 6. Optionally, the flickcurl(1) utility will store in the + configuration file: oauth_token, oauth_token_secret, + oauth_client_key and oauth_client_secret. Otherwise the application + should do this. + + Added an API call to upgrade from the Flickr legacy authentication to + OAuth 1.0. This revokes and deletes the legacy 'auth_token' and returns + an OAuth Access Token and Access Token Secret pair which need to be + saved. + int flickcurl_auth_oauth_getAccessToken(flickcurl* fc) + + The upgrade can also be performed by using the oauth.upgrade command of + the flickcurl(1) utility. + + Added new API calls to get and set OAuth parameters: + const char* flickcurl_get_oauth_token(flickcurl *fc); + void flickcurl_set_oauth_token(flickcurl *fc, const char* token); + + const char* flickcurl_get_oauth_token_secret(flickcurl* fc); + void flickcurl_set_oauth_token_secret(flickcurl* fc, const char *secret); + + const char* flickcurl_get_oauth_client_key(flickcurl *fc); + void flickcurl_set_oauth_client_key(flickcurl *fc, const char* client_key); + + const char* flickcurl_get_oauth_client_secret(flickcurl *fc); + void flickcurl_set_oauth_client_secret(flickcurl *fc, const char* client_secre +t); + + const char* flickcurl_get_oauth_request_token(flickcurl* fc); + void flickcurl_set_oauth_request_token(flickcurl *fc, const char* token); + + const char* flickcurl_get_oauth_request_token_secret(flickcurl* fc); + void flickcurl_set_oauth_request_token_secret(flickcurl *fc, const char* secre +t); + + Added new API calls for performing the OAuth flow + int flickcurl_oauth_create_request_token(flickcurl* fc, const char* callback); + + char* flickcurl_oauth_get_authorize_uri(flickcurl* fc); + + int flickcurl_oauth_create_access_token(flickcurl* fc, const char* verifier); + + In flickcurl_photos_setDates() actually send date_taken parameter. This + fixes [12]GitHub issue 15 + + Updated configure to use xml2-config(1) and curl-config(1) as well as + pkg-config(1), for systems that do not ship with the pkg-config files, + such as OSX 10.8. + + Fixed memory leak in flickcurl_build_persons() on loop exit (always) + and on the error path. + + Fixed memory leak in flickcurl_build_photos() of string_value for tags. + + Updated flickcurl utility to handle the OAuth authentication flow with + new commands oauth-create and oauth-verify, while still supporting + legacy Flickr auth flow with the existing -a FROB form. + + Multiple internal changes in the construction of parameters to make the + code more readable and handle the extra parameters needed by OAuth. + + Multiple internal changes for error path and leaks found by the LLVM + [13]clang static code analyzer. + + Removed all strncpy, strcat and strcpy with counted memcpy. + 2011-12-28 Flickcurl Version 1.22 Released Add support for the upload field 'hidden' to set if a photo is visible @@ -19,7 +162,7 @@ version is 1.22 or newer to use this field and the helper functions. Added flickcurl_favorites_getContext() for new API call - [2]flickr.favorites.getContext, to get previous and next photos around + [14]flickr.favorites.getContext, to get previous and next photos around a favo(u)rite: flickcurl_photos_list** flickcurl_favorites_getContext(flickcurl* fc, const char* photo_id, const char* user_id, @@ -107,8 +250,8 @@ Added flickcurl_photosets_removePhotos(), flickcurl_photosets_reorderPhotos() and flickcurl_photosets_setPrimaryPhoto() for new API calls - [3]flickr.photosets.removePhotos, [4]flickr.photosets.reorderPhotos and - [5]flickr.photosets.setPrimaryPhoto: + [15]flickr.photosets.removePhotos, [16]flickr.photosets.reorderPhotos + and [17]flickr.photosets.setPrimaryPhoto: int flickcurl_photosets_removePhotos(flickcurl* fc, const char* photoset_id, const char** photo_ids_array); @@ -126,12 +269,12 @@ Added flickcurl_stats_getCSVFiles but it always does nothing since it expired at 2010-06-01. - Fixed portability operator typo '> =' and '+ =' lose spaces. [6]Issue + Fixed portability operator typo '> =' and '+ =' lose spaces. [18]Issue #4. 2010-04-26 Flickcurl 1.18 - Added (rest of) Galleries API calls as [7]announced 2010-04-08: + Added (rest of) Galleries API calls as [19]announced 2010-04-08: char* flickcurl_galleries_create(flickcurl* fc, const char* title, const char* description, const char* primary_photo_id, char** gallery_url_p); @@ -164,7 +307,7 @@ field for representing a photo's comments in a gallery context. Added function for new people API call (not announced): - [8]flickr.people.getPhotos: + [20]flickr.people.getPhotos: flickcurl_photos_list* flickcurl_people_getPhotos_params(flickcurl* fc, const char* user_id, int safe_search, @@ -203,18 +346,18 @@ 2010-03-05 Flickcurl 1.17 - Added functions for new stats API calls [9]announced 2010-03-03: - [10]flickr.stats.getCollectionDomains, - [11]flickr.stats.getCollectionReferrers, - [12]flickr.stats.getCollectionStats, [13]flickr.stats.getPhotoDomains, - [14]flickr.stats.getPhotoReferrers, - [15]flickr.stats.getPhotosetDomains, - [16]flickr.stats.getPhotosetReferrers, - [17]flickr.stats.getPhotosetStats, [18]flickr.stats.getPhotoStats, - [19]flickr.stats.getPhotostreamDomains, - [20]flickr.stats.getPhotostreamReferrers, - [21]flickr.stats.getPhotostreamStats, [22]flickr.stats.getPopularPhotos - and [23]flickr.stats.getTotalViews including new flickcurl_stats and + Added functions for new stats API calls [21]announced 2010-03-03: + [22]flickr.stats.getCollectionDomains, + [23]flickr.stats.getCollectionReferrers, + [24]flickr.stats.getCollectionStats, [25]flickr.stats.getPhotoDomains, + [26]flickr.stats.getPhotoReferrers, + [27]flickr.stats.getPhotosetDomains, + [28]flickr.stats.getPhotosetReferrers, + [29]flickr.stats.getPhotosetStats, [30]flickr.stats.getPhotoStats, + [31]flickr.stats.getPhotostreamDomains, + [32]flickr.stats.getPhotostreamReferrers, + [33]flickr.stats.getPhotostreamStats, [34]flickr.stats.getPopularPhotos + and [35]flickr.stats.getTotalViews including new flickcurl_stats and flickcurl_view_stats datatypes: flickcurl_stat** flickcurl_stats_getCollectionDomains(flickcurl* fc, const char* date, const char* collection_id, int per_page, int page); @@ -273,11 +416,11 @@ flickcurl_stats_getPopularPhotos() call. (View count field is already present). - Added functions for 5 new people API calls [24]announced 2010-01-21 - [25]flickr.photos.people.add, [26]flickr.photos.people.delete, - [27]flickr.photos.people.deleteCoords, - [28]flickr.photos.people.editCoords and - [29]flickr.photos.people.getList: + Added functions for 5 new people API calls [36]announced 2010-01-21 + [37]flickr.photos.people.add, [38]flickr.photos.people.delete, + [39]flickr.photos.people.deleteCoords, + [40]flickr.photos.people.editCoords and + [41]flickr.photos.people.getList: int flickcurl_photos_people_add(flickcurl* fc, const char* photo_id, const char* user_id, int person_x, int person_y, int person_w, int person_h) ; @@ -295,8 +438,8 @@ flickcurl_person** flickcurl_photos_people_getList(flickcurl* fc, const char* photo_id); - Added functions for 1 new "photos of" people API calls [30]announced - 2010-01-21 [31]flickr.people.getPhotosOf: + Added functions for 1 new "photos of" people API calls [42]announced + 2010-01-21 [43]flickr.people.getPhotosOf: flickcurl_photos_list* flickcurl_people_getPhotosOf_params(flickcurl* fc, const char* user_id, flickcurl_photos_list_params* list_params); @@ -305,8 +448,8 @@ Added functions for 3 new gallery API calls - not yet announced and seems a little incomplete e.g. you cannot list the photos in a gallery: - [32]flickr.galleries.addPhoto, [33]flickr.galleries.getList and - [34]flickr.galleries.getListForPhoto including new type + [44]flickr.galleries.addPhoto, [45]flickr.galleries.getList and + [46]flickr.galleries.getListForPhoto including new type flickcurl_gallery: int flickcurl_galleries_addPhoto(flickcurl* fc, const char* gallery_id, const char* photo_id, const char* comment_text); @@ -334,7 +477,7 @@ 2010-01-02 Flickcurl 1.15 The flickcurl_search_params gains an in_gallery boolean field which was - added to the photos search API [35]as announced 2009-12-17. + added to the photos search API [47]as announced 2009-12-17. The flickcurl(1) utility photos.search commands gains geo-context taking an integer arg for inside/outside, is-commons boolean flag and @@ -363,7 +506,7 @@ flickr.photos.geo.setLocation API call. The flickcurl_extras_format_info gains new API 'extras': path_alias, - url_m, url_o, url_s, url_sq, url_t as [36]announced 2009-06-29. + url_m, url_o, url_s, url_sq, url_t as [48]announced 2009-06-29. path_alias returns the user's Flickr URL as in /photos/user and the others provide various computed URLs and dimensions for the photos of a given size so that flickcurl_photos_getSizes() calls can be avoided @@ -406,14 +549,14 @@ 2009-07-04 Flickcurl 1.12 Added function flickcurl_places_getTopPlacesList() for new API call - [37]flickr.places.getTopPlacesList. + [49]flickr.places.getTopPlacesList. flickcurl_place** flickcurl_places_getTopPlacesList(flickcurl* fc, flickcurl_place_type place_type, const char* date, int woe_id, const char* place_id); Added function flickcurl_blogs_getServices() and new flickcurl_blog_service structure for describing a blog service. for new - API call [38]flickr.blogs.getServices. Added function + API call [50]flickr.blogs.getServices. Added function flickcurl_free_blog_services() to free blog services array. flickcurl_blog_service** flickcurl_blogs_getServices(flickcurl* fc); @@ -421,10 +564,10 @@ t); Added function flickcurl_photos_comments_getRecentForContacts_params() - for new API call [39]flickr.photos.comments.getRecentForContacts + for new API call [51]flickr.photos.comments.getRecentForContacts Added function flickcurl_machinetags_getRecentValues() for new API call - [40]flickr.machinetags.getRecentValues + [52]flickr.machinetags.getRecentValues Added flickr collections API including new flickcurl_collection datatype: @@ -454,9 +597,9 @@ from attribute value. In the Flickr API, there is always more than one way to get a field ;) - Switched from Subversion to GIT source control hosted by [41]GitHub. - The [42]GitHub flickcurl project page. previously was in Subversion at - [43]svn.dajobe.org and it moved as of SVN r1021 on 2006-06-02 after the + Switched from Subversion to GIT source control hosted by [53]GitHub. + The [54]GitHub flickcurl project page. previously was in Subversion at + [55]svn.dajobe.org and it moved as of SVN r1021 on 2006-06-02 after the 1.11 release tagged flickcurl_1_11. Update SHAVE from master GIT 2134bb1207e06d1650918a56f6b142e9a840219d @@ -485,7 +628,7 @@ PHOTO_FIELD_owner_iconfarm, PHOTO_FIELD_owner_iconserver and PHOTO_FIELD_views - Added donuthole support to shapes as [44]announced 2009-05-06. The + Added donuthole support to shapes as [56]announced 2009-05-06. The flicckurl_shapedata structure now has is_donuthole and has_donuthole boolean flag fields. @@ -521,7 +664,7 @@ versions, cflags and libs rather than the (deprecated) raptor-config program output. - Added configure [45]SHAVE support (git clone + Added configure [57]SHAVE support (git clone git://git.lespiau.name/shave ) to "make autotools output sane" which amounts to much less verbose messages when compiling. It is now enabled by default. @@ -546,16 +689,16 @@ 2009-04-04 Flickcurl 1.9 - Added functions for 2 new API calls [46]flickr.panda.getList - [47]flickr.panda.getPhotos as [48]announced on 2009-03-03 used in the - vomiting [49]Flickr Panda. + Added functions for 2 new API calls [58]flickr.panda.getList + [59]flickr.panda.getPhotos as [60]announced on 2009-03-03 used in the + vomiting [61]Flickr Panda. char** flickcurl_panda_getList(flickcurl* fc); flickcurl_photo** flickcurl_panda_getPhotos(flickcurl *fc, const char *panda_name); - Added function for 1 new API call [50]flickr.groups.members.getList as - [51]announced as experimental on 2009-02-24. + Added function for 1 new API call [62]flickr.groups.members.getList as + [63]announced as experimental on 2009-02-24. flickcurl_member** flickcurl_groups_members_getList(flickcurl* fc, const char* group_id, const char* membertypes, int per_page, int page); @@ -578,18 +721,18 @@ structure class. Added functions for 12 new API calls - [52]flickr.commons.getInstitutions, - [53]flickr.contacts.getListRecentlyUploaded, - [54]flickr.photos.geo.batchCorrectLocation, - [55]flickr.photos.geo.correctLocation, - [56]flickr.photos.geo.photosForLocation, - [57]flickr.photos.geo.setContext, [58]flickr.places.getPlaceTypes, - [59]flickr.places.getShapeHistory, - [60]flickr.places.placesForBoundingBox, - [61]flickr.places.placesForContacts, [62]flickr.places.placesForTags - and [63]flickr.places.tagsForPlace as announced [64]2009-01-12 - (flickr.places.getShapeHistory), [65]2009-01-14 - (flickr.contacts.getListRecentlyUploaded) and [66]2009-01-29 (Commons + [64]flickr.commons.getInstitutions, + [65]flickr.contacts.getListRecentlyUploaded, + [66]flickr.photos.geo.batchCorrectLocation, + [67]flickr.photos.geo.correctLocation, + [68]flickr.photos.geo.photosForLocation, + [69]flickr.photos.geo.setContext, [70]flickr.places.getPlaceTypes, + [71]flickr.places.getShapeHistory, + [72]flickr.places.placesForBoundingBox, + [73]flickr.places.placesForContacts, [74]flickr.places.placesForTags + and [75]flickr.places.tagsForPlace as announced [76]2009-01-12 + (flickr.places.getShapeHistory), [77]2009-01-14 + (flickr.contacts.getListRecentlyUploaded) and [78]2009-01-29 (Commons API): flickcurl_institution** flickcurl_commons_getInstitutions(flickcurl* fc); @@ -667,15 +810,15 @@ 2008-11-30 Flickcurl 1.7 - Added support for the new Machine Tags API as [67]announced 2008-11-18. + Added support for the new Machine Tags API as [79]announced 2008-11-18. Added representations for machine tag namespaces flickcurl_tag_namespace and machine tag predicate/value pairs flickcurl_tag_predicate_value. Added functions for the new API calls - [68]flickr.machinetags.getNamespaces, [69]flickr.machinetags.getPairs, - [70]flickr.machinetags.getPredicates and - [71]flickr.machinetags.getValues: + [80]flickr.machinetags.getNamespaces, [81]flickr.machinetags.getPairs, + [82]flickr.machinetags.getPredicates and + [83]flickr.machinetags.getValues: flickcurl_tag_namespace** flickcurl_machinetags_getNamespaces(flickcurl* fc, const char* predicate, int per_page, int page); @@ -699,16 +842,16 @@ vs); Added flickcurl_tags_getClusterPhotos() function for new API call - [72]flickr.tags.getClusterPhotos to get a set of photos around a + [84]flickr.tags.getClusterPhotos to get a set of photos around a cluster (of 3 tags). This was added to the web service API but not announced some time between 2008-09-04 ad 2008-09-19. flickcurl_photos_list* flickcurl_tags_getClusterPhotos(flickcurl* fc, const char* tag, const char* cluster_id, flickcurl_photos_list_params* list_params); - Updated Places API for changes as [73]announced 2008-11-05 and in - [74]The Shape of Alpha to support querying for places via place IDs or - [75]Where on Earth (WOE) Ids. The places APIs may now return ESRI shape + Updated Places API for changes as [85]announced 2008-11-05 and in + [86]The Shape of Alpha to support querying for places via place IDs or + [87]Where on Earth (WOE) Ids. The places APIs may now return ESRI shape information and flickcurl_place now stores any XML and ESRI shapefile URLs returned in a lookup call e.g: $ ./flickcurl places.getInfo 4hLQygSaBJ92 @@ -725,17 +868,17 @@ url '/Canada/Quebec/Montreal' 2) place locality: name 'Montreal, Quebec, Canada' id 4hLQygSaBJ92 woeid 3534 url '/Canada/Quebec/Montreal' - 3) place county: name 'Montreal, Quebec, Canada' id cFBi9x6bCJ8D5rba1g woeid 2 + 3) place county: name 'Montréal, Quebec, Canada' id cFBi9x6bCJ8D5rba1g woeid 2 9375198 url '/cFBi9x6bCJ8D5rba1g' 4) place region: name 'Quebec, Canada' id CrZUvXebApjI0.72 woeid 2344924 url ' /Canada/Quebec' 5) place country: name 'Canada' id EESRy8qbApgaeIkbsA woeid 23424775 url '/Can ada' - Added flickcurl_places_getInfo() for [76]flickr.places.getInfo, - flickcurl_places_getInfoByUrl() for [77]flickr.places.getInfoByUrl and + Added flickcurl_places_getInfo() for [88]flickr.places.getInfo, + flickcurl_places_getInfoByUrl() for [89]flickr.places.getInfoByUrl and flickcurl_places_getChildrenWithPhotosPublic() for - [78]flickr.places.getChildrenWithPhotosPublic: + [90]flickr.places.getChildrenWithPhotosPublic: flickcurl_place** flickcurl_places_getChildrenWithPhotosPublic(flickcurl* fc, const char* place_id, const char* woe_id); @@ -746,7 +889,7 @@ const char* url); Added flickcurl_places_placesForUser() function to match API name - correctly for API call [79]flickr.places.placesForUser deprecating + correctly for API call [91]flickr.places.placesForUser deprecating wrong name flickcurl_places_forUser(). flickcurl_place** flickcurl_places_placesForUser(flickcurl* fc, flickcurl_place_type place_type, int woe_id, const char* place_id, @@ -762,19 +905,19 @@ 2008-09-04 Flickcurl 1.6 - [80]"It's a beautiful day in the neighborhood" and also "Everybody - needs good [81]Neighbours". + [92]"It's a beautiful day in the neighborhood" and also "Everybody + needs good [93]Neighbours". Added PHOTO_FIELD_location_neighbourhood, PHOTO_FIELD_neighbourhood_placeid, PHOTO_FIELD_neighbourhood_woeid, PHOTO_FIELD_location_neighbourhood and FLICKCURL_PLACE_NEIGHBOURHOOD enum values making the American English spelling versions aliases for the British / Commonwealth English. Adjusted the XPaths to accept both spellings just in case Flickr changes this. The neighbourhood / - neighborhood feature was [82]announced 2008-08-19. + neighborhood feature was [94]announced 2008-08-19. Added flickcurl_places_forUser() function for new API call - [83]flickr.places.placesForUser to get the cluster of places for a user - as [84]announced 2008-09-04. + [95]flickr.places.placesForUser to get the cluster of places for a user + as [96]announced 2008-09-04. flickcurl_place** flickcurl_places_forUser(flickcurl* fc, flickcurl_place_type place_type, int woe_id, const char* place_id, int threshold); @@ -786,8 +929,8 @@ the standard photos response and flickcurl_photos_list_params for the parameters. This allows for existing result parameters (page, per_page, extras) as well as the new new format parameter to be given optionally. - The standard photos response format was [85]described 2008-08-19 and - the experimental feeds format feature was [86]announced 2008-08-25. + The standard photos response format was [97]described 2008-08-19 and + the experimental feeds format feature was [98]announced 2008-08-25. Added functions to return lists of photos with list results parameters based on existing functions without the _params suffix. The functions @@ -932,7 +1075,7 @@ 2008-08-17 Flickcurl 1.5 Added flickcurl_tags_getClusters() function for new API call - [87]flickr.tags.getClusters as [88]announced 2008-07-17 + [99]flickr.tags.getClusters as [100]announced 2008-07-17 Added Tag Clusters API support including new typedefs flickcurl_tag_cluster and flickcurl_tag_clusters and destructor @@ -947,7 +1090,7 @@ Updated flickcurl_photos_search() to add support for new photos.search contacts, has_geo, lat, lon, radius and radius_units parameters. The - lat, lon, radius and radius_units parameters were [89]announced + lat, lon, radius and radius_units parameters were [101]announced 2008-06-27 Updated flickrdf utility to make it build without raptor available. @@ -980,36 +1123,36 @@ Updated all the namespaces used by the RDF serializer to use a different use of machinetags.org as follows: 1. Public namespaces (existing schemas): - + [90]Dublin Core: Prefix: dc URI: + + [102]Dublin Core: Prefix: dc URI: http://purl.org/dc/elements/1.1/ legacy namespace - + [91]Dublin Core Terms: Prefix: dcterms URI: + + [103]Dublin Core Terms: Prefix: dcterms URI: http://purl.org/dc/terms/ new namespace with predicates dc:creator dc:dateSubmitted dc:rights dc:modified dc:issued dc:created dc:description dc:title - + [92]FOAF: Prefix: foaf URI: http://xmlns.com/foaf/0.1/ + + [104]FOAF: Prefix: foaf URI: http://xmlns.com/foaf/0.1/ with predicates foaf:maker foaf:name foaf:nick and classes foaf:Person foaf:Image - + [93]Geo by W3C SWIG: Prefix: geo URI: + + [105]Geo by W3C SWIG: Prefix: geo URI: http://www.w3.org/2003/01/geo/wgs84_pos# with predicates geo:lat geo:long - + [94]RDF Schema: Prefix: rdfs URI: + + [106]RDF Schema: Prefix: rdfs URI: http://www.w3.org/2000/01/rdf-schema# with predicates rdfs:label - + [95]RDF: Prefix: rdf URI: + + [107]RDF: Prefix: rdf URI: http://www.w3.org/1999/02/22-rdf-syntax-ns# with predicates rdf:type - + [96]XML Schema Datatypes: Prefix: xsd URI: + + [108]XML Schema Datatypes: Prefix: xsd URI: http://www.w3.org/2001/XMLSchema# with XSD datatypes xsd:boolean xsd:dateTime xsd:double xsd:integer 2. Flickr terminology namespaces (no schema yet): - + [97]Flickr API initially for video terms: Prefix: flickr URI: + + [109]Flickr API initially for video terms: Prefix: flickr URI: http://machinetags.org/ns/Flickr# with predicates flickr:image flickr:video flickr:width flickr:height and classes flickr:Video - + [98]Places API: Prefix: places URI: + + [110]Places API: Prefix: places URI: http://machinetags.org/ns/Places# with predicates places:place places:type places:name places:id places:placeid places:url and class places:Place @@ -1017,14 +1160,14 @@ machine tag prefix): + Bluetagging: Prefix: blue URI: http://machinetags.org/ns/Blue# + Celltagging: Prefix: cell URI: http://machinetags.org/ns/Cell# - + [99]Dopplr: Prefix: dopplr URI: + + [111]Dopplr: Prefix: dopplr URI: http://machinetags.org/ns/Dopplr# - + [100]Filtr: Prefix: filtr URI: + + [112]Filtr: Prefix: filtr URI: http://machinetags.org/ns/Filtr# - + [101]Geonames: Prefix: geonames URI: + + [113]Geonames: Prefix: geonames URI: http://machinetags.org/ns/Geonames# + Ph: Prefix: ph URI: http://machinetags.org/ns/Ph# - + [102]Upcoming: Prefix: upcoming URI: + + [114]Upcoming: Prefix: upcoming URI: http://machinetags.org/ns/Upcoming# Updated flickrdf(1) to use new serialization API and to have less @@ -1053,7 +1196,7 @@ Protect destructors from NULL args. In maintainer mode, a warning message and an abort happen. - Note that the woeids can be used with the new [103]Yahoo! Geo API + Note that the woeids can be used with the new [115]Yahoo! Geo API 2008-03-08 Flickcurl 1.3 @@ -1587,7 +1730,7 @@ announced and then removed. Renamed the "Flickr to RDF app" to be called flickrdf since I used - [104]Triplr for something else as it was such a good name. + [116]Triplr for something else as it was such a good name. 2007-02-25 Flickcurl 0.9 @@ -1777,7 +1920,7 @@ 2007-02-04 Flickcurl 0.5 - Added optional support for using [105]Raptor for more accurate and + Added optional support for using [117]Raptor for more accurate and prettier serializing triples in flickrdf Released to the world! @@ -1823,113 +1966,125 @@ 0% of API __________________________________________________________________ - Copyright (C) 2007-2011 [106]Dave Beckett + Copyright (C) 2007-2013 [118]Dave Beckett References 1. http://www.dajobe.org/ - 2. http://www.flickr.com/services/api/flickr.favorites.getContext.html - 3. http://www.flickr.com/services/api/flickr.photosets.removePhotos.html - 4. http://www.flickr.com/services/api/flickr.photosets.reorderPhotos.html - 5. http://www.flickr.com/services/api/flickr.photosets.setPrimaryPhoto.html - 6. http://github.com/dajobe/flickcurl/issues/#issue/4 - 7. http://code.flickr.com/blog/2010/04/08/galleries-apis/ - 8. http://www.flickr.com/services/api/flickr.people.getPhotos.html - 9. http://code.flickr.com/blog/2010/03/03/flickr-stats-api/ - 10. http://www.flickr.com/services/api/flickr.stats.getCollectionDomains.html - 11. http://www.flickr.com/services/api/flickr.stats.getCollectionReferrers.html - 12. http://www.flickr.com/services/api/flickr.stats.getCollectionStats.html - 13. http://www.flickr.com/services/api/flickr.stats.getPhotoDomains.html - 14. http://www.flickr.com/services/api/flickr.stats.getPhotoReferrers.html - 15. http://www.flickr.com/services/api/flickr.stats.getPhotosetDomains.html - 16. http://www.flickr.com/services/api/flickr.stats.getPhotosetReferrers.html - 17. http://www.flickr.com/services/api/flickr.stats.getPhotosetStats.html - 18. http://www.flickr.com/services/api/flickr.stats.getPhotoStats.html - 19. http://www.flickr.com/services/api/flickr.stats.getPhotostreamDomains.html - 20. http://www.flickr.com/services/api/flickr.stats.getPhotostreamReferrers.html - 21. http://www.flickr.com/services/api/flickr.stats.getPhotostreamStats.html - 22. http://www.flickr.com/services/api/flickr.stats.getPopularPhotos.html - 23. http://www.flickr.com/services/api/flickr.stats.getTotalViews.html - 24. http://code.flickr.com/blog/2010/01/21/people-in-photos-the-api-methods/ - 25. http://www.flickr.com/services/api/flickr.photos.people.add.html - 26. http://www.flickr.com/services/api/flickr.photos.people.delete.html - 27. http://www.flickr.com/services/api/flickr.photos.people.deleteCoords.html - 28. http://www.flickr.com/services/api/flickr.photos.people.editCoords.html - 29. http://www.flickr.com/services/api/flickr.photos.people.getList.html - 30. http://code.flickr.com/blog/2010/01/21/people-in-photos-the-api-methods/ - 31. http://www.flickr.com/services/api/flickr.people.getPhotosOf.html - 32. http://www.flickr.com/services/api/flickr.galleries.addPhoto.html - 33. http://www.flickr.com/services/api/flickr.galleries.getList.html - 34. http://www.flickr.com/services/api/flickr.galleries.getListForPhoto.html - 35. http://www.flickr.com/groups/api/discuss/72157622404753248/#comment72157622896186411 - 36. http://tech.groups.yahoo.com/group/yws-flickr/message/5053 - 37. http://www.flickr.com/services/api/flickr.places.getTopPlacesList.html - 38. http://www.flickr.com/services/api/flickr.blogs.getServices.html - 39. http://www.flickr.com/services/api/flickr.photos.comments.getRecentForContacts.html - 40. http://www.flickr.com/services/api/flickr.machinetags.getRecentValues.html - 41. http://github.com/ - 42. http://github.com/dajobe/flickcurl/tree/master - 43. http://svn.dajobe.org/view/ - 44. http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/ - 45. http://git.lespiau.name/cgit/shave/ - 46. http://www.flickr.com/services/api/flickr.panda.getList.html - 47. http://www.flickr.com/services/api/flickr.panda.getPhotos.html - 48. http://code.flickr.com/blog/2009/03/03/panda-tuesday-the-history-of-the-panda-new-apis-explore-and-you/ - 49. http://www.flickr.com/explore/panda - 50. http://www.flickr.com/services/api/flickr.groups.members.getList.html - 51. http://tech.groups.yahoo.com/group/yws-flickr/message/4749 - 52. http://www.flickr.com/services/api/flickr.commons.getInstitutions.html - 53. http://www.flickr.com/services/api/flickr.contacts.getListRecentlyUploaded.html - 54. http://www.flickr.com/services/api/flickr.photos.geo.batchCorrectLocation.html - 55. http://www.flickr.com/services/api/flickr.photos.geo.correctLocation.html - 56. http://www.flickr.com/services/api/flickr.photos.geo.photosForLocation.html - 57. http://www.flickr.com/services/api/flickr.photos.geo.setContext.html - 58. http://www.flickr.com/services/api/flickr.places.getPlaceTypes.html - 59. http://www.flickr.com/services/api/flickr.places.getShapeHistory.html - 60. http://www.flickr.com/services/api/flickr.places.placesForBoundingBox.html - 61. http://www.flickr.com/services/api/flickr.places.placesForContacts.html - 62. http://www.flickr.com/services/api/flickr.places.placesForTags.html - 63. http://www.flickr.com/services/api/flickr.places.tagsForPlace.html - 64. http://tech.groups.yahoo.com/group/yws-flickr/message/4669 - 65. http://tech.groups.yahoo.com/group/yws-flickr/message/4668 - 66. http://flickr.com/groups/api/discuss/72157613093793775/ - 67. http://tech.groups.yahoo.com/group/yws-flickr/message/4545 - 68. http://www.flickr.com/services/api/flickr.machinetags.getNamespaces.html - 69. http://www.flickr.com/services/api/flickr.machinetags.getPairs.html - 70. http://www.flickr.com/services/api/flickr.machinetags.getPredicates.html - 71. http://www.flickr.com/services/api/flickr.machinetags.getValues.html - 72. http://www.flickr.com/services/api/flickr.tags.getClusterPhotos.html - 73. http://tech.groups.yahoo.com/group/yws-flickr/message/4510 - 74. http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/ - 75. http://developer.yahoo.com/geo/ - 76. http://www.flickr.com/services/api/flickr.places.getInfo.html - 77. http://www.flickr.com/services/api/flickr.places.getInfoByUrl.html - 78. http://www.flickr.com/services/api/flickr.places.getChildrenWithPhotosPublic.html - 79. http://www.flickr.com/services/api/flickr.places.placesForUser.html - 80. http://en.wikipedia.org/wiki/Mister_Rogers%27_Neighborhood - 81. http://en.wikipedia.org/wiki/Neighbours - 82. http://geobloggers.com/2008/08/19/correcting-location-data-the-flickr-way/ - 83. http://www.flickr.com/services/api/flickr.places.placesForUser.html - 84. http://code.flickr.com/blog/2008/09/04/whos-on-first/ - 85. http://code.flickr.com/blog/2008/08/19/standard-photos-response-apis-for-civilized-age/ - 86. http://code.flickr.com/blog/2008/08/25/api-responses-as-feeds/ - 87. http://www.flickr.com/services/api/flickr.tags.getClusters.html - 88. http://tech.groups.yahoo.com/group/yws-flickr/message/4218 - 89. http://tech.groups.yahoo.com/group/yws-flickr/message/4146 - 90. http://dublincore.org/ - 91. http://dublincore.org/ - 92. http://www.foaf-project.org/ - 93. http://www.w3.org/2003/01/geo/ - 94. http://www.w3.org/TR/rdf-schema/ - 95. http://www.w3.org/TR/rdf-concepts/ - 96. http://www.w3.org/TR/xmlschema-1/ - 97. http://www.flickr.com/services/api/ - 98. http://www.flickr.com/services/api/ - 99. http://www.dopplr.com/ - 100. http://www.aaronland.info/bin/filtr/ - 101. http://www.geonames.org/ - 102. http://upcoming.yahoo.com/ - 103. http://developer.yahoo.com/geo/ - 104. http://triplr.org/ - 105. http://librdf.org/raptor - 106. http://www.dajobe.org/ + 2. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637746 + 3. https://github.com/dajobe/flickcurl/issues/19 + 4. https://github.com/dajobe/flickcurl/pull/18 + 5. https://github.com/dajobe/flickcurl/issues/16 + 6. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=635989 + 7. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=635989 + 8. http://www.flickr.com/services/api/misc.userauth.html + 9. http://www.flickr.com/services/ + 10. http://www.flickr.com/services/api/auth.oauth.html + 11. http://www.flickr.com/services/ + 12. https://github.com/dajobe/flickcurl/issues/15 + 13. http://clang-analyzer.llvm.org/ + 14. http://www.flickr.com/services/api/flickr.favorites.getContext.html + 15. http://www.flickr.com/services/api/flickr.photosets.removePhotos.html + 16. http://www.flickr.com/services/api/flickr.photosets.reorderPhotos.html + 17. http://www.flickr.com/services/api/flickr.photosets.setPrimaryPhoto.html + 18. http://github.com/dajobe/flickcurl/issues/#issue/4 + 19. http://code.flickr.com/blog/2010/04/08/galleries-apis/ + 20. http://www.flickr.com/services/api/flickr.people.getPhotos.html + 21. http://code.flickr.com/blog/2010/03/03/flickr-stats-api/ + 22. http://www.flickr.com/services/api/flickr.stats.getCollectionDomains.html + 23. http://www.flickr.com/services/api/flickr.stats.getCollectionReferrers.html + 24. http://www.flickr.com/services/api/flickr.stats.getCollectionStats.html + 25. http://www.flickr.com/services/api/flickr.stats.getPhotoDomains.html + 26. http://www.flickr.com/services/api/flickr.stats.getPhotoReferrers.html + 27. http://www.flickr.com/services/api/flickr.stats.getPhotosetDomains.html + 28. http://www.flickr.com/services/api/flickr.stats.getPhotosetReferrers.html + 29. http://www.flickr.com/services/api/flickr.stats.getPhotosetStats.html + 30. http://www.flickr.com/services/api/flickr.stats.getPhotoStats.html + 31. http://www.flickr.com/services/api/flickr.stats.getPhotostreamDomains.html + 32. http://www.flickr.com/services/api/flickr.stats.getPhotostreamReferrers.html + 33. http://www.flickr.com/services/api/flickr.stats.getPhotostreamStats.html + 34. http://www.flickr.com/services/api/flickr.stats.getPopularPhotos.html + 35. http://www.flickr.com/services/api/flickr.stats.getTotalViews.html + 36. http://code.flickr.com/blog/2010/01/21/people-in-photos-the-api-methods/ + 37. http://www.flickr.com/services/api/flickr.photos.people.add.html + 38. http://www.flickr.com/services/api/flickr.photos.people.delete.html + 39. http://www.flickr.com/services/api/flickr.photos.people.deleteCoords.html + 40. http://www.flickr.com/services/api/flickr.photos.people.editCoords.html + 41. http://www.flickr.com/services/api/flickr.photos.people.getList.html + 42. http://code.flickr.com/blog/2010/01/21/people-in-photos-the-api-methods/ + 43. http://www.flickr.com/services/api/flickr.people.getPhotosOf.html + 44. http://www.flickr.com/services/api/flickr.galleries.addPhoto.html + 45. http://www.flickr.com/services/api/flickr.galleries.getList.html + 46. http://www.flickr.com/services/api/flickr.galleries.getListForPhoto.html + 47. http://www.flickr.com/groups/api/discuss/72157622404753248/#comment72157622896186411 + 48. http://tech.groups.yahoo.com/group/yws-flickr/message/5053 + 49. http://www.flickr.com/services/api/flickr.places.getTopPlacesList.html + 50. http://www.flickr.com/services/api/flickr.blogs.getServices.html + 51. http://www.flickr.com/services/api/flickr.photos.comments.getRecentForContacts.html + 52. http://www.flickr.com/services/api/flickr.machinetags.getRecentValues.html + 53. http://github.com/ + 54. http://github.com/dajobe/flickcurl/tree/master + 55. http://svn.dajobe.org/view/ + 56. http://code.flickr.com/blog/2009/05/06/the-absence-and-the-anchor/ + 57. http://git.lespiau.name/cgit/shave/ + 58. http://www.flickr.com/services/api/flickr.panda.getList.html + 59. http://www.flickr.com/services/api/flickr.panda.getPhotos.html + 60. http://code.flickr.com/blog/2009/03/03/panda-tuesday-the-history-of-the-panda-new-apis-explore-and-you/ + 61. http://www.flickr.com/explore/panda + 62. http://www.flickr.com/services/api/flickr.groups.members.getList.html + 63. http://tech.groups.yahoo.com/group/yws-flickr/message/4749 + 64. http://www.flickr.com/services/api/flickr.commons.getInstitutions.html + 65. http://www.flickr.com/services/api/flickr.contacts.getListRecentlyUploaded.html + 66. http://www.flickr.com/services/api/flickr.photos.geo.batchCorrectLocation.html + 67. http://www.flickr.com/services/api/flickr.photos.geo.correctLocation.html + 68. http://www.flickr.com/services/api/flickr.photos.geo.photosForLocation.html + 69. http://www.flickr.com/services/api/flickr.photos.geo.setContext.html + 70. http://www.flickr.com/services/api/flickr.places.getPlaceTypes.html + 71. http://www.flickr.com/services/api/flickr.places.getShapeHistory.html + 72. http://www.flickr.com/services/api/flickr.places.placesForBoundingBox.html + 73. http://www.flickr.com/services/api/flickr.places.placesForContacts.html + 74. http://www.flickr.com/services/api/flickr.places.placesForTags.html + 75. http://www.flickr.com/services/api/flickr.places.tagsForPlace.html + 76. http://tech.groups.yahoo.com/group/yws-flickr/message/4669 + 77. http://tech.groups.yahoo.com/group/yws-flickr/message/4668 + 78. http://flickr.com/groups/api/discuss/72157613093793775/ + 79. http://tech.groups.yahoo.com/group/yws-flickr/message/4545 + 80. http://www.flickr.com/services/api/flickr.machinetags.getNamespaces.html + 81. http://www.flickr.com/services/api/flickr.machinetags.getPairs.html + 82. http://www.flickr.com/services/api/flickr.machinetags.getPredicates.html + 83. http://www.flickr.com/services/api/flickr.machinetags.getValues.html + 84. http://www.flickr.com/services/api/flickr.tags.getClusterPhotos.html + 85. http://tech.groups.yahoo.com/group/yws-flickr/message/4510 + 86. http://code.flickr.com/blog/2008/10/30/the-shape-of-alpha/ + 87. http://developer.yahoo.com/geo/ + 88. http://www.flickr.com/services/api/flickr.places.getInfo.html + 89. http://www.flickr.com/services/api/flickr.places.getInfoByUrl.html + 90. http://www.flickr.com/services/api/flickr.places.getChildrenWithPhotosPublic.html + 91. http://www.flickr.com/services/api/flickr.places.placesForUser.html + 92. http://en.wikipedia.org/wiki/Mister_Rogers%27_Neighborhood + 93. http://en.wikipedia.org/wiki/Neighbours + 94. http://geobloggers.com/2008/08/19/correcting-location-data-the-flickr-way/ + 95. http://www.flickr.com/services/api/flickr.places.placesForUser.html + 96. http://code.flickr.com/blog/2008/09/04/whos-on-first/ + 97. http://code.flickr.com/blog/2008/08/19/standard-photos-response-apis-for-civilized-age/ + 98. http://code.flickr.com/blog/2008/08/25/api-responses-as-feeds/ + 99. http://www.flickr.com/services/api/flickr.tags.getClusters.html + 100. http://tech.groups.yahoo.com/group/yws-flickr/message/4218 + 101. http://tech.groups.yahoo.com/group/yws-flickr/message/4146 + 102. http://dublincore.org/ + 103. http://dublincore.org/ + 104. http://www.foaf-project.org/ + 105. http://www.w3.org/2003/01/geo/ + 106. http://www.w3.org/TR/rdf-schema/ + 107. http://www.w3.org/TR/rdf-concepts/ + 108. http://www.w3.org/TR/xmlschema-1/ + 109. http://www.flickr.com/services/api/ + 110. http://www.flickr.com/services/api/ + 111. http://www.dopplr.com/ + 112. http://www.aaronland.info/bin/filtr/ + 113. http://www.geonames.org/ + 114. http://upcoming.yahoo.com/ + 115. http://developer.yahoo.com/geo/ + 116. http://triplr.org/ + 117. http://librdf.org/raptor + 118. http://www.dajobe.org/ diff -Nru flickcurl-1.22/NEWS.html flickcurl-1.24/NEWS.html --- flickcurl-1.22/NEWS.html 2011-12-29 00:16:14.000000000 +0000 +++ flickcurl-1.24/NEWS.html 2013-04-11 05:11:03.000000000 +0000 @@ -12,6 +12,182 @@

Dave Beckett

+

2013-04-10 Flickcurl Version 1.24 Released

+ +

Fixed uploading with OAuth - incorrect signature since it failed +to use POST.

+ +

Added flickcurl_photos_getInfo2() deprecating +flickcurl_photos_getInfo() adding the optional +'secret' parameter that was added sometime to the API. +See Debian bug 637746. +

+ +

Updated flickcurl(1) to allow photos.getInfo to take an +optional SECRET arg using the new call below, and +to add the missing command contacts.getPublicList which +fixes Issue 19. +.

+ +

Added new APIs calls to make available the Flickr username and +NSID when OAuth authentication is done. +

+
+  const char* flickcurl_get_oauth_username(flickcurl* fc);
+  const char* flickcurl_get_oauth_user_nsid(flickcurl* fc);
+
+

These new calls were from GitHub +pull request 18 +from Jose Carlos Garcia Sogo - thanks.

+ +

Added a pile of fields to flickcurl_group to match +what the API returns rather than what the documentation says:

+
    +
  • iconfarm icon farm number
  • +
  • is_moderator and is_member booleans
  • +
  • rules descriptive text
  • +
  • pool_count and topic_count counts
  • +
  • group restriction booleans: photos_ok, videos_ok, images_ok, screens_ok, art_ok, safe_ok, moderate_ok, restricted_ok, has_geo.
  • +
+ +

Fixed grabbing text from a <tag> child text node correctly +Fixes Issue 16. +

p> + +

Fixed parsing of latitude and longitude value responses.

+ +

Fixed a few flickcurl(1) utility manual page wordings. +See Debian bug 635989 +and Debian bug 635989. +

+ +

Updated example code to use OAuth authentication API.

+ +

Fixed a few memory mis-uses via clang and GCC 4.8.

+ + +

2012-09-01 Flickcurl Version 1.23 Released

+ +

This release fully supports using Flickr via OAuth 1.0 and +converting from the legacy Flickr authentication to OAuth. It +supports both authentication flows but Flickr has deprecated the +legacy authentication, so it might stop working at any time. +

+ +

Flickr Legacy authentication flow with Flickcurl:

+
    +
  1. The initial configuration needed is the API Key and Shared Secret, obtained from the Flickr App Garden.
  2. +
  3. Get the Authentication URL from the Flickr App Garden.
  4. +
  5. Show the Authentication URL to the user who approves the app resulting in + a user visible Frob.
  6. +
  7. Authentication completes using + flickcurl_auth_getFullToken() which exchanges the Frob for + the final Auth Token.
  8. +
  9. Optionally, the flickcurl(1) utility will store in + the configuration file: auth_token, api_key and secret. Otherwise the +application should do this.
  10. +
+ +

Flickr Flickr OAuth 1.0 flow with Flickcurl:

+
    +
  1. The initial configuration needed is the Client Key (API Key) and Client Secret (Shared Secret), obtained from the Flickr App Garden.
  2. +
  3. Authentication starts with a call to + flickcurl_oauth_create_request_token() to get the + Request Token and Request Token Secret.
  4. +
  5. Get the Authentication URL using + flickcurl_oauth_get_authorize_uri().
  6. +
  7. Show the Authentication URL to the user who approves the app resulting in + a user visible Verifier.
  8. +
  9. Authentication completes using + flickcurl_oauth_create_access_token() to exchange + the request token, request token secret and verifier for the final + Access Token and Access Token Secret.
  10. +
  11. Optionally, the flickcurl(1) utility will store in + the configuration file: oauth_token, oauth_token_secret, + oauth_client_key and oauth_client_secret. Otherwise the + application should do this. +
  12. +
+ +

Added an API call to upgrade from the Flickr legacy authentication +to OAuth 1.0. This revokes and deletes the legacy 'auth_token' and +returns an OAuth Access Token and Access Token Secret pair which need +to be saved.

+
+    int flickcurl_auth_oauth_getAccessToken(flickcurl* fc)
+
+ +

The upgrade can also be performed by using the +oauth.upgrade command of the flickcurl(1) +utility. +

+ +

Added new API calls to get and set OAuth parameters:

+ +
+  const char* flickcurl_get_oauth_token(flickcurl *fc);
+  void flickcurl_set_oauth_token(flickcurl *fc, const char* token);
+
+  const char* flickcurl_get_oauth_token_secret(flickcurl* fc);
+  void flickcurl_set_oauth_token_secret(flickcurl* fc, const char *secret);
+
+  const char* flickcurl_get_oauth_client_key(flickcurl *fc);
+  void flickcurl_set_oauth_client_key(flickcurl *fc, const char* client_key);
+
+  const char* flickcurl_get_oauth_client_secret(flickcurl *fc);
+  void flickcurl_set_oauth_client_secret(flickcurl *fc, const char* client_secret);
+
+  const char* flickcurl_get_oauth_request_token(flickcurl* fc);
+  void flickcurl_set_oauth_request_token(flickcurl *fc, const char* token);
+
+  const char* flickcurl_get_oauth_request_token_secret(flickcurl* fc);
+  void flickcurl_set_oauth_request_token_secret(flickcurl *fc, const char* secret);
+
+ +

Added new API calls for performing the OAuth flow

+ +
+  int flickcurl_oauth_create_request_token(flickcurl* fc, const char* callback);
+
+  char* flickcurl_oauth_get_authorize_uri(flickcurl* fc);
+
+  int flickcurl_oauth_create_access_token(flickcurl* fc, const char* verifier);
+
+ +

+In flickcurl_photos_setDates() actually send date_taken +parameter. This fixes +GitHub issue 15 +

+ +

Updated configure to use xml2-config(1) +and curl-config(1) as well as +pkg-config(1), for systems that do not ship with the +pkg-config files, such as OSX 10.8.

+ +

Fixed memory leak in flickcurl_build_persons() on +loop exit (always) and on the error path.

+ +

Fixed memory leak in flickcurl_build_photos() of +string_value for tags.

+ +

Updated flickcurl utility to handle the OAuth +authentication flow with new commands oauth-create and +oauth-verify, while still supporting legacy Flickr auth +flow with the existing -a FROB form.

+ +

Multiple internal changes in the construction of parameters to +make the code more readable and handle the extra parameters needed by +OAuth.

+ +

Multiple internal changes for error path and leaks found by the +LLVM clang static code +analyzer. +

+ +

Removed all strncpy, strcat and strcpy with counted memcpy.

+ +

2011-12-28 Flickcurl Version 1.22 Released

Add support for the upload field 'hidden' to set if a photo is @@ -2490,7 +2666,7 @@


-

Copyright (C) 2007-2011 Dave Beckett

+

Copyright (C) 2007-2013 Dave Beckett

diff -Nru flickcurl-1.22/README flickcurl-1.24/README --- flickcurl-1.22/README 2011-10-29 17:02:45.000000000 +0000 +++ flickcurl-1.24/README 2013-04-08 03:44:49.000000000 +0000 @@ -36,39 +36,38 @@ Checkout with: git clone git://github.com/dajobe/flickcurl.git - # After 2011-10-29 you need to get the libmtwist submodule and - # fetch its content with: + # Get the libmtwist submodule and fetch its content with: git submodule update --init Flickr API Configuration - The library needs to know your Flickr API application key, - authentication token and shared secret, suitable for calling some of - the API calls. To obtain these, you need to [15]apply for API keys at - the Flickr Services site. When using the utility programs, this - information should be stored in the ~/.flickcurl.conf file so that it - can be read at run-time. The configuration file has the format: + The library needs to know your Flickr API OAuth token, token secret, + client key and client secret, suitable for calling some of the API + calls. To obtain these, you need to [15]apply for API keys at the + Flickr Services site. When using the utility programs, this information + should be stored in the ~/.flickcurl.conf file so that it can be read + at run-time. The configuration file has the format: [flickr] -auth_token=1234567-8901234567890123 -api_key=0123456789abcdef0123456789abcdef -secret=fedcba9876543210 - - See [16]Authenticating Flickcurl in the manual for full details of how - to build flickcurl, authenticate and set up the configuration file - above. +oauth_token=12345678901234567-abcdef0123456789 +oauth_token_secret=abcdef9876543210 +oauth_client_key=0123456789abcdef0123456789abcdef +oauth_client_secret=fedcba9876543210 + + See [16]Authenticating Flickcurl for OAuth in the manual for full + details of how to build flickcurl, authenticate and set up the + configuration file above. Utility programs flickcurl - call Flickr API - This can call some of the Flickr APIs plus help with authentication by - turning [17]mobile authentication method frobs into full auth_tokens - with -a NNN-NNN-NNN and writing the ~/.flickcurl.conf file. Use - flickcurl -h to get a list of the supported commands and their - arguments. + This can call some of the Flickr APIs plus help with OAuth + authentication steps to get the final set of tokens and secrets and + writing them into ~/.flickcurl.conf file. Use flickcurl -h to get a + list of the supported commands and their arguments. - This example calls the [18]photos.getInfo API via the photos-getInfo + This example calls the [17]photos.getInfo API via the photos-getInfo command on photo 196308964 which decodes the returned XML into fields in a flickcurl_photo structure which are then printed with their datatype, string value and integer value (or -1 if it has none). All @@ -77,56 +76,60 @@ also returned when present along with their id, author, raw, cooked and machine tag status. $ flickcurl photos.getInfo 196308964 -flickcurl: Found photo with URI http://www.flickr.com/photos/dajobe/196308964/ I -D 196308964 and 5 tags -field dateuploaded (1) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573 -field farm (2) with integer value: '1' / 1 -field isfavorite (3) with boolean value: '0' / 0 -field license (4) with integer value: '1' / 1 -field originalformat (5) with string value: 'jpg' / -1 -field rotation (6) with integer value: '0' / 0 -field server (7) with integer value: '57' / 57 -field dates_lastupdate (8) with dateTime value: '2007-02-25T07:45:46Z' / 1172389 -546 -field dates_posted (9) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573 -field dates_taken (10) with string value: '2006-07-22 22:28:50' / -1 -field dates_takengranularity (11) with integer value: '0' / 0 -field editability_canaddmeta (13) with boolean value: '1' / 1 -field editability_cancomment (14) with boolean value: '1' / 1 -field geoperms_iscontact (15) with boolean value: '0' / 0 -field geoperms_isfamily (16) with boolean value: '0' / 0 -field geoperms_isfriend (17) with boolean value: '0' / 0 -field geoperms_ispublic (18) with boolean value: '1' / 1 -field location_accuracy (19) with integer value: '12' / 12 -field location_latitude (20) with float value: '36.620487' / -1 -field location_longitude (21) with float value: '-121.904468' / -1 -field owner_location (22) with string value: 'Mountain View, California, USA' / --1 -field owner_nsid (23) with string value: '13355580@N00' / -1 -field owner_realname (24) with string value: 'Dave Beckett' / -1 -field owner_username (25) with string value: 'dajobe' / -1 -field title (26) with string value: 'Jellyfish at Monterey Aquarium' / -1 -field visibility_isfamily (27) with boolean value: '0' / 0 -field visibility_isfriend (28) with boolean value: '0' / 0 -field visibility_ispublic (29) with boolean value: '1' / 1 -field secret (30) with string value: '**********' / -1 -field originalsecret (31) with string value: '**********' / -1 -field location_locality (33) with string value: 'Pacific Grove' / -1 -field location_region (35) with string value: 'California' / -1 -field location_country (36) with string value: 'United States' / -1 -field location_placeid (37) with string value: 'WM3JEXSbBZqqRtGA' / -1 -field locality_placeid (39) with string value: 'WM3JEXSbBZqqRtGA' / -1 -field county_placeid (40) with string value: 'AQ4UpRqYA5l0BiyF.A' / -1 -field region_placeid (41) with string value: 'SVrAMtCbAphCLAtP' / -1 -field country_placeid (42) with string value: '4KO02SibApitvSBieQ' / -1 -field location_woeid (43) with string value: '2467327' / -1 -field locality_woeid (45) with string value: '2467327' / -1 -field county_woeid (46) with string value: '12587696' / -1 -field region_woeid (47) with string value: '2347563' / -1 -field country_woeid (48) with string value: '23424977' / -1 -field usage_candownload (49) with boolean value: '1' / 1 -field usage_canblog (50) with boolean value: '1' / 1 -field usage_canprint (51) with boolean value: '1' / 1 +flickcurl: photo with URI http://www.flickr.com/photos/dajobe/196308964/ ID 1963 +08964 and 5 tags + field dateuploaded (1) with dateTime value: '2006-07-23T18:16:13Z' / 1153678 +573 + field farm (2) with integer value: '1' / 1 + field isfavorite (3) with boolean value: '0' / 0 + field license (4) with integer value: '1' / 1 + field originalformat (5) with string value: 'jpg' / -1 + field rotation (6) with integer value: '0' / 0 + field server (7) with integer value: '57' / 57 + field dates_lastupdate (8) with dateTime value: '2007-02-25T07:45:46Z' / 117 +2389546 + field dates_posted (9) with dateTime value: '2006-07-23T18:16:13Z' / 1153678 +573 + field dates_taken (10) with string value: '2006-07-22 22:28:50' / -1 + field dates_takengranularity (11) with integer value: '0' / 0 + field editability_canaddmeta (13) with boolean value: '1' / 1 + field editability_cancomment (14) with boolean value: '1' / 1 + field geoperms_iscontact (15) with boolean value: '0' / 0 + field geoperms_isfamily (16) with boolean value: '0' / 0 + field geoperms_isfriend (17) with boolean value: '0' / 0 + field geoperms_ispublic (18) with boolean value: '1' / 1 + field location_accuracy (19) with integer value: '12' / 12 + field location_latitude (20) with float value: '36.620487' / -1 + field location_longitude (21) with float value: '-121.904468' / -1 + field owner_location (22) with string value: 'Mountain View, California, USA +' / -1 + field owner_nsid (23) with string value: '13355580@N00' / -1 + field owner_realname (24) with string value: 'Dave Beckett' / -1 + field owner_username (25) with string value: 'dajobe' / -1 + field title (26) with string value: 'Jellyfish at Monterey Aquarium' / -1 + field visibility_isfamily (27) with boolean value: '0' / 0 + field visibility_isfriend (28) with boolean value: '0' / 0 + field visibility_ispublic (29) with boolean value: '1' / 1 + field secret (30) with string value: 'b34cb0af68' / -1 + field originalsecret (31) with string value: 'b34cb0af68' / -1 + field location_locality (33) with string value: 'Pacific Grove' / -1 + field location_region (35) with string value: 'California' / -1 + field location_country (36) with string value: 'United States' / -1 + field location_placeid (37) with string value: 'J1HdelRTVrx7R.g2' / -1 + field locality_placeid (39) with string value: 'J1HdelRTVrx7R.g2' / -1 + field county_placeid (40) with string value: 'fpIAzjpQUL9F5MEpDw' / -1 + field region_placeid (41) with string value: 'NsbUWfBTUb4mbyVu' / -1 + field country_placeid (42) with string value: 'nz.gsghTUb4c2WAecA' / -1 + field location_woeid (43) with string value: '2467327' / -1 + field locality_woeid (45) with string value: '2467327' / -1 + field county_woeid (46) with string value: '12587696' / -1 + field region_woeid (47) with string value: '2347563' / -1 + field country_woeid (48) with string value: '23424977' / -1 + field usage_candownload (49) with boolean value: '1' / 1 + field usage_canblog (50) with boolean value: '1' / 1 + field usage_canprint (51) with boolean value: '1' / 1 + field views (56) with integer value: '529' / 529 +tags: 0) regular tag: id 94493-196308964-3362 author ID 13355580@N00 name (Unknown) ra w 'jellyfish' cooked 'jellyfish' count 0 1) regular tag: id 94493-196308964-119180 author ID 13355580@N00 name (Unknown) @@ -138,16 +141,19 @@ lements11' count 0 4) machine tag: id 94493-196308964-8499315 author ID 13355580@N00 name (Unknown) raw 'dc:subject=jellyfish' cooked 'dc:subject=jellyfish' count 0 -0) place location: id WM3JEXSbBZqqRtGA woeid 2467327 -2) place locality: name 'Pacific Grove' id WM3JEXSbBZqqRtGA woeid 2467327 -3) place county: name 'Monterey' id AQ4UpRqYA5l0BiyF.A woeid 12587696 -4) place region: name 'California' id SVrAMtCbAphCLAtP woeid 2347563 -5) place country: name 'United States' id 4KO02SibApitvSBieQ woeid 23424977 +notes: + Location: latitude 36.620487 longitude -121.904468 accuracy unknown + 0) place location: name ' + ' id J1HdelRTVrx7R.g2 woeid 2467327 + 2) place locality: name 'Pacific Grove' id J1HdelRTVrx7R.g2 woeid 2467327 + 3) place county: name 'Monterey' id fpIAzjpQUL9F5MEpDw woeid 12587696 + 4) place region: name 'California' id NsbUWfBTUb4mbyVu woeid 2347563 + 5) place country: name 'United States' id nz.gsghTUb4c2WAecA woeid 23424977 flickrdf - generate RDF triples from a Flickr photo This utility uses the photos.getInfo API to interpret the description - fields, tags and places for a photo URI into RDF triples. If [19]raptor + fields, tags and places for a photo URI into RDF triples. If [18]raptor is present, it will be used to provide proper serializing to RDF rather than the built in and hacky ntriples/turtle output. @@ -384,17 +390,18 @@ int i; flickcurl_init(); /* optional static initialising of resources */ - fc=flickcurl_new(); + fc = flickcurl_new(); /* Set configuration, or more likely read from a config file */ - flickcurl_set_api_key(fc, "..."); - flickcurl_set_shared_secret(fc, "..."); - flickcurl_set_auth_token(fc, "..."); + flickcurl_set_oauth_client_key(fc, "..."); + flickcurl_set_oauth_client_secret(fc, "..."); + flickcurl_set_oauth_token(fc, "..."); + flickcurl_set_oauth_token_secret(fc, "..."); - photo=flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */ + photo = flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */ - for(field_type=0; field_type <= PHOTO_FIELD_LAST; field_type++) { - flickcurl_field_value_type datatype=photo->fields[field_type].type; + for(field_type = 0; field_type <= PHOTO_FIELD_LAST; field_type++) { + flickcurl_field_value_type datatype = photo->fields[field_type].type; if(datatype != VALUE_TYPE_NONE) fprintf(stderr, "field %s (%d) with %s value: '%s' / %d\n", @@ -404,7 +411,7 @@ photo->fields[field_type].integer); } - for(i=0; i < photo->tags_count; i++) { + for(i = 0; i < photo->tags_count; i++) { flickcurl_tag* tag=photo->tags[i]; fprintf(stderr, "%d) %s tag: id %s author ID %s name %s raw '%s' cooked '%s' count % @@ -427,7 +434,7 @@ utility in flickcurl.c which has code that calls all the API functions. __________________________________________________________________ - Copyright (C) 2007-2011 [20]Dave Beckett + Copyright (C) 2007-2013 [19]Dave Beckett References @@ -444,10 +451,9 @@ 11. http://xmlsoft.org/ 12. http://librdf.org/raptor/ 13. http://github.com/ - 14. http://github.com/dajobe/flickcurl/tree/master + 14. https://github.com/dajobe/flickcurl 15. http://www.flickr.com/services/api/keys/apply/ - 16. http://librdf.org/flickcurl/api/flickcurl-auth.html - 17. http://www.flickr.com/services/api/auth.howto.mobile.html - 18. http://www.flickr.com/services/api/flickr.photos.getInfo.html - 19. http://librdf.org/raptor/ - 20. http://www.dajobe.org/ + 16. http://librdf.org/flickcurl/api/flickcurl-oauth.html + 17. http://www.flickr.com/services/api/flickr.photos.getInfo.html + 18. http://librdf.org/raptor/ + 19. http://www.dajobe.org/ diff -Nru flickcurl-1.22/README.html flickcurl-1.24/README.html --- flickcurl-1.22/README.html 2011-10-29 17:00:17.000000000 +0000 +++ flickcurl-1.24/README.html 2013-04-08 02:28:37.000000000 +0000 @@ -52,15 +52,14 @@

GitHub hosts the sources for Flickcurl at the -GitHub flickcurl project page. +GitHub flickcurl project page.

Checkout with:

   git clone git://github.com/dajobe/flickcurl.git
 
-  # After 2011-10-29 you need to get the libmtwist submodule and
-  # fetch its content with:
+  # Get the libmtwist submodule and fetch its content with:
 
   git submodule update --init
 
@@ -68,8 +67,8 @@

Flickr API Configuration

-

The library needs to know your Flickr API application key, -authentication token and shared secret, suitable for calling some of +

The library needs to know your Flickr API OAuth token, token +secret, client key and client secret, suitable for calling some of the API calls. To obtain these, you need to apply for API keys at the Flickr Services site. When using the utility programs, this @@ -78,13 +77,14 @@ format:

 [flickr]
-auth_token=1234567-8901234567890123
-api_key=0123456789abcdef0123456789abcdef
-secret=fedcba9876543210
+oauth_token=12345678901234567-abcdef0123456789
+oauth_token_secret=abcdef9876543210
+oauth_client_key=0123456789abcdef0123456789abcdef
+oauth_client_secret=fedcba9876543210
 

See -Authenticating Flickcurl +Authenticating Flickcurl for OAuth in the manual for full details of how to build flickcurl, authenticate and set up the configuration file above.

@@ -95,10 +95,8 @@

flickcurl - call Flickr API

This can call some of the Flickr APIs plus help with -authentication by turning -mobile authentication method -frobs into full auth_tokens with -a NNN-NNN-NNN -and writing the ~/.flickcurl.conf file. Use +OAuth authentication steps to get the final set of tokens and secrets +and writing them into ~/.flickcurl.conf file. Use flickcurl -h to get a list of the supported commands and their arguments.

@@ -116,63 +114,68 @@
 $ flickcurl photos.getInfo 196308964
-flickcurl: Found photo with URI http://www.flickr.com/photos/dajobe/196308964/ ID 196308964 and 5 tags
-field dateuploaded (1) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573
-field farm (2) with integer value: '1' / 1
-field isfavorite (3) with boolean value: '0' / 0
-field license (4) with integer value: '1' / 1
-field originalformat (5) with string value: 'jpg' / -1
-field rotation (6) with integer value: '0' / 0
-field server (7) with integer value: '57' / 57
-field dates_lastupdate (8) with dateTime value: '2007-02-25T07:45:46Z' / 1172389546
-field dates_posted (9) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573
-field dates_taken (10) with string value: '2006-07-22 22:28:50' / -1
-field dates_takengranularity (11) with integer value: '0' / 0
-field editability_canaddmeta (13) with boolean value: '1' / 1
-field editability_cancomment (14) with boolean value: '1' / 1
-field geoperms_iscontact (15) with boolean value: '0' / 0
-field geoperms_isfamily (16) with boolean value: '0' / 0
-field geoperms_isfriend (17) with boolean value: '0' / 0
-field geoperms_ispublic (18) with boolean value: '1' / 1
-field location_accuracy (19) with integer value: '12' / 12
-field location_latitude (20) with float value: '36.620487' / -1
-field location_longitude (21) with float value: '-121.904468' / -1
-field owner_location (22) with string value: 'Mountain View, California, USA' / -1
-field owner_nsid (23) with string value: '13355580@N00' / -1
-field owner_realname (24) with string value: 'Dave Beckett' / -1
-field owner_username (25) with string value: 'dajobe' / -1
-field title (26) with string value: 'Jellyfish at Monterey Aquarium' / -1
-field visibility_isfamily (27) with boolean value: '0' / 0
-field visibility_isfriend (28) with boolean value: '0' / 0
-field visibility_ispublic (29) with boolean value: '1' / 1
-field secret (30) with string value: '**********' / -1
-field originalsecret (31) with string value: '**********' / -1
-field location_locality (33) with string value: 'Pacific Grove' / -1
-field location_region (35) with string value: 'California' / -1
-field location_country (36) with string value: 'United States' / -1
-field location_placeid (37) with string value: 'WM3JEXSbBZqqRtGA' / -1
-field locality_placeid (39) with string value: 'WM3JEXSbBZqqRtGA' / -1
-field county_placeid (40) with string value: 'AQ4UpRqYA5l0BiyF.A' / -1
-field region_placeid (41) with string value: 'SVrAMtCbAphCLAtP' / -1
-field country_placeid (42) with string value: '4KO02SibApitvSBieQ' / -1
-field location_woeid (43) with string value: '2467327' / -1
-field locality_woeid (45) with string value: '2467327' / -1
-field county_woeid (46) with string value: '12587696' / -1
-field region_woeid (47) with string value: '2347563' / -1
-field country_woeid (48) with string value: '23424977' / -1
-field usage_candownload (49) with boolean value: '1' / 1
-field usage_canblog (50) with boolean value: '1' / 1
-field usage_canprint (51) with boolean value: '1' / 1
+flickcurl: photo with URI http://www.flickr.com/photos/dajobe/196308964/ ID 196308964 and 5 tags
+    field dateuploaded (1) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573
+    field farm (2) with integer value: '1' / 1
+    field isfavorite (3) with boolean value: '0' / 0
+    field license (4) with integer value: '1' / 1
+    field originalformat (5) with string value: 'jpg' / -1
+    field rotation (6) with integer value: '0' / 0
+    field server (7) with integer value: '57' / 57
+    field dates_lastupdate (8) with dateTime value: '2007-02-25T07:45:46Z' / 1172389546
+    field dates_posted (9) with dateTime value: '2006-07-23T18:16:13Z' / 1153678573
+    field dates_taken (10) with string value: '2006-07-22 22:28:50' / -1
+    field dates_takengranularity (11) with integer value: '0' / 0
+    field editability_canaddmeta (13) with boolean value: '1' / 1
+    field editability_cancomment (14) with boolean value: '1' / 1
+    field geoperms_iscontact (15) with boolean value: '0' / 0
+    field geoperms_isfamily (16) with boolean value: '0' / 0
+    field geoperms_isfriend (17) with boolean value: '0' / 0
+    field geoperms_ispublic (18) with boolean value: '1' / 1
+    field location_accuracy (19) with integer value: '12' / 12
+    field location_latitude (20) with float value: '36.620487' / -1
+    field location_longitude (21) with float value: '-121.904468' / -1
+    field owner_location (22) with string value: 'Mountain View, California, USA' / -1
+    field owner_nsid (23) with string value: '13355580@N00' / -1
+    field owner_realname (24) with string value: 'Dave Beckett' / -1
+    field owner_username (25) with string value: 'dajobe' / -1
+    field title (26) with string value: 'Jellyfish at Monterey Aquarium' / -1
+    field visibility_isfamily (27) with boolean value: '0' / 0
+    field visibility_isfriend (28) with boolean value: '0' / 0
+    field visibility_ispublic (29) with boolean value: '1' / 1
+    field secret (30) with string value: 'b34cb0af68' / -1
+    field originalsecret (31) with string value: 'b34cb0af68' / -1
+    field location_locality (33) with string value: 'Pacific Grove' / -1
+    field location_region (35) with string value: 'California' / -1
+    field location_country (36) with string value: 'United States' / -1
+    field location_placeid (37) with string value: 'J1HdelRTVrx7R.g2' / -1
+    field locality_placeid (39) with string value: 'J1HdelRTVrx7R.g2' / -1
+    field county_placeid (40) with string value: 'fpIAzjpQUL9F5MEpDw' / -1
+    field region_placeid (41) with string value: 'NsbUWfBTUb4mbyVu' / -1
+    field country_placeid (42) with string value: 'nz.gsghTUb4c2WAecA' / -1
+    field location_woeid (43) with string value: '2467327' / -1
+    field locality_woeid (45) with string value: '2467327' / -1
+    field county_woeid (46) with string value: '12587696' / -1
+    field region_woeid (47) with string value: '2347563' / -1
+    field country_woeid (48) with string value: '23424977' / -1
+    field usage_candownload (49) with boolean value: '1' / 1
+    field usage_canblog (50) with boolean value: '1' / 1
+    field usage_canprint (51) with boolean value: '1' / 1
+    field views (56) with integer value: '529' / 529
+tags:
 0) regular tag: id 94493-196308964-3362 author ID 13355580@N00 name (Unknown) raw 'jellyfish' cooked 'jellyfish' count 0
 1) regular tag: id 94493-196308964-119180 author ID 13355580@N00 name (Unknown) raw 'montereyaquarium' cooked 'montereyaquarium' count 0
 2) regular tag: id 94493-196308964-2443 author ID 13355580@N00 name (Unknown) raw 'monterey' cooked 'monterey' count 0
 3) machine tag: id 94493-196308964-8499312 author ID 13355580@N00 name (Unknown) raw 'xmlns:dc=http://purl.org/dc/elements/1.1/' cooked 'xmlns:dc=httppurlorgdcelements11' count 0
 4) machine tag: id 94493-196308964-8499315 author ID 13355580@N00 name (Unknown) raw 'dc:subject=jellyfish' cooked 'dc:subject=jellyfish' count 0
-0) place location: id WM3JEXSbBZqqRtGA woeid 2467327
-2) place locality: name 'Pacific Grove' id WM3JEXSbBZqqRtGA woeid 2467327
-3) place county: name 'Monterey' id AQ4UpRqYA5l0BiyF.A woeid 12587696
-4) place region: name 'California' id SVrAMtCbAphCLAtP woeid 2347563
-5) place country: name 'United States' id 4KO02SibApitvSBieQ woeid 23424977
+notes:
+  Location: latitude 36.620487  longitude -121.904468  accuracy unknown
+  0) place location: name '
+		' id J1HdelRTVrx7R.g2 woeid 2467327
+  2) place locality: name 'Pacific Grove' id J1HdelRTVrx7R.g2 woeid 2467327
+  3) place county: name 'Monterey' id fpIAzjpQUL9F5MEpDw woeid 12587696
+  4) place region: name 'California' id NsbUWfBTUb4mbyVu woeid 2347563
+  5) place country: name 'United States' id nz.gsghTUb4c2WAecA woeid 23424977
 
@@ -380,17 +383,18 @@ int i; flickcurl_init(); /* optional static initialising of resources */ - fc=flickcurl_new(); + fc = flickcurl_new(); /* Set configuration, or more likely read from a config file */ - flickcurl_set_api_key(fc, "..."); - flickcurl_set_shared_secret(fc, "..."); - flickcurl_set_auth_token(fc, "..."); + flickcurl_set_oauth_client_key(fc, "..."); + flickcurl_set_oauth_client_secret(fc, "..."); + flickcurl_set_oauth_token(fc, "..."); + flickcurl_set_oauth_token_secret(fc, "..."); - photo=flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */ + photo = flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */ - for(field_type=0; field_type <= PHOTO_FIELD_LAST; field_type++) { - flickcurl_field_value_type datatype=photo->fields[field_type].type; + for(field_type = 0; field_type <= PHOTO_FIELD_LAST; field_type++) { + flickcurl_field_value_type datatype = photo->fields[field_type].type; if(datatype != VALUE_TYPE_NONE) fprintf(stderr, "field %s (%d) with %s value: '%s' / %d\n", @@ -400,7 +404,7 @@ photo->fields[field_type].integer); } - for(i=0; i < photo->tags_count; i++) { + for(i = 0; i < photo->tags_count; i++) { flickcurl_tag* tag=photo->tags[i]; fprintf(stderr, "%d) %s tag: id %s author ID %s name %s raw '%s' cooked '%s' count %d\n", @@ -427,7 +431,7 @@
-

Copyright (C) 2007-2011 Dave Beckett

+

Copyright (C) 2007-2013 Dave Beckett

diff -Nru flickcurl-1.22/aclocal.m4 flickcurl-1.24/aclocal.m4 --- flickcurl-1.22/aclocal.m4 2011-12-29 00:03:25.000000000 +0000 +++ flickcurl-1.24/aclocal.m4 2013-04-11 04:49:27.000000000 +0000 @@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file 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. @@ -13,8 +14,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -179,12 +180,15 @@ fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file 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. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -194,7 +198,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.1], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -210,19 +214,82 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# This file 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. + +# serial 1 + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + ]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file 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. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -304,14 +371,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file 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. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -351,6 +418,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -415,7 +483,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -480,10 +548,13 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -566,18 +637,6 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file 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. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -717,12 +776,15 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file 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. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -762,8 +824,8 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -783,7 +845,7 @@ [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -929,12 +991,15 @@ fi ]) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file 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. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -957,13 +1022,14 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file 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. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -971,13 +1037,13 @@ [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) @@ -1053,13 +1119,13 @@ fi AC_MSG_RESULT(yes)]) -# Copyright (C) 2009 Free Software Foundation, Inc. +# Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file 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. -# serial 1 +# serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- @@ -1074,18 +1140,50 @@ no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac +dnl +dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using `$V' instead of `$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file 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. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -1108,13 +1206,13 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file 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. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -1123,13 +1221,13 @@ AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1151,10 +1249,11 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) diff -Nru flickcurl-1.22/autogen.sh flickcurl-1.24/autogen.sh --- flickcurl-1.22/autogen.sh 2011-11-11 20:49:26.000000000 +0000 +++ flickcurl-1.24/autogen.sh 2013-04-08 02:28:37.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # -# autogen.sh - Generates initial makefiles from a pristine CVS tree +# autogen.sh - Generates initial makefiles from a pristine source tree # # USAGE: # autogen.sh [configure options] @@ -12,6 +12,11 @@ # programs that would be run. # e.g. DRYRUN=1 ./autogen.sh # +# NOCONFIGURE +# If set to any value it will generate all files but not invoke the +# generated configure script. +# e.g. NOCONFIGURE=1 ./autogen.sh +# # AUTOMAKE ACLOCAL AUTOCONF AUTOHEADER LIBTOOLIZE GTKDOCIZE # If set (named after program) then this overrides any searching for # the programs on the current PATH. @@ -68,19 +73,22 @@ fi # Some dependencies for autotools: +# automake 1.13 requires autoconf 2.65 +# automake 1.12 requires autoconf 2.62 # automake 1.11 requires autoconf 2.62 (needed for AM_SILENT_RULES) -automake_min_vers=011100 +automake_min_vers=011102 aclocal_min_vers=$automake_min_vers autoconf_min_vers=026200 autoheader_min_vers=$autoconf_min_vers +# libtool 2.2 required for LT_INIT language fix libtoolize_min_vers=020200 gtkdocize_min_vers=010300 swig_min_vers=010324 # Default program arguments automake_args="--gnu --add-missing --force --copy -Wall" -aclocal_args= -autoconf_args= +aclocal_args="-Wall" +autoconf_args="-Wall" libtoolize_args="--force --copy --automake $ltdl_args" gtkdocize_args="--copy" # --enable-gtk-doc does no harm if it's not available @@ -293,12 +301,12 @@ $DRYRUN git submodule update fi - for coin in `find $SRCDIR -name configure.ac -print | grep -v /releases/` do + status=0 dir=`dirname $coin` if test -f "$dir/NO-AUTO-GEN"; then - echo $program: Skipping $dir -- flagged as no auto-gen + echo "$program: Skipping $dir -- flagged as no auto-generation" else echo " " echo $program: Processing directory $dir @@ -339,29 +347,62 @@ echo "$program: Running $libtoolize $libtoolize_args" $DRYRUN rm -f ltmain.sh libtool eval $DRYRUN $libtoolize $libtoolize_args + status=$? + if test $status != 0; then + break + fi if grep "^GTK_DOC_CHECK" configure.ac >/dev/null; then # gtkdocize junk $DRYRUN rm -rf gtk-doc.make echo "$program: Running $gtkdocize $gtkdocize_args" $DRYRUN $gtkdocize $gtkdocize_args + status=$? + if test $status != 0; then + break + fi + fi + + if test ! -f NEWS; then + echo "$program: Creating empty NEWS file to allow configure to work" + $DRYRUN touch -t 200001010000 NEWS fi echo "$program: Running $aclocal $aclocal_args" $DRYRUN $aclocal $aclocal_args - if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then + if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then echo "$program: Running $autoheader" $DRYRUN $autoheader + status=$? + if test $status != 0; then + break + fi fi echo "$program: Running $automake $automake_args" - $DRYRUN $automake $automake_args $automake_args - echo "$program: Running $autoconf" + $DRYRUN $automake $automake_args + status=$? + if test $status != 0; then + break + fi + + echo "$program: Running $autoconf $autoconf_args" $DRYRUN $autoconf $autoconf_args + status=$? + if test $status != 0; then + break + fi ) fi + + if test $status != 0; then + echo "$program: FAILED to configure $dir" + exit $status + fi + done + rm -f config.cache AUTOMAKE=$automake @@ -369,17 +410,21 @@ ACLOCAL=$aclocal export AUTOMAKE AUTOCONF ACLOCAL -echo " " -if test -z "$*"; then - echo "$program: WARNING: Running \`configure' with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo "\`$program' command line." -fi +if test "X$NOCONFIGURE" = X; then + echo " " + if test -z "$*"; then + echo "$program: WARNING: Running \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo "\`$program' command line." + fi -echo "$program: Running ./configure $configure_args $@" -if test "X$DRYRUN" = X; then - $DRYRUN ./configure $configure_args "$@" \ - && echo "$program: Now type \`make' to compile this package" || exit 1 -else - $DRYRUN ./configure $configure_args "$@" + echo "$program: Running ./configure $configure_args $@" + if test "X$DRYRUN" = X; then + $DRYRUN ./configure $configure_args "$@" \ + && echo "$program: Now type \`make' to compile this package" || exit 1 + else + $DRYRUN ./configure $configure_args "$@" + fi fi + +exit $status diff -Nru flickcurl-1.22/build/ar-lib flickcurl-1.24/build/ar-lib --- flickcurl-1.22/build/ar-lib 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/build/ar-lib 2012-08-31 20:56:34.000000000 +0000 @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # 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 <. # # This program is free software; you can redistribute it and/or modify @@ -29,21 +29,219 @@ # 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_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + 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 + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# 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) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -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 + 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 +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'. +right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF @@ -53,11 +251,13 @@ echo "compile $scriptversion" exit $? ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; esac ofile= cfile= -eat= for arg do @@ -66,8 +266,8 @@ 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. + # 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) @@ -94,10 +294,10 @@ done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a + # 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 + # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi @@ -106,7 +306,7 @@ 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 +# 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 diff -Nru flickcurl-1.22/build/config.guess flickcurl-1.24/build/config.guess --- flickcurl-1.22/build/config.guess 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/build/config.guess 2012-08-31 20:56:34.000000000 +0000 @@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-05-11' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# 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 @@ -57,8 +55,8 @@ Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +143,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -792,13 +790,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -807,6 +804,9 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +861,13 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +902,16 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -943,7 +953,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -978,13 +988,13 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1315,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -Nru flickcurl-1.22/build/config.sub flickcurl-1.24/build/config.sub --- flickcurl-1.22/build/config.sub 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/build/config.sub 2012-08-31 20:56:34.000000000 +0000 @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-03-23' +timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# 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 @@ -76,8 +74,8 @@ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -223,6 +225,12 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -247,17 +255,22 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +304,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -300,7 +313,7 @@ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -315,8 +328,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -329,7 +341,10 @@ strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -352,11 +367,13 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -365,8 +382,10 @@ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +419,7 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -408,10 +427,11 @@ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -711,7 +731,6 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -808,10 +827,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1120,13 +1147,8 @@ basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1336,7 +1358,7 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1521,6 +1543,9 @@ c4x-* | tic4x-*) os=-coff ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;; @@ -1548,9 +1573,6 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout diff -Nru flickcurl-1.22/build/depcomp flickcurl-1.24/build/depcomp --- flickcurl-1.22/build/depcomp 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/build/depcomp 2012-08-31 20:56:35.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-03-27.16; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011, 2012 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 @@ -28,7 +28,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,11 +40,11 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + 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 outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -57,6 +57,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + 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 @@ -90,10 +96,24 @@ # 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" + 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 + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -148,20 +168,21 @@ ## 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. +## 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 + tr ' ' "$nl" < "$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. +## 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 '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -193,18 +214,15 @@ # 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 + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -216,10 +234,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # 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 + ;; + 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 + # 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|/[^/]*$|/|'` @@ -249,12 +274,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # 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:'. + # '$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" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -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 @@ -265,23 +289,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -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: + # 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 \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -290,15 +317,21 @@ 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 \'. + # 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" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -334,7 +367,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -349,9 +382,9 @@ 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'. + # 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. + # 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= @@ -397,14 +430,59 @@ 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" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -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/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + 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. @@ -422,7 +500,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -442,15 +520,14 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # 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. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$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" @@ -503,9 +580,10 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + # 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 ' ' "$nl" | \ ## 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" @@ -525,7 +603,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -594,8 +672,8 @@ 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::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru flickcurl-1.22/build/install-sh flickcurl-1.24/build/install-sh --- flickcurl-1.22/build/install-sh 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/build/install-sh 2012-08-31 20:56:34.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru flickcurl-1.22/build/libtool.m4 flickcurl-1.24/build/libtool.m4 --- flickcurl-1.22/build/libtool.m4 2011-12-29 00:03:21.000000000 +0000 +++ flickcurl-1.24/build/libtool.m4 2012-08-31 20:56:30.000000000 +0000 @@ -2512,17 +2512,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2639,7 +2628,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -3255,10 +3244,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3297,7 +3282,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -4049,7 +4034,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4348,7 +4333,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -6241,9 +6226,6 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6405,7 +6387,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler diff -Nru flickcurl-1.22/build/ltmain.sh flickcurl-1.24/build/ltmain.sh --- flickcurl-1.22/build/ltmain.sh 2011-12-29 00:03:21.000000000 +0000 +++ flickcurl-1.24/build/ltmain.sh 2012-08-31 20:56:30.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1" +VERSION="2.4.2 Debian-2.4.2-1.1" TIMESTAMP="" package_revision=1.3337 diff -Nru flickcurl-1.22/build/missing flickcurl-1.24/build/missing --- flickcurl-1.22/build/missing 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/build/missing 2012-08-31 20:56:34.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 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 @@ -84,7 +84,6 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff -Nru flickcurl-1.22/configure flickcurl-1.24/configure --- flickcurl-1.22/configure 2011-12-29 00:03:28.000000000 +0000 +++ flickcurl-1.24/configure 2013-04-11 04:49:29.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for Flickcurl 1.22. +# Generated by GNU Autoconf 2.69 for Flickcurl 1.24. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -222,21 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -339,6 +367,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -460,6 +496,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -494,16 +534,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -515,28 +555,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -570,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='Flickcurl' PACKAGE_TARNAME='flickcurl' -PACKAGE_VERSION='1.22' -PACKAGE_STRING='Flickcurl 1.22' +PACKAGE_VERSION='1.24' +PACKAGE_STRING='Flickcurl 1.24' PACKAGE_BUGREPORT='http://bugs.librdf.org/' PACKAGE_URL='' @@ -635,11 +655,11 @@ PKG_CONFIG_PATH AM_BACKSLASH AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V ECHO PKG_CONFIG_REQUIRES STANDARD_CFLAGS -FLICKCURL_OAUTH_FALSE -FLICKCURL_OAUTH_TRUE OFFLINE_FALSE OFFLINE_TRUE RAPTOR_CFLAGS @@ -647,9 +667,12 @@ RAPTOR_FALSE RAPTOR_TRUE RAPTOR_MIN_VERSION +CURL_CONFIG LIBCURL_MIN_VERSION +XML_CONFIG LIBXML_MIN_VERSION PKG_CONFIG +RECHO GETOPT_FALSE GETOPT_TRUE LIBOBJS @@ -661,8 +684,6 @@ DSYMUTIL MANIFEST_TOOL RANLIB -ac_ct_AR -AR DLLTOOL OBJDUMP LN_S @@ -674,18 +695,11 @@ EGREP GREP SED -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -699,6 +713,16 @@ LDFLAGS CFLAGS CC +ac_ct_AR +AR +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build LIBFLICKCURL_LIBTOOL_VERSION FLICKCURL_VERSION_DECIMAL MAINT @@ -782,7 +806,6 @@ with_raptor enable_offline enable_capture -enable_oauth enable_silent_rules with_html_dir enable_gtk_doc @@ -1258,8 +1281,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1345,7 +1366,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Flickcurl 1.22 to adapt to many kinds of systems. +\`configure' configures Flickcurl 1.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1436,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Flickcurl 1.22:";; + short | recursive ) echo "Configuration of Flickcurl 1.24:";; esac cat <<\_ACEOF @@ -1434,7 +1455,6 @@ --disable-libtool-lock avoid locking (might break parallel builds) --enable-offline Turn on offline use of captured XML web service responses (default disabled). --enable-capture Turn on capturing web service responses (default disabled). - --enable-oauth Compile experimental OAuth code (default disabled). --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --enable-gtk-doc use gtk-doc to build documentation [[default=no]] @@ -1539,10 +1559,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Flickcurl configure 1.22 -generated by GNU Autoconf 2.68 +Flickcurl configure 1.24 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1618,7 +1638,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1976,7 +1996,8 @@ main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1992,7 +2013,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2018,7 +2040,8 @@ main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2034,7 +2057,8 @@ main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2068,7 +2092,8 @@ main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2140,8 +2165,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Flickcurl $as_me 1.22, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by Flickcurl $as_me 1.24, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2560,7 +2585,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2729,7 +2754,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2769,7 +2794,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2820,7 +2845,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2873,7 +2898,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2959,7 +2984,7 @@ # Define the identity of the package. PACKAGE='flickcurl' - VERSION='1.22' + VERSION='1.24' cat >>confdefs.h <<_ACEOF @@ -2989,11 +3014,11 @@ # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -3086,6 +3111,130 @@ +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + # Checks for programs. DEPDIR="${am__leading_dot}deps" @@ -3139,6 +3288,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3171,7 +3321,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3211,7 +3361,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3264,7 +3414,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3305,7 +3455,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3363,7 +3513,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3407,7 +3557,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3853,8 +4003,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3952,6 +4101,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4011,7 +4161,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -4066,6 +4216,167 @@ fi + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } @@ -4173,126 +4484,51 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - - - - - - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + fi +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' @@ -4384,7 +4620,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -4460,7 +4696,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4526,7 +4762,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4593,7 +4829,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -4849,7 +5085,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4893,7 +5129,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5317,7 +5553,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5357,7 +5593,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5483,10 +5719,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -5525,7 +5757,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -5663,7 +5895,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5703,7 +5935,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5787,7 +6019,6 @@ - if test -n "$ac_tool_prefix"; then for ac_prog in ar do @@ -5807,7 +6038,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5851,7 +6082,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5976,7 +6207,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6016,7 +6247,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6075,7 +6306,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6115,7 +6346,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6764,7 +6995,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6804,7 +7035,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6884,7 +7115,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6924,7 +7155,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6976,7 +7207,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7016,7 +7247,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7068,7 +7299,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7108,7 +7339,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7160,7 +7391,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7200,7 +7431,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7252,7 +7483,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7292,7 +7523,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8452,7 +8683,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -10622,17 +10853,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -10749,7 +10969,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -11976,11 +12196,11 @@ int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -11997,8 +12217,9 @@ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -12014,10 +12235,10 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -12691,6 +12912,7 @@ main () { int x=optind; + ; return 0; } @@ -12712,10 +12934,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking vsnprintf has C99 compatible return value" >&5 $as_echo_n "checking vsnprintf has C99 compatible return value... " >&6; } if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12752,6 +12971,64 @@ fi +for ac_prog in echo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RECHO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RECHO"; then + ac_cv_prog_RECHO="$RECHO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RECHO="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RECHO=$ac_cv_prog_RECHO +if test -n "$RECHO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RECHO" >&5 +$as_echo "$RECHO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$RECHO" && break +done + +RECHO_C= +RECHO_N= +case `$RECHO -n x` in + -n*) + case `$RECHO 'xy\c'` in + *c*) + ;; + xy) + RECHO_C='\c' + ;; + esac;; + *) + RECHO_N='-n' + ;; +esac + for ac_prog in pkg-config do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -12770,7 +13047,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12794,9 +13071,6 @@ test -n "$PKG_CONFIG" && break done -if test "X$PKG_CONFIG" = X; then - as_fn_error $? "Please install pkg-config from http://pkg-config.freedesktop.org/" "$LINENO" 5 -fi PKG_CONFIG_REQUIRES= @@ -12813,38 +13087,124 @@ fi -if test "X$xml2_config" != "X" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring --with-xml2-config parameter: using pkg-config now" >&5 -$as_echo "$as_me: WARNING: Ignoring --with-xml2-config parameter: using pkg-config now" >&2;} +if test "X$xml2_config" != "Xno" ; then + if test "X$xml2_config" != "X" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $xml2_config" >&5 +$as_echo_n "checking for $xml2_config... " >&6; } + + if test -f $xml2_config ; then + XML_CONFIG=$xml2_config + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - searching PATH" >&5 +$as_echo "no - searching PATH" >&6; } + fi + fi + + if test "X$XML_CONFIG" = "X" ; then + for ac_prog in xml2-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_XML_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$XML_CONFIG"; then + ac_cv_prog_XML_CONFIG="$XML_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_XML_CONFIG="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +XML_CONFIG=$ac_cv_prog_XML_CONFIG +if test -n "$XML_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_CONFIG" >&5 +$as_echo "$XML_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$XML_CONFIG" && break +done + + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml" >&5 -$as_echo_n "checking for libxml... " >&6; } -if $PKG_CONFIG libxml-2.0 --exists; then - : +libxml_source=no +if test "X$XML_CONFIG" != "X"; then + oCPPFLAGS="$CPPFLAGS" + oLIBS="$LIBS" + + CPPFLAGS="`$XML_CONFIG --cflags` $CPPFLAGS" + LIBS="$LIBS `$XML_CONFIG --libs`" + ac_fn_c_check_func "$LINENO" "xmlCreatePushParserCtxt" "ac_cv_func_xmlCreatePushParserCtxt" +if test "x$ac_cv_func_xmlCreatePushParserCtxt" = xyes; then : + have_xmlCreatePushParserCtxt=yes +else + have_xmlCreatePushParserCtxt=no +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml via xml2-config" >&5 +$as_echo_n "checking for libxml via xml2-config... " >&6; } + if test $have_xmlCreatePushParserCtxt = yes; then + libxml_source="xml2-config" + LIBXML_VERSION=`$XML_CONFIG --version` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml via pkg-config" >&5 +$as_echo_n "checking for libxml via pkg-config... " >&6; } + XML_CONFIG="$PKG_CONFIG libxml-2.0" + if $XML_CONFIG --exists; then + LIBXML_VERSION=`$XML_CONFIG --modversion 2>/dev/null` + libxml_source="pkg-config" + fi +fi + +if test "$libxml_source" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - $LIBXML_VERSION via $libxml_source" >&5 +$as_echo "yes - $LIBXML_VERSION via $libxml_source" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - not found" >&5 $as_echo "no - not found" >&6; } - as_fn_error $? "Please install version $LIBXML_MIN_VERSION or newer" "$LINENO" 5 + as_fn_error $? "Please install version $libxml_min_version or newer" "$LINENO" 5 fi -LIBXML_VERSION=`$PKG_CONFIG libxml-2.0 --modversion 2>/dev/null` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - $LIBXML_VERSION" >&5 -$as_echo "yes - $LIBXML_VERSION" >&6; } -if $PKG_CONFIG libxml-2.0 --atleast-version=$LIBXML_MIN_VERSION; then - : -else +libxml_min_version_dec=`echo $libxml_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +libxml_version_dec=`echo $LIBXML_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +if test $libxml_version_dec -lt $libxml_min_version_dec; then as_fn_error $? "libxml $LIBXML_VERSION is too old - $libxml_min_version or newer required." "$LINENO" 5 fi -LIBS="$LIBS `$PKG_CONFIG libxml-2.0 --libs`" -CFLAGS="`$PKG_CONFIG libxml-2.0 --cflags` $CFLAGS" +LIBS="$LIBS `$XML_CONFIG --libs`" +CFLAGS="`$XML_CONFIG --cflags` $CFLAGS" -if test "X$PKG_CONFIG_REQUIRES" != X; then - PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," +if test $libxml_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libxml-2.0 >= $LIBXML_MIN_VERSION" fi -PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libxml-2.0 >= $LIBXML_MIN_VERSION" - LIBCURL_MIN_VERSION=$libcurl_min_version @@ -12858,37 +13218,130 @@ fi -if test "X$curl_config" != "X" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring --with-curl-config parameter: using pkg-config now" >&5 -$as_echo "$as_me: WARNING: Ignoring --with-curl-config parameter: using pkg-config now" >&2;} +if test "X$curl_config" != "Xno" ; then + if test "X$curl_config" != "X" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $curl_config" >&5 +$as_echo_n "checking for $curl_config... " >&6; } + + if test -f $curl_config ; then + CURL_CONFIG=$curl_config + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - searching PATH" >&5 +$as_echo "no - searching PATH" >&6; } + fi + fi + + if test "X$CURL_CONFIG" = "X" ; then + for ac_prog in curl-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CURL_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CURL_CONFIG"; then + ac_cv_prog_CURL_CONFIG="$CURL_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CURL_CONFIG="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CURL_CONFIG=$ac_cv_prog_CURL_CONFIG +if test -n "$CURL_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL_CONFIG" >&5 +$as_echo "$CURL_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CURL_CONFIG" && break +done + + fi +fi + +libcurl_source=no +if test "X$CURL_CONFIG" != "X"; then + oCPPFLAGS="$CPPFLAGS" + oLIBS="$LIBS" + + CPPFLAGS="`$CURL_CONFIG --cflags` $CPPFLAGS" + LIBS="$LIBS `$CURL_CONFIG --libs`" + ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" +if test "x$ac_cv_header_curl_curl_h" = xyes; then : + +fi + + + ac_fn_c_check_func "$LINENO" "curl_easy_init" "ac_cv_func_curl_easy_init" +if test "x$ac_cv_func_curl_easy_init" = xyes; then : + have_curl_easy_init=yes +else + have_curl_easy_init=no +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl via curl-config" >&5 +$as_echo_n "checking for libcurl via curl-config... " >&6; } + if test $have_curl_easy_init = yes; then + libcurl_source="curl-config" + LIBCURL_VERSION=`$CURL_CONFIG --version | sed -e 's/^libcurl *//'` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl via pkg-config" >&5 +$as_echo_n "checking for libcurl via pkg-config... " >&6; } + CURL_CONFIG="$PKG_CONFIG libcurl" + if $CURL_CONFIG --exists; then + LIBCURL_VERSION=`$CURL_CONFIG --modversion 2>/dev/null` + libcurl_source="pkg-config" + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl" >&5 -$as_echo_n "checking for libcurl... " >&6; } -if $PKG_CONFIG libcurl --exists; then -: +if test "$libcurl_source" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - $LIBCURL_VERSION via $libcurl_source" >&5 +$as_echo "yes - $LIBCURL_VERSION via $libcurl_source" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - not found" >&5 $as_echo "no - not found" >&6; } - as_fn_error $? "Please install version $LIBCURL_MIN_VERSION or newer" "$LINENO" 5 + as_fn_error $? "Please install version $libcurl_min_version or newer" "$LINENO" 5 fi -LIBCURL_VERSION=`$PKG_CONFIG libcurl --modversion 2>/dev/null` -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - $LIBCURL_VERSION" >&5 -$as_echo "yes - $LIBCURL_VERSION" >&6; } -if $PKG_CONFIG libcurl --atleast-version=$LIBCURLL_MIN_VERSION; then - : -else - as_fn_error $? "curl $LIBCURL_VERSION is too old - $LIBCURL_MIN_VERSION or newer required." "$LINENO" 5 +libcurl_min_version_dec=`echo $libcurl_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +libcurl_version_dec=`echo $LIBCURL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +if test $libcurl_version_dec -lt $libcurl_min_version_dec; then + as_fn_error $? "libcurl $LIBCURL_VERSION is too old - $libcurl_min_version or newer required." "$LINENO" 5 fi -LIBS="$LIBS `$PKG_CONFIG libcurl --libs`" -CFLAGS="`$PKG_CONFIG libcurl --cflags` $CFLAGS" +LIBS="$LIBS `$CURL_CONFIG --libs`" +CFLAGS="`$CURL_CONFIG --cflags` $CFLAGS" -if test "X$PKG_CONFIG_REQUIRES" != X; then - PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," +if test $libcurl_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libcurl >= $LIBCURL_MIN_VERSION" fi -PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libcurl >= $LIBCURL_MIN_VERSION" @@ -13009,32 +13462,6 @@ fi -# Check whether --enable-oauth was given. -if test "${enable_oauth+set}" = set; then : - enableval=$enable_oauth; oauth="yes" -else - oauth="no" -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking experimental OAuth code" >&5 -$as_echo_n "checking experimental OAuth code... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $oauth" >&5 -$as_echo "$oauth" >&6; }; -if test $oauth = yes; then - -$as_echo "#define FLICKCURL_OAUTH 1" >>confdefs.h - -fi - if test $oauth = yes; then - FLICKCURL_OAUTH_TRUE= - FLICKCURL_OAUTH_FALSE='#' -else - FLICKCURL_OAUTH_TRUE='#' - FLICKCURL_OAUTH_FALSE= -fi - - - @@ -13115,6 +13542,33 @@ no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi AM_BACKSLASH='\' @@ -13151,7 +13605,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13194,7 +13648,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13265,7 +13719,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13307,7 +13761,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13351,7 +13805,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13708,10 +14162,6 @@ as_fn_error $? "conditional \"OFFLINE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${FLICKCURL_OAUTH_TRUE}" && test -z "${FLICKCURL_OAUTH_FALSE}"; then - as_fn_error $? "conditional \"FLICKCURL_OAUTH\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14030,16 +14480,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -14099,28 +14549,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -14141,8 +14579,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Flickcurl $as_me 1.22, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by Flickcurl $as_me 1.24, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -14207,11 +14645,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Flickcurl config.status 1.22 -configured by $0, generated by GNU Autoconf 2.68, +Flickcurl config.status 1.24 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -14302,7 +14740,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -15989,13 +16427,13 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Flickcurl build summary: - libxml $LIBXML_VERSION - curl $LIBCURL_VERSION + libxml $LIBXML_VERSION via $libxml_source + curl $LIBCURL_VERSION via $libcurl_source raptor $RAPTOR_VERSION " >&5 $as_echo " Flickcurl build summary: - libxml $LIBXML_VERSION - curl $LIBCURL_VERSION + libxml $LIBXML_VERSION via $libxml_source + curl $LIBCURL_VERSION via $libcurl_source raptor $RAPTOR_VERSION " >&6; } diff -Nru flickcurl-1.22/configure.ac flickcurl-1.24/configure.ac --- flickcurl-1.22/configure.ac 2011-11-12 06:21:04.000000000 +0000 +++ flickcurl-1.24/configure.ac 2013-04-11 04:49:20.000000000 +0000 @@ -1,13 +1,13 @@ # -*- Autoconf -*- # Copyright (C) 2007-2011 David Beckett http://www.dajobe.org/ -AC_PREREQ(2.62) -AC_INIT(Flickcurl, 1.22, http://bugs.librdf.org/, flickcurl) +AC_PREREQ([2.68]) +AC_INIT([Flickcurl], [1.24], [http://bugs.librdf.org/], [flickcurl]) AC_CONFIG_SRCDIR([src/flickcurl.h]) -AM_CONFIG_HEADER([src/config.h]) +AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_AUX_DIR(build) AC_CONFIG_MACRO_DIR(build) -AM_INIT_AUTOMAKE([1.11 check-news std-options -Wall]) +AM_INIT_AUTOMAKE([1.11 check-news std-options -Wobsolete -Wportability -Wsyntax -Wunsupported -Wextra-portability]) AM_MAINTAINER_MODE @@ -72,14 +72,15 @@ AC_SUBST(LIBFLICKCURL_LIBTOOL_VERSION) +AC_CANONICAL_HOST +AM_SANITY_CHECK + # Checks for programs. +AM_PROG_AR AM_PROG_CC_C_O -m4_undefine([AC_PROG_CXX]) -m4_defun([AC_PROG_CXX],[]) -m4_undefine([AC_PROG_F77]) -m4_defun([AC_PROG_F77],[]) -AC_PROG_LIBTOOL +dnl Initialize libtool +LT_INIT # Checks for libraries. @@ -115,16 +116,15 @@ AM_CONDITIONAL(GETOPT, test $ac_cv_func_getopt = no -a $ac_cv_func_getopt_long = no) AC_MSG_CHECKING(whether need to declare optind) -AC_TRY_LINK([#ifdef HAVE_GETOPT_H +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_GETOPT_H #include -#endif], [int x=optind;], - AC_MSG_RESULT(no), - AC_DEFINE(NEED_OPTIND_DECLARATION, 1, [need 'extern int optind' declaration?]) - AC_MSG_RESULT(yes)) +#endif]], [[int x=optind; +]])],[AC_MSG_RESULT(no)],[AC_DEFINE(NEED_OPTIND_DECLARATION, 1, need 'extern int optind' declaration?) + AC_MSG_RESULT(yes)]) if test $ac_cv_func_vsnprintf = yes; then AC_MSG_CHECKING(vsnprintf has C99 compatible return value) - AC_TRY_RUN([#include + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include int is_c99(char *s, ...) { char buffer[32]; va_list args; @@ -138,16 +138,29 @@ int main(int argc, char* argv) { return is_c99("1234567"); -}], AC_MSG_RESULT(no), - AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [vsnprint has C99 compatible return value]) - AC_MSG_RESULT(yes)) +}]])],[AC_MSG_RESULT(no)],[AC_DEFINE(HAVE_C99_VSNPRINTF, 1, vsnprint has C99 compatible return value) + AC_MSG_RESULT(yes)], [ ], [ ]) fi +AC_CHECK_PROGS(RECHO, echo) +RECHO_C= +RECHO_N= +case `$RECHO -n x` in + -n*) + case `$RECHO 'xy\c'` in + *c*) + ;; + xy) + RECHO_C='\c' + ;; + esac;; + *) + RECHO_N='-n' + ;; +esac + AC_CHECK_PROGS(PKG_CONFIG, pkg-config) -if test "X$PKG_CONFIG" = X; then - AC_MSG_ERROR(Please install pkg-config from http://pkg-config.freedesktop.org/) -fi PKG_CONFIG_REQUIRES= @@ -158,34 +171,70 @@ AC_ARG_WITH(xml2-config, [ --with-xml2-config=PATH Location of libxml xml2-config []], xml2_config="$withval", xml2_config="") -if test "X$xml2_config" != "X" ; then - AC_MSG_WARN(Ignoring --with-xml2-config parameter: using pkg-config now) +if test "X$xml2_config" != "Xno" ; then + if test "X$xml2_config" != "X" ; then + AC_MSG_CHECKING(for $xml2_config) + + if test -f $xml2_config ; then + XML_CONFIG=$xml2_config + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no - searching PATH) + fi + fi + + if test "X$XML_CONFIG" = "X" ; then + AC_CHECK_PROGS(XML_CONFIG, xml2-config) + fi fi -AC_MSG_CHECKING(for libxml) -if $PKG_CONFIG libxml-2.0 --exists; then - : +libxml_source=no +if test "X$XML_CONFIG" != "X"; then + oCPPFLAGS="$CPPFLAGS" + oLIBS="$LIBS" + + CPPFLAGS="`$XML_CONFIG --cflags` $CPPFLAGS" + LIBS="$LIBS `$XML_CONFIG --libs`" + AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no) + + AC_MSG_CHECKING(for libxml via xml2-config) + if test $have_xmlCreatePushParserCtxt = yes; then + libxml_source="xml2-config" + LIBXML_VERSION=`$XML_CONFIG --version` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" else - AC_MSG_RESULT(no - not found) - AC_MSG_ERROR(Please install version $LIBXML_MIN_VERSION or newer) + AC_MSG_CHECKING(for libxml via pkg-config) + XML_CONFIG="$PKG_CONFIG libxml-2.0" + if $XML_CONFIG --exists; then + LIBXML_VERSION=`$XML_CONFIG --modversion 2>/dev/null` + libxml_source="pkg-config" + fi fi -LIBXML_VERSION=`$PKG_CONFIG libxml-2.0 --modversion 2>/dev/null` -AC_MSG_RESULT(yes - $LIBXML_VERSION) -if $PKG_CONFIG libxml-2.0 --atleast-version=$LIBXML_MIN_VERSION; then - : +if test "$libxml_source" != "no"; then + AC_MSG_RESULT(yes - $LIBXML_VERSION via $libxml_source) else + AC_MSG_RESULT(no - not found) + AC_MSG_ERROR(Please install version $libxml_min_version or newer) +fi + +libxml_min_version_dec=`echo $libxml_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +libxml_version_dec=`echo $LIBXML_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +if test $libxml_version_dec -lt $libxml_min_version_dec; then AC_MSG_ERROR(libxml $LIBXML_VERSION is too old - $libxml_min_version or newer required.) fi -LIBS="$LIBS `$PKG_CONFIG libxml-2.0 --libs`" -CFLAGS="`$PKG_CONFIG libxml-2.0 --cflags` $CFLAGS" +LIBS="$LIBS `$XML_CONFIG --libs`" +CFLAGS="`$XML_CONFIG --cflags` $CFLAGS" -if test "X$PKG_CONFIG_REQUIRES" != X; then - PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," +if test $libxml_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libxml-2.0 >= $LIBXML_MIN_VERSION" fi -PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libxml-2.0 >= $LIBXML_MIN_VERSION" - dnl curl - required LIBCURL_MIN_VERSION=$libcurl_min_version @@ -193,33 +242,71 @@ AC_ARG_WITH(curl-config, [ --with-curl-config=PATH Location of libcurl curl-config []], curl_config="$withval", curl_config="") -if test "X$curl_config" != "X" ; then - AC_MSG_WARN(Ignoring --with-curl-config parameter: using pkg-config now) +if test "X$curl_config" != "Xno" ; then + if test "X$curl_config" != "X" ; then + AC_MSG_CHECKING(for $curl_config) + + if test -f $curl_config ; then + CURL_CONFIG=$curl_config + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no - searching PATH) + fi + fi + + if test "X$CURL_CONFIG" = "X" ; then + AC_CHECK_PROGS(CURL_CONFIG, curl-config) + fi fi -AC_MSG_CHECKING(for libcurl) -if $PKG_CONFIG libcurl --exists; then -: +libcurl_source=no +if test "X$CURL_CONFIG" != "X"; then + oCPPFLAGS="$CPPFLAGS" + oLIBS="$LIBS" + + CPPFLAGS="`$CURL_CONFIG --cflags` $CPPFLAGS" + LIBS="$LIBS `$CURL_CONFIG --libs`" + AC_CHECK_HEADER(curl/curl.h) + AC_CHECK_FUNC(curl_easy_init, have_curl_easy_init=yes, have_curl_easy_init=no) + + AC_MSG_CHECKING(for libcurl via curl-config) + if test $have_curl_easy_init = yes; then + libcurl_source="curl-config" + LIBCURL_VERSION=`$CURL_CONFIG --version | sed -e 's/^libcurl *//'` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" else - AC_MSG_RESULT(no - not found) - AC_MSG_ERROR(Please install version $LIBCURL_MIN_VERSION or newer) + AC_MSG_CHECKING(for libcurl via pkg-config) + CURL_CONFIG="$PKG_CONFIG libcurl" + if $CURL_CONFIG --exists; then + LIBCURL_VERSION=`$CURL_CONFIG --modversion 2>/dev/null` + libcurl_source="pkg-config" + fi fi -LIBCURL_VERSION=`$PKG_CONFIG libcurl --modversion 2>/dev/null` -AC_MSG_RESULT(yes - $LIBCURL_VERSION) -if $PKG_CONFIG libcurl --atleast-version=$LIBCURLL_MIN_VERSION; then - : +if test "$libcurl_source" != "no"; then + AC_MSG_RESULT(yes - $LIBCURL_VERSION via $libcurl_source) else - AC_MSG_ERROR(curl $LIBCURL_VERSION is too old - $LIBCURL_MIN_VERSION or newer required.) + AC_MSG_RESULT(no - not found) + AC_MSG_ERROR(Please install version $libcurl_min_version or newer) fi -LIBS="$LIBS `$PKG_CONFIG libcurl --libs`" -CFLAGS="`$PKG_CONFIG libcurl --cflags` $CFLAGS" +libcurl_min_version_dec=`echo $libcurl_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +libcurl_version_dec=`echo $LIBCURL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` +if test $libcurl_version_dec -lt $libcurl_min_version_dec; then + AC_MSG_ERROR(libcurl $LIBCURL_VERSION is too old - $libcurl_min_version or newer required.) +fi -if test "X$PKG_CONFIG_REQUIRES" != X; then - PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," +LIBS="$LIBS `$CURL_CONFIG --libs`" +CFLAGS="`$CURL_CONFIG --cflags` $CFLAGS" + +if test $libcurl_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libcurl >= $LIBCURL_MIN_VERSION" fi -PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libcurl >= $LIBCURL_MIN_VERSION" dnl raptor - optional @@ -294,15 +381,6 @@ fi -AC_ARG_ENABLE(oauth, [ --enable-oauth Compile experimental OAuth code (default disabled). ], oauth="yes", oauth="no") -AC_MSG_CHECKING(experimental OAuth code) -AC_MSG_RESULT($oauth); -if test $oauth = yes; then - AC_DEFINE(FLICKCURL_OAUTH, 1, [Experimental OAuth code]) -fi -AM_CONDITIONAL(FLICKCURL_OAUTH, test $oauth = yes) - - dnl compiler checks AC_DEFUN([FLICKCURL_CC_TRY_FLAG], [ @@ -380,7 +458,7 @@ AC_MSG_RESULT([ Flickcurl build summary: - libxml $LIBXML_VERSION - curl $LIBCURL_VERSION + libxml $LIBXML_VERSION via $libxml_source + curl $LIBCURL_VERSION via $libcurl_source raptor $RAPTOR_VERSION ]) diff -Nru flickcurl-1.22/coverage.html flickcurl-1.24/coverage.html --- flickcurl-1.22/coverage.html 2011-03-26 17:43:09.000000000 +0000 +++ flickcurl-1.24/coverage.html 2012-01-01 03:42:35.000000000 +0000 @@ -25,7 +25,7 @@

Current Flickr API coverage by Flickcurl: -100.0% (180/180) +100.0% (182/182)

@@ -55,6 +55,7 @@
  • flickr.auth.getFrob (0.9)
  • flickr.auth.getFullToken (0.5)
  • flickr.auth.getToken (0.9)
  • +
  • flickr.auth.oauth.getAccessToken (1.23)
  • @@ -93,6 +94,7 @@
    • flickr.favorites.add (1.0)
    • +
    • flickr.favorites.getContext (1.22)
    • flickr.favorites.getList (1.0)
    • flickr.favorites.getPublicList (1.0)
    • flickr.favorites.remove (1.0)
    • @@ -408,6 +410,18 @@

      Changes

      +

      1.23: flickr.auth.oauth.getAccessToken (1 new)

      +
      +int flickcurl_auth_oauth_getAccessToken(flickcurl* fc);
      +
      + + +

      1.22: flickr.favorites.getContext (1 new)

      +
      +flickcurl_photos_list** flickcurl_favorites_getContext(flickcurl* fc, const char* photo_id, const char* user_id, int num_prev, int num_next, const char* extras);
      +
      + +

      1.19: flickr.photosets.removePhotos, flickr.photosets.reorderPhotos, flickr.photosets.setPrimaryPhoto, flickr.stats.getCSVFiles (4 new)

       int flickcurl_photosets_removePhotos(flickcurl* fc, const char* photoset_id, const char** photo_ids_array);
      diff -Nru flickcurl-1.22/debian/changelog flickcurl-1.24/debian/changelog
      --- flickcurl-1.22/debian/changelog	2012-02-08 04:46:13.000000000 +0000
      +++ flickcurl-1.24/debian/changelog	2013-04-11 14:34:44.000000000 +0000
      @@ -1,3 +1,15 @@
      +flickcurl (1.24-SprezzOS1) unstable; urgency=low
      +
      +  * New upstream
      +
      + -- Nick Black   Thu, 11 Apr 2013 10:34:23 -0400
      +
      +flickcurl (1.23-SprezzOS1) unstable; urgency=low
      +
      +  * New upstream 1.23
      +
      + -- Nick Black   Wed, 26 Dec 2012 21:56:26 -0500
      +
       flickcurl (1.22-1) unstable; urgency=low
       
         * New upstream release (Closes: #635892, #637196)
      diff -Nru flickcurl-1.22/debian/control flickcurl-1.24/debian/control
      --- flickcurl-1.22/debian/control	2012-02-08 04:45:42.000000000 +0000
      +++ flickcurl-1.24/debian/control	2013-04-11 14:34:44.000000000 +0000
      @@ -1,10 +1,10 @@
       Source: flickcurl
       Priority: optional
       Section: libs
      -Maintainer: Kumar Appaiah 
      -Uploaders: Dave Beckett 
      +Maintainer: Nick Black 
      +XSBC-Original-Maintainer: Kumar Appaiah 
       Build-Depends: debhelper (>= 6), autotools-dev, libraptor1-dev
      -Standards-Version: 3.9.2
      +Standards-Version: 3.9.4
       Homepage: http://librdf.org/flickcurl/
       Vcs-Git: git://git.debian.org/git/collab-maint/flickcurl.git
       Vcs-Browser: http://git.debian.org/?p=collab-maint/flickcurl.git
      diff -Nru flickcurl-1.22/docs/Makefile.am flickcurl-1.24/docs/Makefile.am
      --- flickcurl-1.22/docs/Makefile.am	2011-10-15 19:42:57.000000000 +0000
      +++ flickcurl-1.24/docs/Makefile.am	2012-09-01 21:07:45.000000000 +0000
      @@ -54,6 +54,7 @@
       
       # Non-autogenerated (XML, other) files to be included in $(DOC_MAIN_SGML_FILE)
       content_files = \
      +	flickcurl-oauth.xml \
       	flickcurl-authenticate.xml \
       	flickcurl-searching.xml \
       	flickcurl-extras.xml \
      diff -Nru flickcurl-1.22/docs/Makefile.in flickcurl-1.24/docs/Makefile.in
      --- flickcurl-1.22/docs/Makefile.in	2011-12-29 00:03:27.000000000 +0000
      +++ flickcurl-1.24/docs/Makefile.in	2013-04-11 04:49:28.000000000 +0000
      @@ -1,9 +1,9 @@
      -# Makefile.in generated by automake 1.11.1 from Makefile.am.
      +# Makefile.in generated by automake 1.11.6 from Makefile.am.
       # @configure_input@
       
       # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
      -# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
      -# Inc.
      +# 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.
      @@ -38,6 +38,23 @@
       # Everything below here is generic #
       ####################################
       VPATH = @srcdir@
      +am__make_dryrun = \
      +  { \
      +    am__dry=no; \
      +    case $$MAKEFLAGS in \
      +      *\\[\ \	]*) \
      +        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
      +          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
      +      *) \
      +        for am__flg in $$MAKEFLAGS; do \
      +          case $$am__flg in \
      +            *=*|--*) ;; \
      +            *n*) am__dry=yes; break;; \
      +          esac; \
      +        done;; \
      +    esac; \
      +    test $$am__dry = yes; \
      +  }
       pkgdatadir = $(datadir)/@PACKAGE@
       pkgincludedir = $(includedir)/@PACKAGE@
       pkglibdir = $(libdir)/@PACKAGE@
      @@ -72,14 +89,19 @@
       CONFIG_HEADER = $(top_builddir)/src/config.h
       CONFIG_CLEAN_FILES = version.xml
       CONFIG_CLEAN_VPATH_FILES =
      -AM_V_GEN = $(am__v_GEN_$(V))
      -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
      +AM_V_GEN = $(am__v_GEN_@AM_V@)
      +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
       am__v_GEN_0 = @echo "  GEN   " $@;
      -AM_V_at = $(am__v_at_$(V))
      -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
      +AM_V_at = $(am__v_at_@AM_V@)
      +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
       am__v_at_0 = @
       SOURCES =
       DIST_SOURCES =
      +am__can_run_installinfo = \
      +  case $$AM_UPDATE_INFO_DIR in \
      +    n|no|NO) false;; \
      +    *) (install-info --version) >/dev/null 2>&1;; \
      +  esac
       am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
       am__vpath_adj = case $$p in \
           $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
      @@ -101,6 +123,12 @@
       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; }; \
      +  }
       man1dir = $(mandir)/man1
       am__installdirs = "$(DESTDIR)$(man1dir)"
       NROFF = nroff
      @@ -119,6 +147,7 @@
       CFLAGS = @CFLAGS@
       CPP = @CPP@
       CPPFLAGS = @CPPFLAGS@
      +CURL_CONFIG = @CURL_CONFIG@
       CYGPATH_W = @CYGPATH_W@
       DEFS = @DEFS@
       DEPDIR = @DEPDIR@
      @@ -182,12 +211,14 @@
       RAPTOR_CFLAGS = @RAPTOR_CFLAGS@
       RAPTOR_LIBS = @RAPTOR_LIBS@
       RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@
      +RECHO = @RECHO@
       SED = @SED@
       SET_MAKE = @SET_MAKE@
       SHELL = @SHELL@
       STANDARD_CFLAGS = @STANDARD_CFLAGS@
       STRIP = @STRIP@
       VERSION = @VERSION@
      +XML_CONFIG = @XML_CONFIG@
       abs_builddir = @abs_builddir@
       abs_srcdir = @abs_srcdir@
       abs_top_builddir = @abs_top_builddir@
      @@ -278,6 +309,7 @@
       
       # Non-autogenerated (XML, other) files to be included in $(DOC_MAIN_SGML_FILE)
       content_files = \
      +	flickcurl-oauth.xml \
       	flickcurl-authenticate.xml \
       	flickcurl-searching.xml \
       	flickcurl-extras.xml \
      @@ -367,6 +399,7 @@
       	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
       	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
       	esac;
      +$(top_srcdir)/gtk-doc.make:
       
       $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
       	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
      @@ -386,11 +419,18 @@
       	-rm -rf .libs _libs
       install-man1: $(man_MANS)
       	@$(NORMAL_INSTALL)
      -	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
      -	@list=''; test -n "$(man1dir)" || exit 0; \
      -	{ for i in $$list; do echo "$$i"; done; \
      -	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
      -	  sed -n '/\.1[a-z]*$$/p'; \
      +	@list1=''; \
      +	list2='$(man_MANS)'; \
      +	test -n "$(man1dir)" \
      +	  && test -n "`echo $$list1$$list2`" \
      +	  || exit 0; \
      +	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
      +	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
      +	{ for i in $$list1; do echo "$$i"; done;  \
      +	if test -n "$$list2"; then \
      +	  for i in $$list2; do echo "$$i"; done \
      +	    | sed -n '/\.1[a-z]*$$/p'; \
      +	fi; \
       	} | while read p; do \
       	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
       	  echo "$$d$$p"; echo "$$p"; \
      @@ -419,9 +459,7 @@
       	  sed -n '/\.1[a-z]*$$/p'; \
       	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
       	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
      -	test -z "$$files" || { \
      -	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
      -	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
      +	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
       tags: TAGS
       TAGS:
       
      @@ -492,10 +530,15 @@
       
       installcheck: installcheck-am
       install-strip:
      -	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
      -	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
      -	  `test -z '$(STRIP)' || \
      -	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
      +	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:
      diff -Nru flickcurl-1.22/docs/flickcurl-authenticate.xml flickcurl-1.24/docs/flickcurl-authenticate.xml
      --- flickcurl-1.22/docs/flickcurl-authenticate.xml	2011-06-24 00:17:27.000000000 +0000
      +++ flickcurl-1.24/docs/flickcurl-authenticate.xml	2012-09-02 00:28:18.000000000 +0000
      @@ -1,12 +1,31 @@
       
      -
      +
       
      -Authenticating Flickcurl
      +Authenticating Flickcurl for Legacy Flickr Authentication
       
      -
      +
      -Build Flickcurl library and flickcurl utility +Introduction + + +This chapter describes the deprecated +legacy Flickr authentication. This may be removed at any time by +Flickr after August 2012, so this functionality should be migrated +to the +Flickr OAuth authentication + + +
      + +
      + +Build Flickcurl library and <command>flickcurl(1)</command> utility + +This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication + $ ./configure @@ -34,8 +53,9 @@ This is because there is no configuration set for the library. For -the flickcurl utility, it reads the configuration from a file -~/.flickcurl.conf which contains parameters used +the flickcurl(1) utility, it reads the +configuration from a file +~/.flickcurl.conf which contains parameters used for authentication. This section describes how those parameters are obtained. @@ -43,10 +63,15 @@
      -
      +
      Register application to get API Key and Shared Secret +This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication + + NOTE: In the pictures below, the Flickr web site is shown in English and the screenshots taken in early December 2009. Flickr upgrade the web site often so these instructions may not match the @@ -116,8 +141,8 @@ These strings should be used for the values of the api -and secret keys in either the ~/.flickcurl.conf -if used with the flickcurl utility or in code, with the +and secret keys in either the ~/.flickcurl.conf +if used with the flickcurl(1) utility or in code, with the flickcurl_set_api_key() and flickcurl_set_shared_secret() @@ -157,11 +182,9 @@ This sequence will make the new key 'Auth mode Mobile' and an authentication URL will be shown on the -same page and look something like this: +same page and look something +like http://www.flickr.com/auth-11111111111111111 - -http://www.flickr.com/auth-11111111111111111 - Finish with the 'Save Changes' button to confirm and return you to the application page. @@ -185,22 +208,28 @@
      -
      +
      Getting Authentication Token from API Key and Secret +This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication + + Create a file ~/.flickcurl.conf with the two values above (API Key, Shared Secret) like this: -[flickr] -api_key=0123456789abcdef0123456789abcdef -secret=fedcba9876543210 + [flickr] + api_key=0123456789abcdef0123456789abcdef + secret=fedcba9876543210 -Then visit the Authentication URL mentioned in the previous section +Then prompt the user to visit the Authentication URL mentioned +in the previous section (http://www.flickr.com/auth-11111111111111111) in a web browser. @@ -229,31 +258,32 @@ -Switch back to the command line and run the flickcurl utility with that FROB: +Switch back to the command line and run +the flickcurl(1) utility with that FROB: -$ flickcurl -a 123-456-789 + $ flickcurl -a 123-456-789 The result will be that an Authentication Token (auth token) is calculated -and returned. The flickcurl utility will reply: +and returned. The flickcurl(1) utility will reply: -flickcurl: Successfully exchanged frob 123-456-789 for authentication token -flickcurl: Updated configuration file /Users/NAME/.flickcurl.conf with authentication token + flickcurl: Successfully exchanged frob 123-456-789 for authentication token + flickcurl: Updated configuration file /Users/NAME/.flickcurl.conf with authentication token -The flickcurl utility has automatically updated the +The flickcurl(1) utility has automatically updated the ~/.flickcurl.conf configuration file (as the message will show) with the auth_token field to give something like: -$ cat ~/.flickcurl.conf -[flickr] -auth_token=1234567-8901234567890123 -api_key=0123456789abcdef0123456789abcdef -secret=fedcba9876543210 + $ cat ~/.flickcurl.conf + [flickr] + auth_token=1234567-8901234567890123 + api_key=0123456789abcdef0123456789abcdef + secret=fedcba9876543210 @@ -263,12 +293,18 @@
      -
      +
      Use flickcurl +This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication + + Now the configuration has been created and authentication -completed, the library and utility will work. +completed, the library and the flickcurl(1) +utility will work. diff -Nru flickcurl-1.22/docs/flickcurl-docs.xml flickcurl-1.24/docs/flickcurl-docs.xml --- flickcurl-1.22/docs/flickcurl-docs.xml 2011-12-29 00:14:38.000000000 +0000 +++ flickcurl-1.24/docs/flickcurl-docs.xml 2013-04-08 01:51:15.000000000 +0000 @@ -43,6 +43,8 @@ 2009 2010 2011 + 2012 + 2013 Dave Beckett @@ -65,6 +67,7 @@ + diff -Nru flickcurl-1.22/docs/flickcurl-oauth.xml flickcurl-1.24/docs/flickcurl-oauth.xml --- flickcurl-1.22/docs/flickcurl-oauth.xml 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/flickcurl-oauth.xml 2013-04-08 01:51:15.000000000 +0000 @@ -0,0 +1,422 @@ + + + +Authenticating Flickcurl for OAuth + +
      + +Introduction + + +This section describes the supported +Flickr authentication - the legacy authentication was deprecated at +the start of August 2012 and should not be used for new applications. + + +
      + +
      + +Build Flickcurl library and <command>flickcurl(1)</command> utility + + + $ ./configure + $ make + + + +Add the utils directory to your shell search path: + + + $ PATH=`pwd`/utils:$PATH +on bourne shells such as Bash or + $ setenv PATH `pwd`/utils:$PATH +on c shells such as tcsh + + + +You should get an error if you now try the utility: + + + $ flickcurl photos.getInfo 1234567 + flickcurl: Configuration file /Users/dajobe/.flickcurl.conf not found. + + ... + + + +This is because there is no configuration set for the library. For +the flickcurl(1) utility, it reads the configuration from a file +~/.flickcurl.conf which contains 4 parameters used +for authentication: Client Key, Client Secret, Access Token and +Access Token Secret. This section describes how those parameters are +obtained. + + +
      + + +
      + +Register application to get Client Key and Client Secret + +NOTE: In the pictures below, the Flickr web site is shown in +English and the screenshots are valid as of August 2012. Flickr +upgrade the web site now and then so these instructions may not match +the latest look. Hopefully you can figure it out! + + + +Start by navigating to the Flickr App Garden at +http://www.flickr.com/services/ +and follow the link 'Create an App' taking you to +http://www.flickr.com/services/apps/create/ + + + + + + +Flickr App Garden - Get your API Key + + + +Select the link 'Request an API Key' taking you to +http://www.flickr.com/services/apps/create/apply/ + + + + + + +Flickr App Garden - Commercial / Non-Commercial + + + +Select either of the two buttons: +'Apply for a Non-Commercial Key' or 'Apply for a Commercial Key' +as appropriate. + + + + + + +Flickr App Garden - Describe application + + + +Fill in the form fields and submit it via the 'Submit' button. + + + + + + +Flickr App Garden - Key and Secret + + +Flickr will return a page containing both the +API Key that looks something like: + + + 0123456789abcdef0123456789abcdef + +and Secret which looks something like: + + fedcba9876543210 + + + +These strings should be used for the values of the Client Key +(oauth_client_key) and Client Secret +(oauth_client_secret) keys in either +the ~/.flickcurl.conf if used with the flickcurl(1) utility +or in code, with the +flickcurl_set_oauth_client_key() +and +flickcurl_set_oauth_client_secret() +functions. + + + +You may need to change the key to be of type mobile since no callback +URL is usually appropriate for a command-line application or library. +This step is probably no longer needed since the callback is +specified in a later step. + + + +Click the 'Edit auth flow for this app' link below the +Key and Secret + + + + + + + +Flickr App Garden - Edit authentication flow + + +Change the 'App Type' to 'Mobile Application' +then set the 'Mobile Permissions' to 'Read', 'Write' Or 'Delete' as +appropriate. + + + + + + +Flickr App Garden - Edit authentication flow: mobile + + + +This sequence will make the new key 'Auth mode Mobile' +and an authentication URL will be shown on the +same page something like +http://www.flickr.com/auth-11111111111111111. +This URL should NOT be used and is only for +the legacy Flickr authentication flow. + + +Finish with the 'Save Changes' button to confirm and return +you to the application page. + + + + + +Flickr App Garden - Application page + + + +If you ever need to alter or view the authentication, use the link +'Edit the authentication flow' on right-hand side of the application page. + + +All your Flickr applications are linked from +http://www.flickr.com/services/apps/by/me + + +
      + + +
      + +Getting Authentication Token from Client Key and Client Secret + + +If using the flickcurl command line tool, create a file +~/.flickcurl.conf with the two values found in +the previous section - API becomes oauth_client_key +and the Shared Secret becomes oauth_client_secret like this: + + + + [flickr] + oauth_client_key=0123456789abcdef0123456789abcdef + oauth_client_secret=fedcba9876543210 + + +Next the Request Token, Request +Token Secret need to be created and the +Authentication URL generated from them. + + +The request token is created using the API request: +flickcurl_oauth_create_request_token() +which takes an optional Callback URL argument, +that can be used for the browser to redirect to, if required. +Otherwise use "oob" or NULL. It creates +and sets the Request Token and Request Token Secret in +the flickcurl object, which can be returned with: +flickcurl_get_oauth_request_token() +and +flickcurl_get_oauth_request_token_secret(). + + + + rc = flickcurl_oauth_create_request_token(fc, callback); + request_token = flickcurl_get_oauth_request_token(fc); + request_token_secret = flickcurl_get_oauth_request_token_secret(fc); + uri = flickcurl_oauth_get_authorize_uri(fc); + + +The flickcurl(1) utility can also perform this +sequence with: + + $ flickcurl oauth-create + +which will print the request token, request token secret and +Authentication URL. This command takes an optional callback URL +argument. + + +The resulting request token and secret will look like +72157626737672178-022bbd2f4c2f3432 and +fccb68c4e6103197 respectively. + + + +The Authentication URL should then be used to prompt the user a web +browser to validate the request. + + +Flickr will return a page that says something like: + + "[APP NAME] wants to link to your Flickr account" + +with more information and two buttons. Click the button +with the text: + + [OK, I'LL AUTHORIZE IT] + + + + + + +Flickr App Garden - Mobile Auth + + + +Flickr will then return the +9-digit Verifier that looks +like 123-456-789 In one of two ways depending if a +callback URL was given: + + + Callback URL: Returns a redirect to + the Callback URL with a query + parameter oauth_verifier whose value is the + Verifier. The application has to extract that value and pass it + to the flickcurl library. + + + No callback URL: Will display a page that shows the + Verifier. This will require the user to + type it into the application. + + + + +Now the Request Token, Request Token Secret and Verifier can be used +to generate the Access Token and +Access Token Secret. + + + + /* These are required to be set for this call */ + flickcurl_set_oauth_request_token(fc, request_token); + flickcurl_set_oauth_request_token_secret(fc, request_token_secret); + + rc = flickcurl_oauth_create_access_token(fc, verifier); + + +This sets the Access Token and Access Token Secret in +the flickcurl object, which can be returned with: +flickcurl_get_oauth_token() +and +flickcurl_get_oauth_token_secret(). +The application should then store these values for use in making API +calls along with the Client Key and Client Secret. + + +The flickcurl(1) utility can also perform this +verification with: + + $ flickcurl oauth-verify 72157626737672178-022bbd2f4c2f3432 fccb68c4e6103197 123-456-789 + flickcurl: OAuth access token returned token '72157626737672178-022bbd2f4c2f3432' secret token 'fccb68c4e6103197' + flickcurl: Updated configuration file /Users/NAME/.flickcurl.conf with authentication token + + +It writes the resulting Access Token and Access Token Secret to +the ~/.flickcurl.conf configuration file as the +oauth_token and oauth_token_secret fields +to give something like: + + + $ cat ~/.flickcurl.conf + [flickr] + oauth_token=12345678901234567-abcdef0123456789 + oauth_token_secret=abcdef9876543210 + oauth_client_key=0123456789abcdef0123456789abcdef + oauth_client_secret=fedcba9876543210 + + + +At this stage, the flickcurl(1) utility or library is +authenticated and ready to use. + + +
      + + +
      + +Use Flickcurl + +Now the configuration has been created and authentication +completed, the library and the flickcurl(1) utility will +work. + + + + $ flickcurl photos.getInfo 1234567 + flickcurl: Found photo with URI http://www.flickr.com/photos/yogi/1234567/ ID 1234567 and 1 tags + ... + + +
      + +
      + +Upgrading from legacy Flickr authentication + + +The flickcurl_auth_oauth_getAccessToken() +function turns an existing legacy-authenticated application and +updates it to use OAuth. After this call, the legacy authentication +tokens will expire within 24hrs (according to Flickr) so should no +longer be used. + + + + rc = flickcurl_auth_oauth_getAccessToken(fc); + + +The OAuth access token and access token secret are then +saved to the flickcurl object and can be read via +flickcurl_get_oauth_token() +and +flickcurl_get_oauth_token_secret() +and saved along with the Client Key (was API) and Client Secret (was +Shared Secret). + + +The flickcurl(1) utility can also perform +this upgrade with: + + $ flickcurl oauth-upgrade + + +It writes the resulting Access Token and Access Token Secret to +the ~/.flickcurl.conf configuration file as the +oauth_token and oauth_token_secret and +rewrites the api_key (API Key) and secret +(Shared Secret fields) as oauth_client_key (Client Key) +and oauth_client_secret (Client Secret) respectively. +. + +
      + +
      + + diff -Nru flickcurl-1.22/docs/flickcurl-sections.txt flickcurl-1.24/docs/flickcurl-sections.txt --- flickcurl-1.22/docs/flickcurl-sections.txt 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/flickcurl-sections.txt 2013-04-11 05:16:55.000000000 +0000 @@ -18,22 +18,15 @@ flickcurl_flickr_replace_service_uri flickcurl_flickr_service_uri flickcurl_flickr_upload_service_uri -flickcurl_flickr_oauth_access_token_uri -flickcurl_flickr_oauth_authorize_uri -flickcurl_flickr_oauth_request_token_uri flickcurl_message_handler flickcurl_init flickcurl_finish flickcurl_new flickcurl_new_with_handle flickcurl_free -flickcurl_get_api_key -flickcurl_get_auth_token flickcurl_get_current_request_wait flickcurl_get_extras_format_info flickcurl_get_feed_format_info -flickcurl_set_api_key -flickcurl_set_auth_token flickcurl_curl_setopt_handler flickcurl_set_curl_setopt_handler flickcurl_set_data @@ -44,7 +37,6 @@ flickcurl_set_service_uri flickcurl_set_replace_service_uri flickcurl_set_upload_service_uri -flickcurl_set_shared_secret flickcurl_set_sign flickcurl_set_tag_handler flickcurl_set_user_agent @@ -70,11 +62,37 @@
      section-auth +flickcurl_get_api_key +flickcurl_set_api_key +flickcurl_get_shared_secret +flickcurl_set_shared_secret +flickcurl_get_auth_token +flickcurl_set_auth_token flickcurl_auth_checkToken flickcurl_auth_getFrob flickcurl_auth_getFullToken flickcurl_auth_getToken flickcurl_auth_oauth_getAccessToken +flickcurl_flickr_oauth_access_token_uri +flickcurl_flickr_oauth_authorize_uri +flickcurl_flickr_oauth_request_token_uri +flickcurl_get_oauth_client_key +flickcurl_set_oauth_client_key +flickcurl_get_oauth_client_secret +flickcurl_set_oauth_client_secret +flickcurl_get_oauth_request_token +flickcurl_set_oauth_request_token +flickcurl_get_oauth_request_token_secret +flickcurl_set_oauth_request_token_secret +flickcurl_get_oauth_token +flickcurl_set_oauth_token +flickcurl_get_oauth_token_secret +flickcurl_set_oauth_token_secret +flickcurl_get_oauth_username +flickcurl_get_oauth_user_nsid +flickcurl_oauth_create_request_token +flickcurl_oauth_get_authorize_uri +flickcurl_oauth_create_access_token
      @@ -288,6 +306,7 @@ flickcurl_photos_getExif flickcurl_photos_getFavorites flickcurl_photos_getInfo +flickcurl_photos_getInfo2 flickcurl_photos_getNotInSet flickcurl_photos_getNotInSet_params flickcurl_photos_getPerms @@ -524,7 +543,6 @@ flickcurl_free_perms flickcurl_get_field_value_type_label flickcurl_get_location_accuracy_label -flickcurl_get_shared_secret flickcurl_interestingness_getList flickcurl_interestingness_getList_params flickcurl_license diff -Nru flickcurl-1.22/docs/flickcurl.1 flickcurl-1.24/docs/flickcurl.1 --- flickcurl-1.22/docs/flickcurl.1 2011-10-29 17:01:04.000000000 +0000 +++ flickcurl-1.24/docs/flickcurl.1 2013-04-07 23:50:03.000000000 +0000 @@ -45,6 +45,13 @@ .B \-V, \-\-verbose Display more information while the program runs. .SH COMMANDS +.LP +In the following list of commands: +.br +\fIPER-PAGE\fR is photos per result page or '-' for default (10) +.br +\fIPAGE\fR is result page number or '-' for default (1 = first page) + .IP "\fBactivity.userComments\fP \fI[PER-PAGE [PAGE]]\fP" Get photos commented on by the caller. .IP "\fBactivity.userPhotos\fP \fI[TIMEFRAME [PER-PAGE [PAGE]]]\fP" @@ -73,13 +80,15 @@ Get a list of contacts with optional FILTER .IP "\fBcontacts.getListRecentlyUploaded\fP \fI[DATE-LAST-UPLOAD [FILTER]]\fP" Get a list of recent uploading contacts since DATE-LAST-UPLOAD with optional FILTER +.IP "\fBcontacts.getPublicList\fP \fIUSER-NSID [PER-PAGE [PAGE]]\fP" +Get the contact list for user USER-ID .IP "\fBfavorites.add\fP \fIPHOTO-ID\fP" Adds PHOTO-ID to the current user's favorites. .IP "\fBfavorites.getContext\fP \fIPHOTO-ID USER-NSID [NUM-PREV [NUM-NEXT [EXTRAS]]]\fP" Get context photos around USER-ID's favorite PHOTO-ID. -.IP "\fBfavorites.getList\fP \fIUSER-NSID [[PER-PAGE] [PAGE [FORMAT]]]\fP" +.IP "\fBfavorites.getList\fP \fIUSER-NSID [PER-PAGE [PAGE [FORMAT]]]\fP" Get a list of USER-NSID's favorite photos. -.IP "\fBfavorites.getPublicList\fP \fIUSER-NSID [[PER-PAGE] [PAGE [FORMAT]]]\fP" +.IP "\fBfavorites.getPublicList\fP \fIUSER-NSID [PER-PAGE [PAGE [FORMAT]]]\fP" Get a list of USER-NSID's favorite public photos. .IP "\fBfavorites.remove\fP \fIPHOTO-ID\fP" Removes PHOTO-ID to the current user's favorites. @@ -113,9 +122,9 @@ Add PHOTO-ID in GROUP-ID pool. .IP "\fBgroups.pools.getContext\fP \fIPHOTO-ID GROUP-ID\fP" Get next and previous photos for PHOTO-ID in GROUP-ID pool. -.IP "\fBgroups.pools.getGroups\fP \fI[PAGE [PER-PAGE]]\fP" +.IP "\fBgroups.pools.getGroups\fP \fI[PER-PAGE [PAGE]]\fP" Get list of groups a user can add to. -.IP "\fBgroups.pools.getPhotos\fP \fIGROUP-ID [PAGE [PER-PAGE [FORMAT]]]\fP" +.IP "\fBgroups.pools.getPhotos\fP \fIGROUP-ID [PER-PAGE [PAGE [FORMAT]]]\fP" Get list of photos in GROUP-ID. .IP "\fBgroups.pools.remove\fP \fIPHOTO-ID GROUP-ID\fP" Remove PHOTO-ID from group GROUP-ID. @@ -143,6 +152,12 @@ Get a list of recent machinetags for NAMESPACE and PREDICATE since ADDED-SINCE .IP "\fBmachinetags.getValues\fP \fINAMESPACE PREDICATE [PER-PAGE [PAGE]]\fP" Get a list of unique values for a NAMESPACE and PREDICATE +.IP "\fBoauth.create\fP \fI[CALLBACK]\fP" +Create OAuth request token/secret pair and show the authentication URL +.IP "\fBoauth.upgrade\fP \fI\fP" +Upgrade legacy authentication to OAuth +.IP "\fBoauth.verify\fP \fIREQUEST-TOKEN REQUEST-TOKEN-SECRET VERIFIER\fP" +Verify an OAuth request from `oauth-create' .IP "\fBpanda.getList\fP \fI\fP" get the current list of pandas .IP "\fBpanda.getPhotos\fP \fIPANDA\fP" @@ -225,8 +240,8 @@ Get EXIF information about one photo with id PHOTO-ID .IP "\fBphotos.getFavorites\fP \fIPHOTO-ID [PER-PAGE [PAGE]]\fP" Get favourites information about one photo with id PHOTO-ID -.IP "\fBphotos.getInfo\fP \fIPHOTO-ID\fP" -Get information about one photo with id PHOTO-ID +.IP "\fBphotos.getInfo\fP \fIPHOTO-ID [SECRET]\fP" +Get information about one photo PHOTO-ID with optional SECRET .IP "\fBphotos.getNotInSet\fP \fI[PER-PAGE [PAGE [FORMAT]]]\fP" Get list of photos that are not in any set .IP "\fBphotos.getPerms\fP \fIPHOTO-ID\fP" diff -Nru flickcurl-1.22/docs/html/flickcurl-auth-authenticate.html flickcurl-1.24/docs/html/flickcurl-auth-authenticate.html --- flickcurl-1.22/docs/html/flickcurl-auth-authenticate.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-auth-authenticate.html 2013-04-11 05:16:55.000000000 +0000 @@ -2,12 +2,12 @@ -Getting Authentication Token from API Key and Secret +Getting Authentication Token from Client Key and Client Secret - - - + + + @@ -21,18 +21,55 @@

      -Getting Authentication Token from API Key and Secret

      +Getting Authentication Token from Client Key and Client Secret

      -Create a file ~/.flickcurl.conf with the two -values above (API Key, Shared Secret) like this: +If using the flickcurl command line tool, create a file +~/.flickcurl.conf with the two values found in +the previous section - API becomes oauth_client_key +and the Shared Secret becomes oauth_client_secret like this:

      -[flickr]
      -api_key=0123456789abcdef0123456789abcdef
      -secret=fedcba9876543210
      -
      -

      Then visit the Authentication URL mentioned in the previous section -(http://www.flickr.com/auth-11111111111111111) in a web browser. + [flickr] + oauth_client_key=0123456789abcdef0123456789abcdef + oauth_client_secret=fedcba9876543210 +

      +

      Next the Request Token, Request +Token Secret need to be created and the +Authentication URL generated from them. +

      +

      The request token is created using the API request: +flickcurl_oauth_create_request_token() +which takes an optional Callback URL argument, +that can be used for the browser to redirect to, if required. +Otherwise use "oob" or NULL. It creates +and sets the Request Token and Request Token Secret in +the flickcurl object, which can be returned with: +flickcurl_get_oauth_request_token() +and +flickcurl_get_oauth_request_token_secret(). +

      +
      +   rc = flickcurl_oauth_create_request_token(fc, callback);
      +   request_token = flickcurl_get_oauth_request_token(fc);
      +   request_token_secret = flickcurl_get_oauth_request_token_secret(fc);
      +   uri = flickcurl_oauth_get_authorize_uri(fc);
      +
      +

      The flickcurl(1) utility can also perform this +sequence with:

      +
      +  $ flickcurl oauth-create
      +
      +

      which will print the request token, request token secret and +Authentication URL. This command takes an optional callback URL +argument. +

      +

      The resulting request token and secret will look like +72157626737672178-022bbd2f4c2f3432 and +fccb68c4e6103197 respectively. +

      +

      +The Authentication URL should then be used to prompt the user a web +browser to validate the request.

      Flickr will return a page that says something like:

      @@ -46,37 +83,64 @@
       

      Flickr App Garden - Mobile Auth

      -

      Flickr will return on the next page a -9-digit FROB that looks like this:

      -
      -  123-456-789
      -
      +

      Flickr will then return the +9-digit Verifier that looks +like 123-456-789 In one of two ways depending if a +callback URL was given:

      +
        +
      1. Callback URL: Returns a redirect to + the Callback URL with a query + parameter oauth_verifier whose value is the + Verifier. The application has to extract that value and pass it + to the flickcurl library. +

      2. +
      3. No callback URL: Will display a page that shows the + Verifier. This will require the user to + type it into the application. +

      4. +

      -Switch back to the command line and run the flickcurl utility with that FROB: +Now the Request Token, Request Token Secret and Verifier can be used +to generate the Access Token and +Access Token Secret.

      -$ flickcurl -a 123-456-789
      -
      -

      The result will be that an -Authentication Token (auth token) is calculated -and returned. The flickcurl utility will reply:

      -
      -flickcurl: Successfully exchanged frob 123-456-789 for authentication token
      -flickcurl: Updated configuration file /Users/NAME/.flickcurl.conf with authentication token
      -
      -

      The flickcurl utility has automatically updated the -~/.flickcurl.conf configuration file (as the message -will show) with the auth_token field to give something -like:

      + /* These are required to be set for this call */ + flickcurl_set_oauth_request_token(fc, request_token); + flickcurl_set_oauth_request_token_secret(fc, request_token_secret); + + rc = flickcurl_oauth_create_access_token(fc, verifier); +
      +

      This sets the Access Token and Access Token Secret in +the flickcurl object, which can be returned with: +flickcurl_get_oauth_token() +and +flickcurl_get_oauth_token_secret(). +The application should then store these values for use in making API +calls along with the Client Key and Client Secret. +

      +

      The flickcurl(1) utility can also perform this +verification with:

      -$ cat ~/.flickcurl.conf
      -[flickr]
      -auth_token=1234567-8901234567890123
      -api_key=0123456789abcdef0123456789abcdef
      -secret=fedcba9876543210
      +  $ flickcurl oauth-verify 72157626737672178-022bbd2f4c2f3432 fccb68c4e6103197 123-456-789
      +  flickcurl: OAuth access token returned token '72157626737672178-022bbd2f4c2f3432' secret token 'fccb68c4e6103197'
      +  flickcurl: Updated configuration file /Users/NAME/.flickcurl.conf with authentication token
      +
      +

      It writes the resulting Access Token and Access Token Secret to +the ~/.flickcurl.conf configuration file as the +oauth_token and oauth_token_secret fields +to give something like:

      +
      +  $ cat ~/.flickcurl.conf
      +  [flickr]
      +  oauth_token=12345678901234567-abcdef0123456789
      +  oauth_token_secret=abcdef9876543210
      +  oauth_client_key=0123456789abcdef0123456789abcdef
      +  oauth_client_secret=fedcba9876543210
       

      -At this stage, the utility (or library) is authenticated and ready to use. +At this stage, the flickcurl(1) utility or library is +authenticated and ready to use.

      NOTE: In the pictures below, the Flickr web site is shown in -English and the screenshots taken in early December 2009. Flickr -upgrade the web site often so these instructions may not match the -latest look. Hopefully you can figure it out!

      +English and the screenshots are valid as of August 2012. Flickr +upgrade the web site now and then so these instructions may not match +the latest look. Hopefully you can figure it out!

      Start by navigating to the Flickr App Garden at http://www.flickr.com/services/ @@ -67,17 +67,21 @@ fedcba9876543210

      -These strings should be used for the values of the api -and secret keys in either the ~/.flickcurl.conf -if used with the flickcurl utility or in code, with the -flickcurl_set_api_key() +These strings should be used for the values of the Client Key +(oauth_client_key) and Client Secret +(oauth_client_secret) keys in either +the ~/.flickcurl.conf if used with the flickcurl(1) utility +or in code, with the +flickcurl_set_oauth_client_key() and -flickcurl_set_shared_secret() +flickcurl_set_oauth_client_secret() functions.

      -You now need to change the key to be of type mobile since no callback +You may need to change the key to be of type mobile since no callback URL is usually appropriate for a command-line application or library. +This step is probably no longer needed since the callback is +specified in a later step.

      Click the 'Edit auth flow for this app' link below the @@ -96,11 +100,11 @@

      This sequence will make the new key 'Auth mode Mobile' and an authentication URL will be shown on the -same page and look something like this: +same page something like +http://www.flickr.com/auth-11111111111111111. +This URL should NOT be used and is only for +the legacy Flickr authentication flow.

      -
      -http://www.flickr.com/auth-11111111111111111
      -

      Finish with the 'Save Changes' button to confirm and return you to the application page.

      diff -Nru flickcurl-1.22/docs/html/flickcurl-auth-upgrade.html flickcurl-1.24/docs/html/flickcurl-auth-upgrade.html --- flickcurl-1.22/docs/html/flickcurl-auth-upgrade.html 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-auth-upgrade.html 2013-04-11 05:16:55.000000000 +0000 @@ -0,0 +1,60 @@ + + + + +Upgrading from legacy Flickr authentication + + + + + + + + + + + + + + + + +
      +

      +Upgrading from legacy Flickr authentication

      +

      +The flickcurl_auth_oauth_getAccessToken() +function turns an existing legacy-authenticated application and +updates it to use OAuth. After this call, the legacy authentication +tokens will expire within 24hrs (according to Flickr) so should no +longer be used. +

      +
      +  rc = flickcurl_auth_oauth_getAccessToken(fc);
      +
      +

      The OAuth access token and access token secret are then +saved to the flickcurl object and can be read via +flickcurl_get_oauth_token() +and +flickcurl_get_oauth_token_secret() +and saved along with the Client Key (was API) and Client Secret (was +Shared Secret). +

      +

      The flickcurl(1) utility can also perform +this upgrade with:

      +
      +  $ flickcurl oauth-upgrade
      +
      +

      It writes the resulting Access Token and Access Token Secret to +the ~/.flickcurl.conf configuration file as the +oauth_token and oauth_token_secret and +rewrites the api_key (API Key) and secret +(Shared Secret fields) as oauth_client_key (Client Key) +and oauth_client_secret (Client Secret) respectively. +.

      +
      + + + \ No newline at end of file diff -Nru flickcurl-1.22/docs/html/flickcurl-auth-use.html flickcurl-1.24/docs/html/flickcurl-auth-use.html --- flickcurl-1.22/docs/html/flickcurl-auth-use.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-auth-use.html 2013-04-11 05:16:55.000000000 +0000 @@ -2,12 +2,12 @@ -Use flickcurl +Use Flickcurl - - - + + + @@ -17,13 +17,14 @@ Up Home Flickcurl Flickr API Manual -Next +Next

      -Use flickcurl

      +Use Flickcurl

      Now the configuration has been created and authentication -completed, the library and utility will work. +completed, the library and the flickcurl(1) utility will +work.

         $ flickcurl photos.getInfo 1234567
      diff -Nru flickcurl-1.22/docs/html/flickcurl-auth.html flickcurl-1.24/docs/html/flickcurl-auth.html
      --- flickcurl-1.22/docs/html/flickcurl-auth.html	2011-12-29 00:17:54.000000000 +0000
      +++ flickcurl-1.24/docs/html/flickcurl-auth.html	2013-04-11 05:16:55.000000000 +0000
      @@ -2,12 +2,12 @@
       
       
       
      -Authenticating Flickcurl
      +Authenticating Flickcurl for OAuth
       
       
       
       
      -
      +
       
       
       
      @@ -17,47 +17,26 @@
        
       Home
       Flickcurl Flickr API Manual
      -Next
      +Next
       
       

      -Authenticating Flickcurl

      +Authenticating Flickcurl for OAuth

      -Build Flickcurl library and flickcurl utility

      -
      -  $ ./configure
      -  $ make
      -
      +Introduction

      -Add the utils directory to your shell search path: -

      -
      -  $ PATH=`pwd`/utils:$PATH
      -on bourne shells such as Bash or
      -  $ setenv PATH `pwd`/utils:$PATH
      -on c shells such as tcsh
      -
      -

      -You should get an error if you now try the utility: -

      -
      -  $ flickcurl photos.getInfo 1234567
      -  flickcurl: ERROR: No shared secret
      -  flickcurl: Command photos.getInfo failed
      -
      -

      -This is because there is no configuration set for the library. For -the flickcurl utility, it reads the configuration from a file -~/.flickcurl.conf which contains parameters used -for authentication. This section describes how those parameters -are obtained. +This section describes the supported +Flickr authentication - the legacy authentication was deprecated at +the start of August 2012 and should not be used for new applications.

      diff -Nru flickcurl-1.22/docs/html/flickcurl-legacy-auth-authenticate.html flickcurl-1.24/docs/html/flickcurl-legacy-auth-authenticate.html --- flickcurl-1.22/docs/html/flickcurl-legacy-auth-authenticate.html 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-legacy-auth-authenticate.html 2013-04-11 05:16:55.000000000 +0000 @@ -0,0 +1,92 @@ + + + + +Getting Authentication Token from API Key and Secret + + + + + + + + + + + + + + + + +
      +

      +Getting Authentication Token from API Key and Secret

      +

      This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication +

      +

      +Create a file ~/.flickcurl.conf with the two +values above (API Key, Shared Secret) like this: +

      +
      +  [flickr]
      +  api_key=0123456789abcdef0123456789abcdef
      +  secret=fedcba9876543210
      +
      +

      Then prompt the user to visit the Authentication URL mentioned +in the previous section +(http://www.flickr.com/auth-11111111111111111) in a web browser. +

      +

      Flickr will return a page that says something like:

      +
      +  "[APP NAME] wants to link to your Flickr account"
      +
      +

      with more information and two buttons. Click the button +with the text:

      +
      +  [OK, I'LL AUTHORIZE IT]
      +
      +
      +

      Flickr App Garden - Mobile Auth

      +
      +

      Flickr will return on the next page a +9-digit FROB that looks like this:

      +
      +  123-456-789
      +
      +

      +Switch back to the command line and run +the flickcurl(1) utility with that FROB: +

      +
      +  $ flickcurl -a 123-456-789
      +
      +

      The result will be that an +Authentication Token (auth token) is calculated +and returned. The flickcurl(1) utility will reply:

      +
      +  flickcurl: Successfully exchanged frob 123-456-789 for authentication token
      +  flickcurl: Updated configuration file /Users/NAME/.flickcurl.conf with authentication token
      +
      +

      The flickcurl(1) utility has automatically updated the +~/.flickcurl.conf configuration file (as the message +will show) with the auth_token field to give something +like:

      +
      +  $ cat ~/.flickcurl.conf
      +  [flickr]
      +  auth_token=1234567-8901234567890123
      +  api_key=0123456789abcdef0123456789abcdef
      +  secret=fedcba9876543210
      +
      +

      +At this stage, the utility (or library) is authenticated and ready to use. +

      +
      + + + \ No newline at end of file diff -Nru flickcurl-1.22/docs/html/flickcurl-legacy-auth-build.html flickcurl-1.24/docs/html/flickcurl-legacy-auth-build.html --- flickcurl-1.22/docs/html/flickcurl-legacy-auth-build.html 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-legacy-auth-build.html 2013-04-11 05:16:55.000000000 +0000 @@ -0,0 +1,63 @@ + + + + +Build Flickcurl library and flickcurl(1) utility + + + + + + + + + + + + + + + + +
      +

      +Build Flickcurl library and flickcurl(1) utility

      +

      This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication +

      +
      +  $ ./configure
      +  $ make
      +
      +

      +Add the utils directory to your shell search path: +

      +
      +  $ PATH=`pwd`/utils:$PATH
      +on bourne shells such as Bash or
      +  $ setenv PATH `pwd`/utils:$PATH
      +on c shells such as tcsh
      +
      +

      +You should get an error if you now try the utility: +

      +
      +  $ flickcurl photos.getInfo 1234567
      +  flickcurl: ERROR: No shared secret
      +  flickcurl: Command photos.getInfo failed
      +
      +

      +This is because there is no configuration set for the library. For +the flickcurl(1) utility, it reads the +configuration from a file +~/.flickcurl.conf which contains parameters used +for authentication. This section describes how those parameters +are obtained. +

      +
      + + + \ No newline at end of file diff -Nru flickcurl-1.22/docs/html/flickcurl-legacy-auth-register.html flickcurl-1.24/docs/html/flickcurl-legacy-auth-register.html --- flickcurl-1.22/docs/html/flickcurl-legacy-auth-register.html 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-legacy-auth-register.html 2013-04-11 05:16:55.000000000 +0000 @@ -0,0 +1,123 @@ + + + + +Register application to get API Key and Shared Secret + + + + + + + + + + + + + + + + +
      +

      +Register application to get API Key and Shared Secret

      +

      This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication +

      +

      NOTE: In the pictures below, the Flickr web site is shown in +English and the screenshots taken in early December 2009. Flickr +upgrade the web site often so these instructions may not match the +latest look. Hopefully you can figure it out!

      +

      +Start by navigating to the Flickr App Garden at +http://www.flickr.com/services/ +and follow the link 'Create an App' taking you to +http://www.flickr.com/services/apps/create/ +

      +
      +

      Flickr App Garden - Get your API Key

      +
      +

      +Select the link 'Request an API Key' taking you to +http://www.flickr.com/services/apps/create/apply/ +

      +
      +

      Flickr App Garden - Commercial / Non-Commercial

      +
      +

      +Select either of the two buttons: +'Apply for a Non-Commercial Key' or 'Apply for a Commercial Key' +as appropriate. +

      +
      +

      Flickr App Garden - Describe application

      +
      +

      +Fill in the form fields and submit it via the 'Submit' button. +

      +
      +

      Flickr App Garden - Key and Secret

      +
      +

      Flickr will return a page containing both the +API Key that looks something like: +

      +
      +   0123456789abcdef0123456789abcdef
      +
      +

      and Secret which looks something like:

      +
      +   fedcba9876543210
      +
      +

      +These strings should be used for the values of the api +and secret keys in either the ~/.flickcurl.conf +if used with the flickcurl(1) utility or in code, with the +flickcurl_set_api_key() +and +flickcurl_set_shared_secret() +functions. +

      +

      +You now need to change the key to be of type mobile since no callback +URL is usually appropriate for a command-line application or library. +

      +

      +Click the 'Edit auth flow for this app' link below the +Key and Secret +

      +
      +

      Flickr App Garden - Edit authentication flow

      +
      +

      Change the 'App Type' to 'Mobile Application' +then set the 'Mobile Permissions' to 'Read', 'Write' Or 'Delete' as +appropriate. +

      +
      +

      Flickr App Garden - Edit authentication flow: mobile

      +
      +

      +This sequence will make the new key 'Auth mode Mobile' +and an authentication URL will be shown on the +same page and look something +like http://www.flickr.com/auth-11111111111111111 +

      +

      Finish with the 'Save Changes' button to confirm and return +you to the application page.

      +
      +

      Flickr App Garden - Application page

      +
      +

      +If you ever need to alter or view the authentication, use the link +'Edit the authentication flow' on right-hand side of the application page. +

      +

      All your Flickr applications are linked from +http://www.flickr.com/services/apps/by/me +

      +
      + + + \ No newline at end of file diff -Nru flickcurl-1.22/docs/html/flickcurl-legacy-auth-use.html flickcurl-1.24/docs/html/flickcurl-legacy-auth-use.html --- flickcurl-1.22/docs/html/flickcurl-legacy-auth-use.html 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-legacy-auth-use.html 2013-04-11 05:16:55.000000000 +0000 @@ -0,0 +1,43 @@ + + + + +Use flickcurl + + + + + + + + + + + + + + + + +
      +

      +Use flickcurl

      +

      This section describes using +the deprecated legacy Flickr authentication. +See the Flickr OAuth authentication +

      +

      Now the configuration has been created and authentication +completed, the library and the flickcurl(1) +utility will work. +

      +
      +  $ flickcurl photos.getInfo 1234567
      +  flickcurl: Found photo with URI http://www.flickr.com/photos/yogi/1234567/ ID 1234567 and 1 tags
      +  ...
      +
      +
      + + + \ No newline at end of file diff -Nru flickcurl-1.22/docs/html/flickcurl-legacy-auth.html flickcurl-1.24/docs/html/flickcurl-legacy-auth.html --- flickcurl-1.22/docs/html/flickcurl-legacy-auth.html 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-legacy-auth.html 2013-04-11 05:16:55.000000000 +0000 @@ -0,0 +1,48 @@ + + + + +Authenticating Flickcurl for Legacy Flickr Authentication + + + + + + + + + + + + + + + + +
      +

      +Authenticating Flickcurl for Legacy Flickr Authentication

      + +
      +

      +Introduction

      +

      +This chapter describes the deprecated +legacy Flickr authentication. This may be removed at any time by +Flickr after August 2012, so this functionality should be migrated +to the +Flickr OAuth authentication +

      +
      +
      + + + \ No newline at end of file diff -Nru flickcurl-1.22/docs/html/flickcurl-searching-search-example.html flickcurl-1.24/docs/html/flickcurl-searching-search-example.html --- flickcurl-1.22/docs/html/flickcurl-searching-search-example.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-searching-search-example.html 2013-04-11 05:16:55.000000000 +0000 @@ -171,21 +171,7 @@ 141 142 143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158
      +144
      #include <stdio.h>
       #include <string.h>
       #include <unistd.h>
      @@ -215,20 +201,6 @@
       }
       
       
      -static void
      -my_set_config_var_handler(void* userdata, const char* key, const char* value)
      -{
      -  flickcurl *fc = (flickcurl *)userdata;
      -  
      -  if(!strcmp(key, "api_key"))
      -    flickcurl_set_api_key(fc, value);
      -  else if(!strcmp(key, "secret"))
      -    flickcurl_set_shared_secret(fc, value);
      -  else if(!strcmp(key, "auth_token"))
      -    flickcurl_set_auth_token(fc, value);
      -}
      -
      -
       static const char* config_filename = ".flickcurl.conf";
       static const char* config_section = "flickr";
       
      @@ -288,8 +260,8 @@
         flickcurl_set_error_handler(fc, my_message_handler, NULL);
       
         if(!access((const char*)config_path, R_OK)) {
      -    if(read_ini_config(config_path, config_section, fc,
      -                       my_set_config_var_handler)) {
      +    if(flickcurl_config_read_ini(fc, config_path, config_section,
      +                                 fc, flickcurl_config_var_handler)) {
             fprintf(stderr, "%s: Failed to read config filename %s: %s\n",
                     program, config_path, strerror(errno));
             rc = 1;
      diff -Nru flickcurl-1.22/docs/html/flickcurl-searching.html flickcurl-1.24/docs/html/flickcurl-searching.html
      --- flickcurl-1.22/docs/html/flickcurl-searching.html	2011-12-29 00:17:54.000000000 +0000
      +++ flickcurl-1.24/docs/html/flickcurl-searching.html	2013-04-11 05:16:55.000000000 +0000
      @@ -6,14 +6,14 @@
       
       
       
      -
      +
       
       
       
       
       
       
      -
      +
      diff -Nru flickcurl-1.22/docs/html/flickcurl-section-auth.html flickcurl-1.24/docs/html/flickcurl-section-auth.html
      --- flickcurl-1.22/docs/html/flickcurl-section-auth.html	2011-12-29 00:17:54.000000000 +0000
      +++ flickcurl-1.24/docs/html/flickcurl-section-auth.html	2013-04-11 05:16:55.000000000 +0000
      @@ -37,7 +37,16 @@
       
       

      Synopsis

      -
      char *              flickcurl_auth_checkToken           (flickcurl *fc,
      +
      const char *        flickcurl_get_api_key               (flickcurl *fc);
      +void                flickcurl_set_api_key               (flickcurl *fc,
      +                                                         const char *api_key);
      +const char *        flickcurl_get_shared_secret         (flickcurl *fc);
      +void                flickcurl_set_shared_secret         (flickcurl *fc,
      +                                                         const char *secret);
      +const char *        flickcurl_get_auth_token            (flickcurl *fc);
      +void                flickcurl_set_auth_token            (flickcurl *fc,
      +                                                         const char *auth_token);
      +char *              flickcurl_auth_checkToken           (flickcurl *fc,
                                                                const char *token);
       char *              flickcurl_auth_getFrob              (flickcurl *fc);
       char *              flickcurl_auth_getFullToken         (flickcurl *fc,
      @@ -45,6 +54,37 @@
       char *              flickcurl_auth_getToken             (flickcurl *fc,
                                                                const char *frob);
       int                 flickcurl_auth_oauth_getAccessToken (flickcurl *fc);
      +extern const char* const flickcurl_flickr_oauth_access_token_uri;
      +extern const char* const flickcurl_flickr_oauth_authorize_uri;
      +extern const char* const flickcurl_flickr_oauth_request_token_uri;
      +const char *        flickcurl_get_oauth_client_key      (flickcurl *fc);
      +void                flickcurl_set_oauth_client_key      (flickcurl *fc,
      +                                                         const char *client_key);
      +const char *        flickcurl_get_oauth_client_secret   (flickcurl *fc);
      +void                flickcurl_set_oauth_client_secret   (flickcurl *fc,
      +                                                         const char *client_secret);
      +const char *        flickcurl_get_oauth_request_token   (flickcurl *fc);
      +void                flickcurl_set_oauth_request_token   (flickcurl *fc,
      +                                                         const char *token);
      +const char *        flickcurl_get_oauth_request_token_secret
      +                                                        (flickcurl *fc);
      +void                flickcurl_set_oauth_request_token_secret
      +                                                        (flickcurl *fc,
      +                                                         const char *secret);
      +const char *        flickcurl_get_oauth_token           (flickcurl *fc);
      +void                flickcurl_set_oauth_token           (flickcurl *fc,
      +                                                         const char *token);
      +const char *        flickcurl_get_oauth_token_secret    (flickcurl *fc);
      +void                flickcurl_set_oauth_token_secret    (flickcurl *fc,
      +                                                         const char *secret);
      +const char *        flickcurl_get_oauth_username        (flickcurl *fc);
      +const char *        flickcurl_get_oauth_user_nsid       (flickcurl *fc);
      +int                 flickcurl_oauth_create_request_token
      +                                                        (flickcurl *fc,
      +                                                         const char *callback);
      +char *              flickcurl_oauth_get_authorize_uri   (flickcurl *fc);
      +int                 flickcurl_oauth_create_access_token (flickcurl *fc,
      +                                                         const char *verifier);
       
      @@ -56,6 +96,141 @@

      Details

      +

      flickcurl_get_api_key ()

      +
      const char *        flickcurl_get_api_key               (flickcurl *fc);
      +

      +Get current application API Key (OAuth Client key) +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      API key or NULL if none set
      +
      +
      +
      +

      flickcurl_set_api_key ()

      +
      void                flickcurl_set_api_key               (flickcurl *fc,
      +                                                         const char *api_key);
      +

      +Set legacy Flickr auth application API Key (OAuth Client key) +

      +

      +For OAuth this is not sufficient and +flickcurl_set_oauth_client_key() and +flickcurl_set_oauth_client_secret() be used +to pass both the client key and client secret. +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      api_key :

      API Key
      +
      +
      +
      +

      flickcurl_get_shared_secret ()

      +
      const char *        flickcurl_get_shared_secret         (flickcurl *fc);
      +

      +Get legacy Flickr auth Secret +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      shared secret or NULL if none set
      +
      +
      +
      +

      flickcurl_set_shared_secret ()

      +
      void                flickcurl_set_shared_secret         (flickcurl *fc,
      +                                                         const char *secret);
      +

      +Set legacy Flickr auth secret +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      secret :

      shared secret
      +
      +
      +
      +

      flickcurl_get_auth_token ()

      +
      const char *        flickcurl_get_auth_token            (flickcurl *fc);
      +

      +Get legacy Flickr auth Token +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      auth token or NULL if none set
      +
      +
      +
      +

      flickcurl_set_auth_token ()

      +
      void                flickcurl_set_auth_token            (flickcurl *fc,
      +                                                         const char *auth_token);
      +

      +Set legacy Flickr auth Token +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      auth_token :

      auth token
      +
      +
      +

      flickcurl_auth_checkToken ()

      char *              flickcurl_auth_checkToken           (flickcurl *fc,
                                                                const char *token);
      @@ -177,13 +352,19 @@

      flickcurl_auth_oauth_getAccessToken ()

      int                 flickcurl_auth_oauth_getAccessToken (flickcurl *fc);

      -Exchange an auth token from the old Authentication API for an OAuth access token. +Exchange tokens from the legacy Flickr auth to ones for OAuth +

      +

      +Calling this method will delete the legacy auth tokens used to +make the request since they will expire within 24 hours of this +call.

      -Calling this method will delete the old auth token used to make the request. +The OAuth token and secret should be saved and can be read from +flickcurl_get_oauth_token() and flickcurl_get_oauth_token_secret()

      -Implements flickr.auth.oauth.getAccessToken (1.22) +Implements flickr.auth.oauth.getAccessToken (1.23)

      @@ -194,6 +375,454 @@ + + + +

      Returns :

      non-0 on failure
      +
      +
      +
      +

      flickcurl_flickr_oauth_access_token_uri

      +
      extern const char* const flickcurl_flickr_oauth_access_token_uri;
      +
      +

      +

      +
      +
      +
      +

      flickcurl_flickr_oauth_authorize_uri

      +
      extern const char* const flickcurl_flickr_oauth_authorize_uri;
      +
      +

      +

      +
      +
      +
      +

      flickcurl_flickr_oauth_request_token_uri

      +
      extern const char* const flickcurl_flickr_oauth_request_token_uri;
      +
      +

      +

      +
      +
      +
      +

      flickcurl_get_oauth_client_key ()

      +
      const char *        flickcurl_get_oauth_client_key      (flickcurl *fc);
      +

      +Get OAuth Client Key (aka Consumer key, API Key) +

      +

      +See also flickcurl_get_oauth_client_secret() +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      client key or NULL if none set
      +
      +
      +
      +

      flickcurl_set_oauth_client_key ()

      +
      void                flickcurl_set_oauth_client_key      (flickcurl *fc,
      +                                                         const char *client_key);
      +

      +Set OAuth client key (aka API key) +

      +

      +See also flickcurl_get_oauth_client_key() +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      client_key :

      client key (API key)
      +
      +
      +
      +

      flickcurl_get_oauth_client_secret ()

      +
      const char *        flickcurl_get_oauth_client_secret   (flickcurl *fc);
      +

      +Get OAuth Client secret +

      +

      +See also flickcurl_get_oauth_client_key() +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      client secret or NULL if none set
      +
      +
      +
      +

      flickcurl_set_oauth_client_secret ()

      +
      void                flickcurl_set_oauth_client_secret   (flickcurl *fc,
      +                                                         const char *client_secret);
      +

      +Set OAuth client key (aka shared secret) +

      +

      +See also flickcurl_set_oauth_client_secret() +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      client_secret :

      client key (shared key)
      +
      +
      +
      +

      flickcurl_get_oauth_request_token ()

      +
      const char *        flickcurl_get_oauth_request_token   (flickcurl *fc);
      +

      +Get OAuth request token +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      request token or NULL if none set
      +
      +
      +
      +

      flickcurl_set_oauth_request_token ()

      +
      void                flickcurl_set_oauth_request_token   (flickcurl *fc,
      +                                                         const char *token);
      +

      +Set OAuth request token +

      +

      +See also flickcurl_get_oauth_request_token() +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      token :

      request token
      +
      +
      +
      +

      flickcurl_get_oauth_request_token_secret ()

      +
      const char *        flickcurl_get_oauth_request_token_secret
      +                                                        (flickcurl *fc);
      +

      +Get OAuth request token secret +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      request token secret or NULL if none set
      +
      +
      +
      +

      flickcurl_set_oauth_request_token_secret ()

      +
      void                flickcurl_set_oauth_request_token_secret
      +                                                        (flickcurl *fc,
      +                                                         const char *secret);
      +

      +Set OAuth request token secret credentials +

      +

      +See also flickcurl_get_oauth_request_token_secret() +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      secret :

      request token secret
      +
      +
      +
      +

      flickcurl_get_oauth_token ()

      +
      const char *        flickcurl_get_oauth_token           (flickcurl *fc);
      +

      +Get OAuth Token +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      auth token or NULL if none set
      +
      +
      +
      +

      flickcurl_set_oauth_token ()

      +
      void                flickcurl_set_oauth_token           (flickcurl *fc,
      +                                                         const char *token);
      +

      +Set OAuth Token +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      token :

      auth token
      +
      +
      +
      +

      flickcurl_get_oauth_token_secret ()

      +
      const char *        flickcurl_get_oauth_token_secret    (flickcurl *fc);
      +

      +Get OAuth token secret +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      secret or NULL if none set
      +
      +
      +
      +

      flickcurl_set_oauth_token_secret ()

      +
      void                flickcurl_set_oauth_token_secret    (flickcurl *fc,
      +                                                         const char *secret);
      +

      +Set OAuth token Secret +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      secret :

      shared secret
      +
      +
      +
      +

      flickcurl_get_oauth_username ()

      +
      const char *        flickcurl_get_oauth_username        (flickcurl *fc);
      +

      +Get the username for the authenticated user +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      username or NULL if none set
      +
      +
      +
      +

      flickcurl_get_oauth_user_nsid ()

      +
      const char *        flickcurl_get_oauth_user_nsid       (flickcurl *fc);
      +

      +Get the user_nsid for the authenticated user +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      user_nsid or NULL if none set
      +
      +
      +
      +

      flickcurl_oauth_create_request_token ()

      +
      int                 flickcurl_oauth_create_request_token
      +                                                        (flickcurl *fc,
      +                                                         const char *callback);
      +

      +Request an OAuth request token from Flickr for the application API Key/secret +

      +

      +Requires the OAuth Client key (API key) and Client secret to have +been set with flickcurl_set_oauth_client_key() and +flickcurl_set_oauth_client_secret() respectively. +

      +

      +Calls the Flickr OAuth endpoint to get a request token for the +given callback or uses out-of-band if callback is NULL. +

      +

      +On success, stores the request token in the fc structure. +

      +
      ++ + + + + + + + + + + + + + +

      fc :

      flickcurl object

      callback :

      callback URL or NULL for out of band

      Returns :

      non-0 on failure
      +
      +
      +
      +

      flickcurl_oauth_get_authorize_uri ()

      +
      char *              flickcurl_oauth_get_authorize_uri   (flickcurl *fc);
      +

      +Get the URL for the user to authorize Flickr OAuth of an application +

      +

      +Forms the URL the user needs to start at to authorize the +application. +

      +

      +This function requires flickcurl_oauth_create_request_token() to have +been called to build a request token / secret pair. +

      +

      +After this function, the application should pass the verifier to +flickcurl_oauth_create_access_token() for the final step in OAuth along +with the request token and request token secret. +

      +
      ++ + + + + + + + + + +

      fc :

      flickcurl object

      Returns :

      authorize URI or NULL on failure
      +
      +
      +
      +

      flickcurl_oauth_create_access_token ()

      +
      int                 flickcurl_oauth_create_access_token (flickcurl *fc,
      +                                                         const char *verifier);
      +

      +Get a Flickr OAuth access token from request token credentials and verifier +

      +

      +Calls the Flickr OAuth access token endpoint using the verifier +from out of band authentication to get an access token to enable +authenticated calls to the Flickr API. +

      +
      ++ + + + + + + + + + + diff -Nru flickcurl-1.22/docs/html/flickcurl-section-core.html flickcurl-1.24/docs/html/flickcurl-section-core.html --- flickcurl-1.22/docs/html/flickcurl-section-core.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-section-core.html 2013-04-11 05:16:55.000000000 +0000 @@ -46,9 +46,6 @@ extern const char* const flickcurl_flickr_replace_service_uri; extern const char* const flickcurl_flickr_service_uri; extern const char* const flickcurl_flickr_upload_service_uri; -extern const char* const flickcurl_flickr_oauth_access_token_uri; -extern const char* const flickcurl_flickr_oauth_authorize_uri; -extern const char* const flickcurl_flickr_oauth_request_token_uri; void (*flickcurl_message_handler) (void *user_data, const char *message); intflickcurl_init (void); @@ -56,8 +53,6 @@ flickcurl * flickcurl_new (void); flickcurl * flickcurl_new_with_handle (void *curl_handle); voidflickcurl_free (flickcurl *fc); -const char * flickcurl_get_api_key (flickcurl *fc); -const char * flickcurl_get_auth_token (flickcurl *fc); intflickcurl_get_current_request_wait (flickcurl *fc); intflickcurl_get_extras_format_info (int extras_format, const char **name_p, @@ -66,10 +61,6 @@ const char **name_p, const char **label_p, const char **mime_type_p); -voidflickcurl_set_api_key (flickcurl *fc, - const char *api_key); -voidflickcurl_set_auth_token (flickcurl *fc, - const char *auth_token); void (*flickcurl_curl_setopt_handler) (void *user_data, void *curl_handle); voidflickcurl_set_curl_setopt_handler (flickcurl *fc, @@ -93,8 +84,6 @@ const char *uri); voidflickcurl_set_upload_service_uri (flickcurl *fc, const char *uri); -voidflickcurl_set_shared_secret (flickcurl *fc, - const char *secret); voidflickcurl_set_sign (flickcurl *fc); voidflickcurl_set_tag_handler (flickcurl *fc, flickcurl_tag_handler tag_handler, @@ -190,30 +179,6 @@
      -

      flickcurl_flickr_oauth_access_token_uri

      -
      extern const char* const flickcurl_flickr_oauth_access_token_uri;
      -
      -

      -

      -
      -
      -
      -

      flickcurl_flickr_oauth_authorize_uri

      -
      extern const char* const flickcurl_flickr_oauth_authorize_uri;
      -
      -

      -

      -
      -
      -
      -

      flickcurl_flickr_oauth_request_token_uri

      -
      extern const char* const flickcurl_flickr_oauth_request_token_uri;
      -
      -

      -

      -
      -
      -

      flickcurl_message_handler ()

      void                (*flickcurl_message_handler)        (void *user_data,
                                                                const char *message);
      @@ -321,48 +286,6 @@

      -

      flickcurl_get_api_key ()

      -
      const char *        flickcurl_get_api_key               (flickcurl *fc);
      -

      -Get current application API Key -

      -

      fc :

      flickcurl object

      verifier :

      verifier from OOB authentication

      Returns :

      non-0 on failure
      -- - - - - - - - - - -

      fc :

      flickcurl object

      Returns :

      API key or NULL if none set
      -
      -
      -
      -

      flickcurl_get_auth_token ()

      -
      const char *        flickcurl_get_auth_token            (flickcurl *fc);
      -

      -Get current auth token -

      -
      -- - - - - - - - - - -

      fc :

      flickcurl object

      Returns :

      auth token or NULL if none set
      -
      -
      -

      flickcurl_get_current_request_wait ()

      int                 flickcurl_get_current_request_wait  (flickcurl *fc);

      @@ -466,50 +389,6 @@


      -

      flickcurl_set_api_key ()

      -
      void                flickcurl_set_api_key               (flickcurl *fc,
      -                                                         const char *api_key);
      -

      -Set application API Key for flickcurl requests -

      -
      -- - - - - - - - - - -

      fc :

      flickcurl object

      api_key :

      API Key
      -
      -
      -
      -

      flickcurl_set_auth_token ()

      -
      void                flickcurl_set_auth_token            (flickcurl *fc,
      -                                                         const char *auth_token);
      -

      -Set Auth Token for flickcurl requests -

      -
      -- - - - - - - - - - -

      fc :

      flickcurl object

      auth_token :

      auth token
      -
      -
      -

      flickcurl_curl_setopt_handler ()

      void                (*flickcurl_curl_setopt_handler)    (void *user_data,
                                                                void *curl_handle);
      @@ -776,28 +655,6 @@
      -
      -
      -
      -

      flickcurl_set_shared_secret ()

      -
      void                flickcurl_set_shared_secret         (flickcurl *fc,
      -                                                         const char *secret);
      -

      -Set Shared Secret for flickcurl requests -

      -
      -- - - - - - - - - - -

      fc :

      flickcurl object

      secret :

      shared secret

      diff -Nru flickcurl-1.22/docs/html/flickcurl-section-general.html flickcurl-1.24/docs/html/flickcurl-section-general.html --- flickcurl-1.22/docs/html/flickcurl-section-general.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-section-general.html 2013-04-11 05:16:55.000000000 +0000 @@ -7,7 +7,7 @@ - + diff -Nru flickcurl-1.22/docs/html/flickcurl-section-group.html flickcurl-1.24/docs/html/flickcurl-section-group.html --- flickcurl-1.22/docs/html/flickcurl-section-group.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-section-group.html 2013-04-11 05:16:55.000000000 +0000 @@ -109,6 +109,21 @@ int throttle_count; char* throttle_mode; int throttle_remaining; + int iconfarm; + int is_moderator; + int is_member; + char* rules; + int pool_count; + int topic_count; + int photos_ok; + int videos_ok; + int images_ok; + int screens_ok; + int art_ok; + int safe_ok; + int moderate_ok; + int restricted_ok; + int has_geo; } flickcurl_group;

      @@ -135,7 +150,7 @@

      int is_admin;

      -is admin flag +user is a group admin

      int is_pool_moderated;

      @@ -143,7 +158,7 @@

      int is_eighteenplus;

      -18+ group +NOT USED (will always be 0)

      int privacy;

      @@ -173,6 +188,66 @@

      int throttle_remaining;

      throttle remaining + +

      int iconfarm;

      +icon farm ID + + +

      int is_moderator;

      +user is a moderator + + +

      int is_member;

      +user is a member + + +

      char *rules;

      +group rules + + +

      int pool_count;

      +pool count + + +

      int topic_count;

      +topic count + + +

      int photos_ok;

      +photos are ok + + +

      int videos_ok;

      +videos are ok + + +

      int images_ok;

      +images are ok + + +

      int screens_ok;

      +screens are ok + + +

      int art_ok;

      +art is ok + + +

      int safe_ok;

      +safe content is ok + + +

      int moderate_ok;

      +moderate content is ok + + +

      int restricted_ok;

      +restricted content is ok + + +

      int has_geo;

      +has geolocation + diff -Nru flickcurl-1.22/docs/html/flickcurl-section-misc.html flickcurl-1.24/docs/html/flickcurl-section-misc.html --- flickcurl-1.22/docs/html/flickcurl-section-misc.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-section-misc.html 2013-04-11 05:16:55.000000000 +0000 @@ -48,7 +48,6 @@ (flickcurl_field_value_type datatype); const char * flickcurl_get_location_accuracy_label (int accuracy); -const char * flickcurl_get_shared_secret (flickcurl *fc); flickcurl_photo ** flickcurl_interestingness_getList (flickcurl *fc, const char *date, const char *extras, @@ -177,6 +176,25 @@

      A photo at a size.

      +

      +Supported sizes and their letter suffixes used in the source and +the url fields are as follows: +

      +

      +s: small square 75x75. +q: large square 150x150 (2011-03-12 or later). +t: thumbnail, 100 on longest side. +m: small, 240 on longest side. +n: small, 320 on longest side (2011-03-12 or later). +-: medium, 500 on longest side. +z: medium 640, 640 on longest side. +b: large, 1024 on longest side*. +o: original image, either a jpg, gif or png, depending on source format. +

      +

      +The 'q' and 'n' sizes were announced 2011-03-12 in +http://tech.groups.yahoo.com/group/yws-flickr/message/7483 +

      @@ -310,27 +328,6 @@
      - -
      -
      -

      flickcurl_get_shared_secret ()

      -
      const char *        flickcurl_get_shared_secret         (flickcurl *fc);
      -

      -Get current Shared Secret -

      -
      -- - - - - - - - - - -

      fc :

      flickcurl object

      Returns :

      shared secret or NULL if none set

      diff -Nru flickcurl-1.22/docs/html/flickcurl-section-photo.html flickcurl-1.24/docs/html/flickcurl-section-photo.html --- flickcurl-1.22/docs/html/flickcurl-section-photo.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl-section-photo.html 2013-04-11 05:16:55.000000000 +0000 @@ -154,6 +154,9 @@ int per_page); flickcurl_photo * flickcurl_photos_getInfo (flickcurl *fc, const char *photo_id); +flickcurl_photo * flickcurl_photos_getInfo2 (flickcurl *fc, + const char *photo_id, + const char *secret); flickcurl_photo ** flickcurl_photos_getNotInSet (flickcurl *fc, int min_upload_date, int max_upload_date, @@ -2161,6 +2164,38 @@ Get information about a photo

      +Deprecated for flickcurl_photos_getInfo2() that allows passing the +optional secret. +

      +
      ++ + + + + + + + + + + + + + +

      fc :

      flickcurl context

      photo_id :

      photo ID

      Returns :

      +flickcurl_photo or NULL on failure
      +
      +
      +
      +

      flickcurl_photos_getInfo2 ()

      +
      flickcurl_photo *   flickcurl_photos_getInfo2           (flickcurl *fc,
      +                                                         const char *photo_id,
      +                                                         const char *secret);
      +

      +Get information about a photo +

      +

      Implements flickr.photos.getInfo (0.5)

      @@ -2175,6 +2210,10 @@ + + + + diff -Nru flickcurl-1.22/docs/html/flickcurl.devhelp2 flickcurl-1.24/docs/html/flickcurl.devhelp2 --- flickcurl-1.22/docs/html/flickcurl.devhelp2 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/flickcurl.devhelp2 2013-04-11 05:16:55.000000000 +0000 @@ -5,11 +5,20 @@ - - - - - + + + + + + + + + + + + + + @@ -67,22 +76,15 @@ - - - - - - - @@ -93,7 +95,6 @@ - @@ -109,11 +110,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -211,7 +238,6 @@ - @@ -282,6 +308,7 @@ + diff -Nru flickcurl-1.22/docs/html/index.html flickcurl-1.24/docs/html/index.html --- flickcurl-1.22/docs/html/index.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/index.html 2013-04-11 05:16:55.000000000 +0000 @@ -22,11 +22,11 @@   http://www.dajobe.org/

      -

      Manual for Flickcurl 1.22 +

      Manual for Flickcurl 1.24

      -
      +
      -

      +

      This documentation is Free Software / Open Source - you can redistribute it and/or modify it under the same licenses as Flickcurl. @@ -55,12 +55,22 @@

      General — General functions.
      -
      Authenticating Flickcurl
      +
      Authenticating Flickcurl for OAuth
      -
      Build Flickcurl library and flickcurl utility
      -
      Register application to get API Key and Shared Secret
      -
      Getting Authentication Token from API Key and Secret
      -
      Use flickcurl
      +
      Introduction
      +
      Build Flickcurl library and flickcurl(1) utility
      +
      Register application to get Client Key and Client Secret
      +
      Getting Authentication Token from Client Key and Client Secret
      +
      Use Flickcurl
      +
      Upgrading from legacy Flickr authentication
      +
      +
      Authenticating Flickcurl for Legacy Flickr Authentication
      +
      +
      Introduction
      +
      Build Flickcurl library and flickcurl(1) utility
      +
      Register application to get API Key and Shared Secret
      +
      Getting Authentication Token from API Key and Secret
      +
      Use flickcurl
      Searching for Photos with Flickcurl
      diff -Nru flickcurl-1.22/docs/html/index.sgml flickcurl-1.24/docs/html/index.sgml --- flickcurl-1.22/docs/html/index.sgml 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/index.sgml 2013-04-11 05:16:55.000000000 +0000 @@ -11,22 +11,15 @@ - - - - - - - @@ -37,7 +30,6 @@ - @@ -65,11 +57,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -234,7 +252,6 @@ - @@ -425,6 +442,7 @@ + diff -Nru flickcurl-1.22/docs/html/indexes.html flickcurl-1.24/docs/html/indexes.html --- flickcurl-1.22/docs/html/indexes.html 2011-12-29 00:17:54.000000000 +0000 +++ flickcurl-1.24/docs/html/indexes.html 2013-04-11 05:16:55.000000000 +0000 @@ -118,11 +118,11 @@
      flickcurl_finish, flickcurl_finish ()
      -
      flickcurl_flickr_oauth_access_token_uri, flickcurl_flickr_oauth_access_token_uri +
      flickcurl_flickr_oauth_access_token_uri, flickcurl_flickr_oauth_access_token_uri
      -
      flickcurl_flickr_oauth_authorize_uri, flickcurl_flickr_oauth_authorize_uri +
      flickcurl_flickr_oauth_authorize_uri, flickcurl_flickr_oauth_authorize_uri
      -
      flickcurl_flickr_oauth_request_token_uri, flickcurl_flickr_oauth_request_token_uri +
      flickcurl_flickr_oauth_request_token_uri, flickcurl_flickr_oauth_request_token_uri
      flickcurl_flickr_replace_service_uri, flickcurl_flickr_replace_service_uri
      @@ -262,9 +262,9 @@
      flickcurl_gallery, flickcurl_gallery
      -
      flickcurl_get_api_key, flickcurl_get_api_key () +
      flickcurl_get_api_key, flickcurl_get_api_key ()
      -
      flickcurl_get_auth_token, flickcurl_get_auth_token () +
      flickcurl_get_auth_token, flickcurl_get_auth_token ()
      flickcurl_get_content_type_from_string, flickcurl_get_content_type_from_string ()
      @@ -288,6 +288,22 @@
      flickcurl_get_location_accuracy_label, flickcurl_get_location_accuracy_label ()
      +
      flickcurl_get_oauth_client_key, flickcurl_get_oauth_client_key () +
      +
      flickcurl_get_oauth_client_secret, flickcurl_get_oauth_client_secret () +
      +
      flickcurl_get_oauth_request_token, flickcurl_get_oauth_request_token () +
      +
      flickcurl_get_oauth_request_token_secret, flickcurl_get_oauth_request_token_secret () +
      +
      flickcurl_get_oauth_token, flickcurl_get_oauth_token () +
      +
      flickcurl_get_oauth_token_secret, flickcurl_get_oauth_token_secret () +
      +
      flickcurl_get_oauth_username, flickcurl_get_oauth_username () +
      +
      flickcurl_get_oauth_user_nsid, flickcurl_get_oauth_user_nsid () +
      flickcurl_get_person_field_label, flickcurl_get_person_field_label ()
      flickcurl_get_photo_field_label, flickcurl_get_photo_field_label () @@ -300,7 +316,7 @@
      flickcurl_get_safety_level_label, flickcurl_get_safety_level_label ()
      -
      flickcurl_get_shared_secret, flickcurl_get_shared_secret () +
      flickcurl_get_shared_secret, flickcurl_get_shared_secret ()
      flickcurl_group, flickcurl_group
      @@ -368,6 +384,12 @@
      flickcurl_note, flickcurl_note
      +
      flickcurl_oauth_create_access_token, flickcurl_oauth_create_access_token () +
      +
      flickcurl_oauth_create_request_token, flickcurl_oauth_create_request_token () +
      +
      flickcurl_oauth_get_authorize_uri, flickcurl_oauth_get_authorize_uri () +
      flickcurl_panda_getList, flickcurl_panda_getList ()
      flickcurl_panda_getPhotos, flickcurl_panda_getPhotos () @@ -498,6 +520,8 @@
      flickcurl_photos_getInfo, flickcurl_photos_getInfo ()
      +
      flickcurl_photos_getInfo2, flickcurl_photos_getInfo2 () +
      flickcurl_photos_getNotInSet, flickcurl_photos_getNotInSet ()
      flickcurl_photos_getNotInSet_params, flickcurl_photos_getNotInSet_params () @@ -664,9 +688,9 @@
      flickcurl_serialize_photo, flickcurl_serialize_photo ()
      -
      flickcurl_set_api_key, flickcurl_set_api_key () +
      flickcurl_set_api_key, flickcurl_set_api_key ()
      -
      flickcurl_set_auth_token, flickcurl_set_auth_token () +
      flickcurl_set_auth_token, flickcurl_set_auth_token ()
      flickcurl_set_curl_setopt_handler, flickcurl_set_curl_setopt_handler ()
      @@ -676,6 +700,18 @@
      flickcurl_set_http_accept, flickcurl_set_http_accept ()
      +
      flickcurl_set_oauth_client_key, flickcurl_set_oauth_client_key () +
      +
      flickcurl_set_oauth_client_secret, flickcurl_set_oauth_client_secret () +
      +
      flickcurl_set_oauth_request_token, flickcurl_set_oauth_request_token () +
      +
      flickcurl_set_oauth_request_token_secret, flickcurl_set_oauth_request_token_secret () +
      +
      flickcurl_set_oauth_token, flickcurl_set_oauth_token () +
      +
      flickcurl_set_oauth_token_secret, flickcurl_set_oauth_token_secret () +
      flickcurl_set_proxy, flickcurl_set_proxy ()
      flickcurl_set_replace_service_uri, flickcurl_set_replace_service_uri () @@ -684,7 +720,7 @@
      flickcurl_set_service_uri, flickcurl_set_service_uri ()
      -
      flickcurl_set_shared_secret, flickcurl_set_shared_secret () +
      flickcurl_set_shared_secret, flickcurl_set_shared_secret ()
      flickcurl_set_sign, flickcurl_set_sign ()
      diff -Nru flickcurl-1.22/docs/search-photos.c flickcurl-1.24/docs/search-photos.c --- flickcurl-1.22/docs/search-photos.c 2011-12-29 00:17:38.000000000 +0000 +++ flickcurl-1.24/docs/search-photos.c 2013-04-11 05:16:37.000000000 +0000 @@ -27,20 +27,6 @@ } -static void -my_set_config_var_handler(void* userdata, const char* key, const char* value) -{ - flickcurl *fc = (flickcurl *)userdata; - - if(!strcmp(key, "api_key")) - flickcurl_set_api_key(fc, value); - else if(!strcmp(key, "secret")) - flickcurl_set_shared_secret(fc, value); - else if(!strcmp(key, "auth_token")) - flickcurl_set_auth_token(fc, value); -} - - static const char* config_filename = ".flickcurl.conf"; static const char* config_section = "flickr"; @@ -100,8 +86,8 @@ flickcurl_set_error_handler(fc, my_message_handler, NULL); if(!access((const char*)config_path, R_OK)) { - if(read_ini_config(config_path, config_section, fc, - my_set_config_var_handler)) { + if(flickcurl_config_read_ini(fc, config_path, config_section, + fc, flickcurl_config_var_handler)) { fprintf(stderr, "%s: Failed to read config filename %s: %s\n", program, config_path, strerror(errno)); rc = 1; diff -Nru flickcurl-1.22/docs/tmpl/section-auth.sgml flickcurl-1.24/docs/tmpl/section-auth.sgml --- flickcurl-1.22/docs/tmpl/section-auth.sgml 2011-12-29 00:17:53.000000000 +0000 +++ flickcurl-1.24/docs/tmpl/section-auth.sgml 2013-04-11 05:16:55.000000000 +0000 @@ -20,6 +20,60 @@ + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@api_key: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@secret: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@auth_token: + + @@ -68,3 +122,176 @@ @Returns: + + + + + + + + + + + + + + + + + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@client_key: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@client_secret: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@token: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@secret: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@token: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@secret: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@callback: +@Returns: + + + + + + + +@fc: +@Returns: + + + + + + + +@fc: +@verifier: +@Returns: + + diff -Nru flickcurl-1.22/docs/tmpl/section-core.sgml flickcurl-1.24/docs/tmpl/section-core.sgml --- flickcurl-1.22/docs/tmpl/section-core.sgml 2011-12-29 00:17:53.000000000 +0000 +++ flickcurl-1.24/docs/tmpl/section-core.sgml 2013-04-11 05:16:55.000000000 +0000 @@ -74,24 +74,6 @@ - - - - - - - - - - - - - - - - - - @@ -144,24 +126,6 @@ @fc: - - - - - -@fc: -@Returns: - - - - - - - -@fc: -@Returns: - - @@ -194,24 +158,6 @@ @Returns: - - - - - -@fc: -@api_key: - - - - - - - -@fc: -@auth_token: - - @@ -305,15 +251,6 @@ @uri: - - - - - -@fc: -@secret: - - diff -Nru flickcurl-1.22/docs/tmpl/section-group.sgml flickcurl-1.24/docs/tmpl/section-group.sgml --- flickcurl-1.22/docs/tmpl/section-group.sgml 2011-12-29 00:17:53.000000000 +0000 +++ flickcurl-1.24/docs/tmpl/section-group.sgml 2013-04-11 05:16:55.000000000 +0000 @@ -39,6 +39,21 @@ @throttle_count: @throttle_mode: @throttle_remaining: +@iconfarm: +@is_moderator: +@is_member: +@rules: +@pool_count: +@topic_count: +@photos_ok: +@videos_ok: +@images_ok: +@screens_ok: +@art_ok: +@safe_ok: +@moderate_ok: +@restricted_ok: +@has_geo: diff -Nru flickcurl-1.22/docs/tmpl/section-misc.sgml flickcurl-1.24/docs/tmpl/section-misc.sgml --- flickcurl-1.22/docs/tmpl/section-misc.sgml 2011-12-29 00:17:53.000000000 +0000 +++ flickcurl-1.24/docs/tmpl/section-misc.sgml 2013-04-11 05:16:55.000000000 +0000 @@ -103,15 +103,6 @@ @Returns: - - - - - -@fc: -@Returns: - - diff -Nru flickcurl-1.22/docs/tmpl/section-photo.sgml flickcurl-1.24/docs/tmpl/section-photo.sgml --- flickcurl-1.22/docs/tmpl/section-photo.sgml 2011-12-29 00:17:53.000000000 +0000 +++ flickcurl-1.24/docs/tmpl/section-photo.sgml 2013-04-11 05:16:55.000000000 +0000 @@ -526,6 +526,17 @@ @Returns: + + + + + +@fc: +@photo_id: +@secret: +@Returns: + + diff -Nru flickcurl-1.22/docs/version.xml flickcurl-1.24/docs/version.xml --- flickcurl-1.22/docs/version.xml 2011-12-29 00:17:37.000000000 +0000 +++ flickcurl-1.24/docs/version.xml 2013-04-11 05:16:36.000000000 +0000 @@ -1 +1 @@ -1.22 +1.24 diff -Nru flickcurl-1.22/examples/Makefile.in flickcurl-1.24/examples/Makefile.in --- flickcurl-1.22/examples/Makefile.in 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/examples/Makefile.in 2013-04-11 04:49:28.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 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. @@ -32,6 +32,23 @@ # complete terms and further detail along with the license texts for # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -72,8 +89,8 @@ am__EXEEXT_1 = print-photo-info$(EXEEXT) search-photos$(EXEEXT) am_print_photo_info_OBJECTS = print-photo-info.$(OBJEXT) print_photo_info_OBJECTS = $(am_print_photo_info_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__search_photos_SOURCES_DIST = search-photos.c \ $(srcdir)/../utils/getopt.c \ @@ -93,25 +110,30 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(print_photo_info_SOURCES) $(search_photos_SOURCES) DIST_SOURCES = $(print_photo_info_SOURCES) \ $(am__search_photos_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -128,6 +150,7 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -191,12 +214,14 @@ RAPTOR_CFLAGS = @RAPTOR_CFLAGS@ RAPTOR_LIBS = @RAPTOR_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ +RECHO = @RECHO@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STANDARD_CFLAGS = @STANDARD_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -297,10 +322,10 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -print-photo-info$(EXEEXT): $(print_photo_info_OBJECTS) $(print_photo_info_DEPENDENCIES) +print-photo-info$(EXEEXT): $(print_photo_info_OBJECTS) $(print_photo_info_DEPENDENCIES) $(EXTRA_print_photo_info_DEPENDENCIES) @rm -f print-photo-info$(EXEEXT) $(AM_V_CCLD)$(LINK) $(print_photo_info_OBJECTS) $(print_photo_info_LDADD) $(LIBS) -search-photos$(EXEEXT): $(search_photos_OBJECTS) $(search_photos_DEPENDENCIES) +search-photos$(EXEEXT): $(search_photos_OBJECTS) $(search_photos_DEPENDENCIES) $(EXTRA_search_photos_DEPENDENCIES) @rm -f search-photos$(EXEEXT) $(AM_V_CCLD)$(LINK) $(search_photos_OBJECTS) $(search_photos_LDADD) $(LIBS) @@ -317,58 +342,51 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< search_photos-search-photos.o: search-photos.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT search_photos-search-photos.o -MD -MP -MF $(DEPDIR)/search_photos-search-photos.Tpo -c -o search_photos-search-photos.o `test -f 'search-photos.c' || echo '$(srcdir)/'`search-photos.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_photos-search-photos.Tpo $(DEPDIR)/search_photos-search-photos.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='search-photos.c' object='search_photos-search-photos.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='search-photos.c' object='search_photos-search-photos.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-search-photos.o `test -f 'search-photos.c' || echo '$(srcdir)/'`search-photos.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-search-photos.o `test -f 'search-photos.c' || echo '$(srcdir)/'`search-photos.c search_photos-search-photos.obj: search-photos.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT search_photos-search-photos.obj -MD -MP -MF $(DEPDIR)/search_photos-search-photos.Tpo -c -o search_photos-search-photos.obj `if test -f 'search-photos.c'; then $(CYGPATH_W) 'search-photos.c'; else $(CYGPATH_W) '$(srcdir)/search-photos.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_photos-search-photos.Tpo $(DEPDIR)/search_photos-search-photos.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='search-photos.c' object='search_photos-search-photos.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='search-photos.c' object='search_photos-search-photos.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-search-photos.obj `if test -f 'search-photos.c'; then $(CYGPATH_W) 'search-photos.c'; else $(CYGPATH_W) '$(srcdir)/search-photos.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-search-photos.obj `if test -f 'search-photos.c'; then $(CYGPATH_W) 'search-photos.c'; else $(CYGPATH_W) '$(srcdir)/search-photos.c'; fi` search_photos-getopt.o: $(srcdir)/../utils/getopt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT search_photos-getopt.o -MD -MP -MF $(DEPDIR)/search_photos-getopt.Tpo -c -o search_photos-getopt.o `test -f '$(srcdir)/../utils/getopt.c' || echo '$(srcdir)/'`$(srcdir)/../utils/getopt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_photos-getopt.Tpo $(DEPDIR)/search_photos-getopt.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../utils/getopt.c' object='search_photos-getopt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../utils/getopt.c' object='search_photos-getopt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-getopt.o `test -f '$(srcdir)/../utils/getopt.c' || echo '$(srcdir)/'`$(srcdir)/../utils/getopt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-getopt.o `test -f '$(srcdir)/../utils/getopt.c' || echo '$(srcdir)/'`$(srcdir)/../utils/getopt.c search_photos-getopt.obj: $(srcdir)/../utils/getopt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT search_photos-getopt.obj -MD -MP -MF $(DEPDIR)/search_photos-getopt.Tpo -c -o search_photos-getopt.obj `if test -f '$(srcdir)/../utils/getopt.c'; then $(CYGPATH_W) '$(srcdir)/../utils/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../utils/getopt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/search_photos-getopt.Tpo $(DEPDIR)/search_photos-getopt.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/../utils/getopt.c' object='search_photos-getopt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../utils/getopt.c' object='search_photos-getopt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-getopt.obj `if test -f '$(srcdir)/../utils/getopt.c'; then $(CYGPATH_W) '$(srcdir)/../utils/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../utils/getopt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(search_photos_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o search_photos-getopt.obj `if test -f '$(srcdir)/../utils/getopt.c'; then $(CYGPATH_W) '$(srcdir)/../utils/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../utils/getopt.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -472,10 +490,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff -Nru flickcurl-1.22/examples/print-photo-info.c flickcurl-1.24/examples/print-photo-info.c --- flickcurl-1.22/examples/print-photo-info.c 2009-06-04 20:03:26.000000000 +0000 +++ flickcurl-1.24/examples/print-photo-info.c 2013-04-09 05:02:49.000000000 +0000 @@ -1,9 +1,12 @@ /* * print-photo-info.c - Flickcurl example code to get information about a photo * - * This is example code and not complete because the API Key, Shared - * Secret and Auth Token are not configured. The flickcurl utility - * in utils/flickcurl.c contains code that fully uses the API. + * This is example code and not complete because the OAuth client + * key, secret and the token and token secret are not configured. + * + * The flickcurl utility in utils/flickcurl.c contains code that + * fully uses the API and read/writes configuration from a file + * using flickcurl_config_var_handler() * * This file is in the Public Domain * @@ -26,17 +29,25 @@ int i; flickcurl_init(); /* optional static initialising of resources */ - fc=flickcurl_new(); + fc = flickcurl_new(); + + /* Set configuration explicitly: ... */ + flickcurl_set_oauth_client_key(fc, "..."); + flickcurl_set_oauth_client_secret(fc, "..."); + flickcurl_set_oauth_token(fc, "..."); + flickcurl_set_oauth_token_secret(fc, "..."); + + /* or could read from an INI config file like this: */ + /* + flickcurl_config_read_ini(fc, "/home/user/.flickcurl.conf", "flickr", + fc, flickcurl_config_var_handler); + */ - /* Set configuration, or more likely read from a config file */ - flickcurl_set_api_key(fc, "..."); - flickcurl_set_shared_secret(fc, "..."); - flickcurl_set_auth_token(fc, "..."); - photo=flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */ + photo = flickcurl_photos_getInfo(fc, "123456789"); /* photo ID */ - for(field_type=0; field_type <= PHOTO_FIELD_LAST; field_type++) { - flickcurl_field_value_type datatype=photo->fields[field_type].type; + for(field_type = 0; field_type <= PHOTO_FIELD_LAST; field_type++) { + flickcurl_field_value_type datatype = photo->fields[field_type].type; if(datatype != VALUE_TYPE_NONE) fprintf(stderr, "field %s (%d) with %s value: '%s' / %d\n", @@ -46,7 +57,7 @@ photo->fields[field_type].integer); } - for(i=0; i < photo->tags_count; i++) { + for(i = 0; i < photo->tags_count; i++) { flickcurl_tag* tag=photo->tags[i]; fprintf(stderr, "%d) %s tag: id %s author ID %s name %s raw '%s' cooked '%s' count %d\n", diff -Nru flickcurl-1.22/examples/search-photos.c flickcurl-1.24/examples/search-photos.c --- flickcurl-1.22/examples/search-photos.c 2009-09-16 04:40:25.000000000 +0000 +++ flickcurl-1.24/examples/search-photos.c 2013-04-09 05:02:49.000000000 +0000 @@ -2,7 +2,7 @@ * * search-photos - Search for my interesting photos about a tag * - * Copyright (C) 2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2009-2013, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -53,20 +53,6 @@ } -static void -my_set_config_var_handler(void* userdata, const char* key, const char* value) -{ - flickcurl *fc = (flickcurl *)userdata; - - if(!strcmp(key, "api_key")) - flickcurl_set_api_key(fc, value); - else if(!strcmp(key, "secret")) - flickcurl_set_shared_secret(fc, value); - else if(!strcmp(key, "auth_token")) - flickcurl_set_auth_token(fc, value); -} - - static const char* config_filename = ".flickcurl.conf"; static const char* config_section = "flickr"; @@ -126,8 +112,8 @@ flickcurl_set_error_handler(fc, my_message_handler, NULL); if(!access((const char*)config_path, R_OK)) { - if(read_ini_config(config_path, config_section, fc, - my_set_config_var_handler)) { + if(flickcurl_config_read_ini(fc, config_path, config_section, + fc, flickcurl_config_var_handler)) { fprintf(stderr, "%s: Failed to read config filename %s: %s\n", program, config_path, strerror(errno)); rc = 1; diff -Nru flickcurl-1.22/flickcurl.spec flickcurl-1.24/flickcurl.spec --- flickcurl-1.22/flickcurl.spec 2011-12-29 00:17:37.000000000 +0000 +++ flickcurl-1.24/flickcurl.spec 2013-04-11 05:16:36.000000000 +0000 @@ -1,6 +1,6 @@ # -*- RPM-SPEC -*- %define name flickcurl -%define version 1.22 +%define version 1.24 %define release 1 %define major 0 diff -Nru flickcurl-1.22/libmtwist/mt.c flickcurl-1.24/libmtwist/mt.c --- flickcurl-1.22/libmtwist/mt.c 2011-10-29 17:00:22.000000000 +0000 +++ flickcurl-1.24/libmtwist/mt.c 2012-08-29 01:53:29.000000000 +0000 @@ -145,7 +145,6 @@ int count; uint32_t *p = mt->state; - count = 0; for(count = (MTWIST_N - MTWIST_M + 1); --count; p++) *p = p[MTWIST_M] ^ MTWIST_TWIST(p[0], p[1]); @@ -176,7 +175,7 @@ return 0UL; if(!mt->seeded) - mtwist_init(mt, MT_STATIC_SEED); + mtwist_init(mt, mtwist_seed_from_system(mt)); if(!mt->remaining) mtwist_update_state(mt); diff -Nru flickcurl-1.22/src/Makefile.am flickcurl-1.24/src/Makefile.am --- flickcurl-1.22/src/Makefile.am 2011-11-12 06:21:04.000000000 +0000 +++ flickcurl-1.24/src/Makefile.am 2012-08-29 01:48:37.000000000 +0000 @@ -87,10 +87,19 @@ test-api.c \ upload-api.c \ urls-api.c \ -flickcurl_internal.h +flickcurl_internal.h \ +sha1.c \ +legacy-auth.c \ +oauth.c \ +$(top_srcdir)/libmtwist/mt.c \ +$(top_srcdir)/libmtwist/seed.c \ +$(top_srcdir)/libmtwist/mtwist.h \ +$(top_srcdir)/libmtwist/mtwist_internal.h \ +mtwist_config.h -AM_CFLAGS= -libflickcurl_la_LIBADD= +AM_CFLAGS = -DMTWIST_CONFIG -I$(top_srcdir)/libmtwist + +libflickcurl_la_LIBADD = libflickcurl_la_LDFLAGS = -version-info @LIBFLICKCURL_LIBTOOL_VERSION@ @@ -101,28 +110,37 @@ endif endif -TESTS= - -CLEANFILES=$(TESTS) +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) +TESTS=flickcurl_oauth_test -if FLICKCURL_OAUTH - -libflickcurl_la_SOURCES += \ -$(top_srcdir)/libmtwist/mt.c \ -$(top_srcdir)/libmtwist/seed.c \ -$(top_srcdir)/libmtwist/mtwist.h \ -$(top_srcdir)/libmtwist/mtwist_internal.h \ -mtwist_config.h - -AM_CFLAGS += -DMTWIST_CONFIG -I$(top_srcdir)/libmtwist - -libflickcurl_la_SOURCES += sha1.c \ -oauth.c - -TESTS += flickcurl_oauth_test +CLEANFILES=$(TESTS) \ +*.plist flickcurl_oauth_test: $(srcdir)/oauth.c libflickcurl.la $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/oauth.c libflickcurl.la $(LIBS) +if MAINTAINER_MODE + +# Run Clang static analyzer over sources. +analyze: $(SOURCES) + @list='$(SOURCES)'; \ + result=0; \ + for file in $$list; do \ + if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ + $(RECHO) "Analyzing $$file"; \ + $(ANALYZE_COMMAND) $(srcdir)/$$file; \ + status=$$?; \ + if test $$status != 0; then \ + result=1; \ + fi; \ + fi; \ + done; \ + set -e; exit $$result endif diff -Nru flickcurl-1.22/src/Makefile.in flickcurl-1.24/src/Makefile.in --- flickcurl-1.22/src/Makefile.in 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/src/Makefile.in 2013-04-11 04:49:28.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 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. @@ -34,6 +34,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -54,13 +71,6 @@ host_triplet = @host@ @OFFLINE_TRUE@@RAPTOR_TRUE@am__append_1 = @RAPTOR_CFLAGS@ @OFFLINE_TRUE@@RAPTOR_TRUE@am__append_2 = @RAPTOR_LIBS@ -@FLICKCURL_OAUTH_TRUE@am__append_3 = $(top_srcdir)/libmtwist/mt.c \ -@FLICKCURL_OAUTH_TRUE@ $(top_srcdir)/libmtwist/seed.c \ -@FLICKCURL_OAUTH_TRUE@ $(top_srcdir)/libmtwist/mtwist.h \ -@FLICKCURL_OAUTH_TRUE@ $(top_srcdir)/libmtwist/mtwist_internal.h \ -@FLICKCURL_OAUTH_TRUE@ mtwist_config.h sha1.c oauth.c -@FLICKCURL_OAUTH_TRUE@am__append_4 = -DMTWIST_CONFIG -I$(top_srcdir)/libmtwist -@FLICKCURL_OAUTH_TRUE@am__append_5 = flickcurl_oauth_test subdir = src DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in @@ -98,31 +108,16 @@ 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)$(libdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libflickcurl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__libflickcurl_la_SOURCES_DIST = activity.c args.c blog.c category.c \ - collection.c common.c comments.c contacts.c context.c config.c \ - exif.c gallery.c group.c institution.c md5.c location.c \ - machinetags.c members.c method.c note.c person.c photo.c \ - photoset.c place.c serializer.c shape.c size.c stat.c ticket.c \ - user_upload_status.c tags.c video.c vsnprintf.c activity-api.c \ - auth-api.c blogs-api.c commons-api.c collections-api.c \ - contacts-api.c favorites-api.c interestingness-api.c \ - galleries-api.c groups-api.c groups-members-api.c \ - groups-pools-api.c machinetags-api.c people-api.c perms.c \ - panda-api.c photos-api.c photos-comments-api.c \ - photos-geo-api.c photos-licenses-api.c photos-notes-api.c \ - photos-people-api.c photos-transform-api.c photos-upload-api.c \ - photosets-api.c photosets-comments-api.c places-api.c \ - prefs-api.c reflection-api.c stats-api.c tags-api.c test-api.c \ - upload-api.c urls-api.c flickcurl_internal.h \ - $(top_srcdir)/libmtwist/mt.c $(top_srcdir)/libmtwist/seed.c \ - $(top_srcdir)/libmtwist/mtwist.h \ - $(top_srcdir)/libmtwist/mtwist_internal.h mtwist_config.h \ - sha1.c oauth.c -@FLICKCURL_OAUTH_TRUE@am__objects_1 = mt.lo seed.lo sha1.lo oauth.lo am_libflickcurl_la_OBJECTS = activity.lo args.lo blog.lo category.lo \ collection.lo common.lo comments.lo contacts.lo context.lo \ config.lo exif.lo gallery.lo group.lo institution.lo md5.lo \ @@ -140,10 +135,11 @@ photos-upload-api.lo photosets-api.lo \ photosets-comments-api.lo places-api.lo prefs-api.lo \ reflection-api.lo stats-api.lo tags-api.lo test-api.lo \ - upload-api.lo urls-api.lo $(am__objects_1) + upload-api.lo urls-api.lo sha1.lo legacy-auth.lo oauth.lo \ + mt.lo seed.lo libflickcurl_la_OBJECTS = $(am_libflickcurl_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent libflickcurl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ @@ -159,24 +155,29 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libflickcurl_la_SOURCES) -DIST_SOURCES = $(am__libflickcurl_la_SOURCES_DIST) +DIST_SOURCES = $(libflickcurl_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags @@ -196,6 +197,7 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -259,12 +261,14 @@ RAPTOR_CFLAGS = @RAPTOR_CFLAGS@ RAPTOR_LIBS = @RAPTOR_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ +RECHO = @RECHO@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STANDARD_CFLAGS = @STANDARD_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -319,27 +323,99 @@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libflickcurl.la include_HEADERS = flickcurl.h -libflickcurl_la_SOURCES = activity.c args.c blog.c category.c \ - collection.c common.c comments.c contacts.c context.c config.c \ - exif.c gallery.c group.c institution.c md5.c location.c \ - machinetags.c members.c method.c note.c person.c photo.c \ - photoset.c place.c serializer.c shape.c size.c stat.c ticket.c \ - user_upload_status.c tags.c video.c vsnprintf.c activity-api.c \ - auth-api.c blogs-api.c commons-api.c collections-api.c \ - contacts-api.c favorites-api.c interestingness-api.c \ - galleries-api.c groups-api.c groups-members-api.c \ - groups-pools-api.c machinetags-api.c people-api.c perms.c \ - panda-api.c photos-api.c photos-comments-api.c \ - photos-geo-api.c photos-licenses-api.c photos-notes-api.c \ - photos-people-api.c photos-transform-api.c photos-upload-api.c \ - photosets-api.c photosets-comments-api.c places-api.c \ - prefs-api.c reflection-api.c stats-api.c tags-api.c test-api.c \ - upload-api.c urls-api.c flickcurl_internal.h $(am__append_3) -AM_CFLAGS = $(am__append_1) $(am__append_4) +libflickcurl_la_SOURCES = \ +activity.c \ +args.c \ +blog.c \ +category.c \ +collection.c \ +common.c \ +comments.c \ +contacts.c \ +context.c \ +config.c \ +exif.c \ +gallery.c \ +group.c \ +institution.c \ +md5.c \ +location.c \ +machinetags.c \ +members.c \ +method.c \ +note.c \ +person.c \ +photo.c \ +photoset.c \ +place.c \ +serializer.c \ +shape.c \ +size.c \ +stat.c \ +ticket.c \ +user_upload_status.c \ +tags.c \ +video.c \ +vsnprintf.c \ +activity-api.c \ +auth-api.c \ +blogs-api.c \ +commons-api.c \ +collections-api.c \ +contacts-api.c \ +favorites-api.c \ +interestingness-api.c \ +galleries-api.c \ +groups-api.c \ +groups-members-api.c \ +groups-pools-api.c \ +machinetags-api.c \ +people-api.c \ +perms.c \ +panda-api.c \ +photos-api.c \ +photos-comments-api.c \ +photos-geo-api.c \ +photos-licenses-api.c \ +photos-notes-api.c \ +photos-people-api.c \ +photos-transform-api.c \ +photos-upload-api.c \ +photosets-api.c \ +photosets-comments-api.c \ +places-api.c \ +prefs-api.c \ +reflection-api.c \ +stats-api.c \ +tags-api.c \ +test-api.c \ +upload-api.c \ +urls-api.c \ +flickcurl_internal.h \ +sha1.c \ +legacy-auth.c \ +oauth.c \ +$(top_srcdir)/libmtwist/mt.c \ +$(top_srcdir)/libmtwist/seed.c \ +$(top_srcdir)/libmtwist/mtwist.h \ +$(top_srcdir)/libmtwist/mtwist_internal.h \ +mtwist_config.h + +AM_CFLAGS = -DMTWIST_CONFIG -I$(top_srcdir)/libmtwist $(am__append_1) libflickcurl_la_LIBADD = $(am__append_2) libflickcurl_la_LDFLAGS = -version-info @LIBFLICKCURL_LIBTOOL_VERSION@ -TESTS = $(am__append_5) -CLEANFILES = $(TESTS) +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + +TESTS = flickcurl_oauth_test +CLEANFILES = $(TESTS) \ +*.plist + all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -377,10 +453,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -394,7 +468,6 @@ -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -402,6 +475,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -423,7 +498,7 @@ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libflickcurl.la: $(libflickcurl_la_OBJECTS) $(libflickcurl_la_DEPENDENCIES) +libflickcurl.la: $(libflickcurl_la_OBJECTS) $(libflickcurl_la_DEPENDENCIES) $(EXTRA_libflickcurl_la_DEPENDENCIES) $(AM_V_CCLD)$(libflickcurl_la_LINK) -rpath $(libdir) $(libflickcurl_la_OBJECTS) $(libflickcurl_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -458,6 +533,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groups-pools-api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/institution.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interestingness-api.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy-auth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/location.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machinetags-api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machinetags.Plo@am__quote@ @@ -507,42 +583,37 @@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mt.lo: $(top_srcdir)/libmtwist/mt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mt.lo -MD -MP -MF $(DEPDIR)/mt.Tpo -c -o mt.lo `test -f '$(top_srcdir)/libmtwist/mt.c' || echo '$(srcdir)/'`$(top_srcdir)/libmtwist/mt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mt.Tpo $(DEPDIR)/mt.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/libmtwist/mt.c' object='mt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/libmtwist/mt.c' object='mt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mt.lo `test -f '$(top_srcdir)/libmtwist/mt.c' || echo '$(srcdir)/'`$(top_srcdir)/libmtwist/mt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mt.lo `test -f '$(top_srcdir)/libmtwist/mt.c' || echo '$(srcdir)/'`$(top_srcdir)/libmtwist/mt.c seed.lo: $(top_srcdir)/libmtwist/seed.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seed.lo -MD -MP -MF $(DEPDIR)/seed.Tpo -c -o seed.lo `test -f '$(top_srcdir)/libmtwist/seed.c' || echo '$(srcdir)/'`$(top_srcdir)/libmtwist/seed.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/seed.Tpo $(DEPDIR)/seed.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/libmtwist/seed.c' object='seed.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/libmtwist/seed.c' object='seed.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seed.lo `test -f '$(top_srcdir)/libmtwist/seed.c' || echo '$(srcdir)/'`$(top_srcdir)/libmtwist/seed.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seed.lo `test -f '$(top_srcdir)/libmtwist/seed.c' || echo '$(srcdir)/'`$(top_srcdir)/libmtwist/seed.c mostlyclean-libtool: -rm -f *.lo @@ -551,8 +622,11 @@ -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -566,9 +640,7 @@ @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -703,14 +775,15 @@ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ - echo "$$grn$$dashes"; \ + col="$$grn"; \ else \ - echo "$$red$$dashes"; \ + col="$$red"; \ fi; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes$$std"; \ + echo "$${col}$$dashes$${std}"; \ + echo "$${col}$$banner$${std}"; \ + test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ + test -z "$$report" || echo "$${col}$$report$${std}"; \ + echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi @@ -762,10 +835,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -868,8 +946,24 @@ uninstall-libLTLIBRARIES -@FLICKCURL_OAUTH_TRUE@flickcurl_oauth_test: $(srcdir)/oauth.c libflickcurl.la -@FLICKCURL_OAUTH_TRUE@ $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/oauth.c libflickcurl.la $(LIBS) +flickcurl_oauth_test: $(srcdir)/oauth.c libflickcurl.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/oauth.c libflickcurl.la $(LIBS) + +# Run Clang static analyzer over sources. +@MAINTAINER_MODE_TRUE@analyze: $(SOURCES) +@MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \ +@MAINTAINER_MODE_TRUE@ result=0; \ +@MAINTAINER_MODE_TRUE@ for file in $$list; do \ +@MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \ +@MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ +@MAINTAINER_MODE_TRUE@ status=$$?; \ +@MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ +@MAINTAINER_MODE_TRUE@ result=1; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ done; \ +@MAINTAINER_MODE_TRUE@ set -e; exit $$result # 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. diff -Nru flickcurl-1.22/src/activity-api.c flickcurl-1.24/src/activity-api.c --- flickcurl-1.22/src/activity-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/activity-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * activity-api.c - Flickr flickr.activity.* API calls * - * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -57,28 +57,26 @@ flickcurl_activity** flickcurl_activity_userComments(flickcurl* fc, int per_page, int page) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_activity** activities = NULL; char page_str[10]; char per_page_str[10]; + flickcurl_init_params(fc); + if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_str; + flickcurl_add_param(fc, "page", page_str); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.activity.userComments", parameters, count)) + if(flickcurl_prepare(fc, "flickr.activity.userComments")) goto tidy; doc = flickcurl_invoke(fc); @@ -124,32 +122,29 @@ flickcurl_activity_userPhotos(flickcurl* fc, const char* timeframe, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_activity** activities = NULL; char page_str[10]; char per_page_str[10]; + flickcurl_init_params(fc); + if(timeframe) { - parameters[count][0] = "timeframe"; - parameters[count++][1]= timeframe; + flickcurl_add_param(fc, "timeframe", timeframe); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_str; + flickcurl_add_param(fc, "page", page_str); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.activity.userPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.activity.userPhotos")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/activity.c flickcurl-1.24/src/activity.c --- flickcurl-1.22/src/activity.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/activity.c 2012-08-29 02:58:29.000000000 +0000 @@ -112,11 +112,12 @@ return NULL; for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "type")) ae->type = attr_value; @@ -136,8 +137,9 @@ /* Walk children nodes for value text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - ae->value = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(ae->value, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + ae->value = (char*)malloc(len + 1); + memcpy(ae->value, chnode->content, len + 1); break; } } @@ -186,11 +188,12 @@ a = (flickcurl_activity*)calloc(sizeof(flickcurl_activity), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "type")) a->type = attr_value; @@ -247,8 +250,9 @@ const char *chnode_name = (const char*)chnode->name; if(chnode->type == XML_ELEMENT_NODE) { if(!strcmp(chnode_name, "title")) { - a->title = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(a->title, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + a->title = (char*)malloc(len + 1); + memcpy(a->title, chnode->children->content, len + 1); } else if(!strcmp(chnode_name, "activity")) { xmlNodePtr chnode2; for(chnode2 = chnode->children; chnode2; chnode2 = chnode2->next) { diff -Nru flickcurl-1.22/src/args.c flickcurl-1.24/src/args.c --- flickcurl-1.22/src/args.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/args.c 2012-08-29 03:42:02.000000000 +0000 @@ -90,8 +90,9 @@ for(attr = node->properties; attr; attr = attr->next) { const char *attr_name = (const char*)attr->name; if(!strcmp(attr_name, "name")) { - arg->name = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(arg->name, (const char*)attr->children->content); + size_t len = strlen((const char*)attr->children->content); + arg->name = (char*)malloc(len + 1); + memcpy(arg->name, attr->children->content, len + 1); } else if(!strcmp(attr_name, "optional")) arg->optional = atoi((const char*)attr->children->content); } @@ -99,8 +100,9 @@ /* Walk children nodes for description text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - arg->description = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(arg->description, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + arg->description = (char*)malloc(len + 1); + memcpy(arg->description, (const char*)chnode->content, len + 1); break; } } diff -Nru flickcurl-1.22/src/auth-api.c flickcurl-1.24/src/auth-api.c --- flickcurl-1.22/src/auth-api.c 2011-10-30 02:35:57.000000000 +0000 +++ flickcurl-1.24/src/auth-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * auth-api.c - Flickr flickr.auth.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -59,23 +59,22 @@ char* flickcurl_auth_checkToken(flickcurl* fc, const char* token) { - const char * parameters[6][2]; - int count = 0; char *perms = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; + flickcurl_init_params(fc); + if(!token) return NULL; - parameters[count][0] = "auth_token"; - parameters[count++][1] = (char*)token; + flickcurl_add_param(fc, "auth_token", (char*)token); - parameters[count][0] = NULL; + flickcurl_end_params(fc); flickcurl_set_sign(fc); - if(flickcurl_prepare(fc, "flickr.auth.checkToken", parameters, count)) + if(flickcurl_prepare(fc, "flickr.auth.checkToken")) goto tidy; doc = flickcurl_invoke(fc); @@ -109,17 +108,17 @@ char* flickcurl_auth_getFrob(flickcurl* fc) { - const char * parameters[5][2]; - int count = 0; char *frob = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); flickcurl_set_sign(fc); - if(flickcurl_prepare(fc, "flickr.auth.getFrob", parameters, count)) + if(flickcurl_prepare(fc, "flickr.auth.getFrob")) goto tidy; doc = flickcurl_invoke(fc); @@ -153,20 +152,19 @@ char* flickcurl_auth_getFullToken(flickcurl* fc, const char* frob) { - const char * parameters[6][2]; - int count = 0; char *auth_token = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; - parameters[count][0] = "mini_token"; - parameters[count++][1] = (char*)frob; + flickcurl_init_params(fc); - parameters[count][0] = NULL; + flickcurl_add_param(fc, "mini_token", (char*)frob); + + flickcurl_end_params(fc); flickcurl_set_sign(fc); - if(flickcurl_prepare(fc, "flickr.auth.getFullToken", parameters, count)) + if(flickcurl_prepare(fc, "flickr.auth.getFullToken")) goto tidy; doc = flickcurl_invoke(fc); @@ -201,20 +199,19 @@ char* flickcurl_auth_getToken(flickcurl* fc, const char* frob) { - const char * parameters[6][2]; - int count = 0; char *auth_token = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; - parameters[count][0] = "frob"; - parameters[count++][1] = (char*)frob; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "frob", (char*)frob); - parameters[count][0] = NULL; + flickcurl_end_params(fc); flickcurl_set_sign(fc); - if(flickcurl_prepare(fc, "flickr.auth.getToken", parameters, count)) + if(flickcurl_prepare(fc, "flickr.auth.getToken")) goto tidy; doc = flickcurl_invoke(fc); @@ -238,29 +235,34 @@ * flickcurl_auth_oauth_getAccessToken: * @fc: flickcurl context * - * Exchange an auth token from the old Authentication API for an OAuth access token. + * Exchange tokens from the legacy Flickr auth to ones for OAuth * - * Calling this method will delete the old auth token used to make the request. + * Calling this method will delete the legacy auth tokens used to + * make the request since they will expire within 24 hours of this + * call. * - * Implements flickr.auth.oauth.getAccessToken (1.22) + * The OAuth token and secret should be saved and can be read from + * flickcurl_get_oauth_token() and flickcurl_get_oauth_token_secret() + * + * Implements flickr.auth.oauth.getAccessToken (1.23) * * Return value: non-0 on failure **/ int flickcurl_auth_oauth_getAccessToken(flickcurl* fc) { - const char* parameters[5][2]; - int count = 0; + flickcurl_oauth_data* od = &fc->od; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int rc = 0; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); flickcurl_set_sign(fc); - if(flickcurl_prepare(fc, "flickr.auth.oauth.getAccessToken", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.auth.oauth.getAccessToken")) goto tidy; doc = flickcurl_invoke(fc); @@ -275,56 +277,38 @@ goto tidy; } - /* - - - - */ - if(xpathCtx) { char* auth_token; char* auth_token_secret; -/* - if(fc->api_key) { - FIXME - Copy API key as OAuth consumer key - - od->client_key = fc->api_key; - od->client_key_len = strlen(od->consumer_key); - } -*/ - auth_token = flickcurl_xpath_eval(fc, xpathCtx, - (const xmlChar*)"/rsp/auth/access_token[@oauth_token]"); + (const xmlChar*)"/rsp/auth/access_token[@oauth_token]"); auth_token_secret = flickcurl_xpath_eval(fc, xpathCtx, (const xmlChar*)"/rsp/auth/access_token[@oauth_token_secret]"); #ifdef FLICKCURL_DEBUG - fprintf(stderr, - "Exchanged old auth for OAuth access token '%s' secret token '%s'\n", + fprintf(stderr, + "Exchanged legacy auth tokens for OAuth access token '%s' secret token '%s'\n", auth_token, auth_token_secret); #endif - /* FIXME - story this in the oauth structure */ + /* Old shared secret becomes OAuth client_secret (paired with client_key) */ + od->client_secret = fc->secret; + fc->secret = NULL; - free(auth_token); - free(auth_token_secret); - - /* Remove old authentication fields - not valid or needed */ + /* Remove legacy Flickr auth token - not valid or needed */ if(fc->auth_token) { free(fc->auth_token); fc->auth_token = NULL; } - if(fc->api_key) { - free(fc->api_key); - fc->api_key = NULL; - } - if(fc->secret) { - free(fc->secret); - fc->secret = NULL; - } - + + /* Store OAuth token and token secret in the oauth structure */ + od->token = auth_token; + od->token_len = strlen(auth_token); + od->token_secret = auth_token_secret; + od->token_secret_len = strlen(auth_token_secret); + xmlXPathFreeContext(xpathCtx); xpathCtx = NULL; } diff -Nru flickcurl-1.22/src/blog.c flickcurl-1.24/src/blog.c --- flickcurl-1.22/src/blog.c 2010-03-04 06:05:59.000000000 +0000 +++ flickcurl-1.24/src/blog.c 2012-08-29 02:58:29.000000000 +0000 @@ -107,11 +107,12 @@ b = (flickcurl_blog*)calloc(sizeof(flickcurl_blog), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) b->id = attr_value; @@ -122,6 +123,8 @@ free(attr_value); } else if(!strcmp(attr_name, "url")) b->url = attr_value; + else + free(attr_value); } /* end attributes */ @@ -220,20 +223,24 @@ b = (flickcurl_blog_service*)calloc(sizeof(flickcurl_blog_service), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) b->id = attr_value; + else + free(attr_value); } /* end attributes */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - b->name = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(b->name, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + b->name = (char*)malloc(len + 1); + memcpy(b->name, chnode->content, len + 1); } } diff -Nru flickcurl-1.22/src/blogs-api.c flickcurl-1.24/src/blogs-api.c --- flickcurl-1.22/src/blogs-api.c 2010-03-04 06:05:59.000000000 +0000 +++ flickcurl-1.24/src/blogs-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * blogs-api.c - Flickr flickr.blogs.* API calls * - * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -55,15 +55,15 @@ flickcurl_blog** flickcurl_blogs_getList(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_blog** blogs = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.blogs.getList", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.blogs.getList")) goto tidy; doc = flickcurl_invoke(fc); @@ -102,15 +102,15 @@ flickcurl_blog_service** flickcurl_blogs_getServices(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_blog_service **services = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.blogs.getServices", parameters, count)) + if(flickcurl_prepare(fc, "flickr.blogs.getServices")) goto tidy; doc = flickcurl_invoke(fc); @@ -159,30 +159,25 @@ const char* photo_id, const char* title, const char* description, const char* blog_password) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; + flickcurl_init_params(fc); + if(!blog_id || !photo_id || !title || !description) return 1; - parameters[count][0] = "blog_id"; - parameters[count++][1]= blog_id; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "title"; - parameters[count++][1]= title; - parameters[count][0] = "description"; - parameters[count++][1]= description; + flickcurl_add_param(fc, "blog_id", blog_id); + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "title", title); + flickcurl_add_param(fc, "description", description); if(blog_password) { - parameters[count][0] = "blog_password"; - parameters[count++][1]= blog_password; + flickcurl_add_param(fc, "blog_password", blog_password); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.blogs.postPhoto", parameters, count)) + if(flickcurl_prepare(fc, "flickr.blogs.postPhoto")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/category.c flickcurl-1.24/src/category.c --- flickcurl-1.22/src/category.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/category.c 2012-08-29 02:58:29.000000000 +0000 @@ -119,11 +119,12 @@ c = (flickcurl_category*)calloc(sizeof(flickcurl_category), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) c->id = attr_value; @@ -135,6 +136,8 @@ c->count = atoi(attr_value); free(attr_value); } + else + free(attr_value); } #if FLICKCURL_DEBUG > 1 diff -Nru flickcurl-1.22/src/collection.c flickcurl-1.24/src/collection.c --- flickcurl-1.22/src/collection.c 2010-05-10 03:12:12.000000000 +0000 +++ flickcurl-1.24/src/collection.c 2012-08-29 05:15:21.000000000 +0000 @@ -2,7 +2,7 @@ * * collection.c - Flickcurl collection functions * - * Copyright (C) 2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2009-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -181,7 +181,7 @@ int i; xpathExpr_len = strlen((const char*)xpathExpr); - strncpy((char*)full_xpath, (const char*)xpathExpr, xpathExpr_len+1); + memcpy(full_xpath, xpathExpr, xpathExpr_len + 1); xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); if(!xpathObj) { @@ -319,8 +319,11 @@ break; } - if(fc->failed) + if(fc->failed) { + if(collection) + flickcurl_free_collection(collection); goto tidy; + } } #if FLICKCURL_DEBUG > 1 @@ -344,8 +347,11 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); - if(fc->failed) + if(fc->failed) { + if(collections) + flickcurl_free_collections(collections); collections = NULL; + } return collections; } diff -Nru flickcurl-1.22/src/collections-api.c flickcurl-1.24/src/collections-api.c --- flickcurl-1.22/src/collections-api.c 2009-06-04 20:03:26.000000000 +0000 +++ flickcurl-1.24/src/collections-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * collections-api.c - Flickr flickr.collections.* API calls * - * Copyright (C) 2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2009-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -53,21 +53,20 @@ flickcurl_collection* flickcurl_collections_getInfo(flickcurl* fc, const char* collection_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_collection* collection = NULL; + flickcurl_init_params(fc); + if(!collection_id) return NULL; - parameters[count][0] = "collection_id"; - parameters[count++][1]= collection_id; + flickcurl_add_param(fc, "collection_id", collection_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.collections.getInfo", parameters, count)) + if(flickcurl_prepare(fc, "flickr.collections.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -112,24 +111,22 @@ flickcurl_collections_getTree(flickcurl* fc, const char* collection_id, const char* user_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_collection* collection = NULL; + flickcurl_init_params(fc); + if(collection_id) { - parameters[count][0] = "collection_id"; - parameters[count++][1]= collection_id; + flickcurl_add_param(fc, "collection_id", collection_id); } if(user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.collections.getTree", parameters, count)) + if(flickcurl_prepare(fc, "flickr.collections.getTree")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/comments.c flickcurl-1.24/src/comments.c --- flickcurl-1.22/src/comments.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/comments.c 2012-08-29 02:58:29.000000000 +0000 @@ -121,11 +121,12 @@ comment_object = (flickcurl_comment*)calloc(sizeof(flickcurl_comment), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) comment_object->id = attr_value; @@ -145,8 +146,9 @@ /* Walk children nodes for comment text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - comment_object->text = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(comment_object->text, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + comment_object->text = (char*)malloc(len + 1); + memcpy(comment_object->text, chnode->content, len +1); break; } } diff -Nru flickcurl-1.22/src/common.c flickcurl-1.24/src/common.c --- flickcurl-1.22/src/common.c 2011-11-12 06:21:04.000000000 +0000 +++ flickcurl-1.24/src/common.c 2013-04-07 23:54:00.000000000 +0000 @@ -2,7 +2,7 @@ * * common.c - Flickcurl common functions * - * Copyright (C) 2007-2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -63,9 +63,9 @@ #include -const char* const flickcurl_short_copyright_string = "Copyright 2007-2011 David Beckett."; +const char* const flickcurl_short_copyright_string = "Copyright 2007-2012 David Beckett."; -const char* const flickcurl_copyright_string = "Copyright (C) 2007-2011 David Beckett - http://www.dajobe.org/"; +const char* const flickcurl_copyright_string = "Copyright (C) 2007-2012 David Beckett - http://www.dajobe.org/"; const char* const flickcurl_license_string = "LGPL 2.1 or newer, GPL 2 or newer, Apache 2.0 or newer.\nSee http://librdf.org/flickcurl/ for full terms."; @@ -204,28 +204,41 @@ flickcurl_new_with_handle(void* curl_handle) { flickcurl* fc; - + size_t len; + fc = (flickcurl*)calloc(1, sizeof(flickcurl)); if(!fc) return NULL; - fc->service_uri = strdup(flickcurl_flickr_service_uri); - fc->upload_service_uri = strdup(flickcurl_flickr_upload_service_uri); - fc->replace_service_uri = strdup(flickcurl_flickr_replace_service_uri); - fc->oauth_request_token_uri = strdup(flickcurl_flickr_oauth_request_token_uri); - fc->oauth_access_token_uri = strdup(flickcurl_flickr_oauth_access_token_uri); + len = strlen(flickcurl_flickr_service_uri); + fc->service_uri = (char*)malloc(len + 1); + memcpy(fc->service_uri, flickcurl_flickr_service_uri, len + 1); + + len = strlen(flickcurl_flickr_upload_service_uri); + fc->upload_service_uri = (char*)malloc(len + 1); + memcpy(fc->upload_service_uri, flickcurl_flickr_upload_service_uri, len +1); + + len = strlen(flickcurl_flickr_replace_service_uri); + fc->replace_service_uri = (char*)malloc(len + 1); + memcpy(fc->replace_service_uri, flickcurl_flickr_replace_service_uri, len +1); + + len = strlen(flickcurl_flickr_oauth_request_token_uri); + fc->oauth_request_token_uri = (char*)malloc(len + 1); + memcpy(fc->oauth_request_token_uri, flickcurl_flickr_oauth_request_token_uri, len +1); + + len = strlen(flickcurl_flickr_oauth_access_token_uri); + fc->oauth_access_token_uri = (char*)malloc(len + 1); + memcpy(fc->oauth_access_token_uri, flickcurl_flickr_oauth_access_token_uri, len +1); /* DEFAULT delay between requests is 1000ms i.e 1 request/second max */ fc->request_delay = 1000; -#ifdef FLICKCURL_OAUTH fc->mt = mtwist_new(); if(!fc->mt) { free(fc); return NULL; } mtwist_init(fc->mt, mtwist_seed_from_system(fc->mt)); -#endif fc->curl_handle = (CURL*)curl_handle; if(!fc->curl_handle) { @@ -288,8 +301,6 @@ xmlFreeParserCtxt(fc->xc); } - if(fc->api_key) - free(fc->api_key); if(fc->secret) free(fc->secret); if(fc->auth_token) @@ -360,12 +371,10 @@ if(fc->uri) free(fc->uri); -#ifdef FLICKCURL_OAUTH if(fc->mt) mtwist_free(fc->mt); flickcurl_oauth_free(&fc->od); -#endif free(fc); } @@ -448,10 +457,12 @@ void flickcurl_set_user_agent(flickcurl* fc, const char *user_agent) { - char *ua_copy = (char*)malloc(strlen(user_agent)+1); + size_t len = strlen(user_agent); + char *ua_copy = (char*)malloc(len + 1); if(!ua_copy) return; - strcpy(ua_copy, user_agent); + + memcpy(ua_copy, user_agent, len + 1); fc->user_agent = ua_copy; } @@ -467,10 +478,12 @@ void flickcurl_set_proxy(flickcurl* fc, const char *proxy) { - char *proxy_copy = (char*)malloc(strlen(proxy)+1); + size_t len = strlen(proxy); + char *proxy_copy = (char*)malloc(len + 1); if(!proxy_copy) return; - strcpy(proxy_copy, proxy); + + memcpy(proxy_copy, proxy, len + 1); fc->proxy = proxy_copy; } @@ -487,21 +500,22 @@ flickcurl_set_http_accept(flickcurl* fc, const char *value) { char *value_copy; - size_t len = 8; /* strlen("Accept:")+1 */ + size_t len = 7; /* strlen("Accept:") */ if(value) - len += 1+strlen(value); /* " "+value */ + len += 1 + strlen(value); /* " "+value */ - value_copy = (char*)malloc(len); + value_copy = (char*)malloc(len + 1); if(!value_copy) return; + fc->http_accept = value_copy; - strcpy(value_copy, "Accept:"); + memcpy(value_copy, "Accept:", 8); /* copy NUL */ value_copy += 7; if(value) { *value_copy++ = ' '; - strcpy(value_copy, value); + memcpy(value_copy, value, (len - 8) + 1); } } @@ -519,15 +533,20 @@ void flickcurl_set_service_uri(flickcurl *fc, const char *uri) { + size_t len; + if(!uri) uri = flickcurl_flickr_service_uri; #if FLICKCURL_DEBUG > 1 - fprintf(stderr, "Service URI set to: '%s'\n", uri); + fprintf(stderr, "Service URI set to: '%s'\n", uri); #endif - if(fc->service_uri) - free(fc->service_uri); - fc->service_uri = strdup(uri); + if(fc->service_uri) + free(fc->service_uri); + + len = strlen(uri); + fc->service_uri = (char*)malloc(len + 1); + memcpy(fc->service_uri, uri, len + 1); } @@ -544,6 +563,8 @@ void flickcurl_set_upload_service_uri(flickcurl *fc, const char *uri) { + size_t len; + if(!uri) uri = flickcurl_flickr_upload_service_uri; @@ -552,7 +573,10 @@ #endif if(fc->upload_service_uri) free(fc->upload_service_uri); - fc->upload_service_uri = strdup(uri); + + len = strlen(uri); + fc->upload_service_uri = (char*)malloc(len + 1); + memcpy(fc->upload_service_uri, uri, len + 1); } @@ -569,6 +593,8 @@ void flickcurl_set_replace_service_uri(flickcurl *fc, const char *uri) { + size_t len; + if(!uri) uri = flickcurl_flickr_replace_service_uri; @@ -577,7 +603,10 @@ #endif if(fc->replace_service_uri) free(fc->replace_service_uri); - fc->replace_service_uri = strdup(uri); + + len = strlen(uri); + fc->replace_service_uri = (char*)malloc(len + 1); + memcpy(fc->replace_service_uri, uri, len + 1); } @@ -586,17 +615,33 @@ * @fc: flickcurl object * @api_key: API Key * - * Set application API Key for flickcurl requests + * Set legacy Flickr auth application API Key (OAuth Client key) + * + * For OAuth this is not sufficient and + * flickcurl_set_oauth_client_key() and + * flickcurl_set_oauth_client_secret() be used + * to pass both the client key and client secret. */ void flickcurl_set_api_key(flickcurl* fc, const char *api_key) { + size_t len; + #if FLICKCURL_DEBUG > 1 fprintf(stderr, "API Key: '%s'\n", api_key); #endif - if(fc->api_key) - free(fc->api_key); - fc->api_key = strdup(api_key); + if(fc->od.client_key) + free(fc->od.client_key); + + len = strlen(api_key); + fc->od.client_key = (char*)malloc(len + 1); + memcpy(fc->od.client_key, api_key, len + 1); + fc->od.client_key_len = len; + + /* Mainly for flickcurl_auth_oauth_getAccessToken() to sign the call + * exchanging tokens + */ + fc->api_key = fc->od.client_key; } @@ -604,7 +649,7 @@ * flickcurl_get_api_key: * @fc: flickcurl object * - * Get current application API Key + * Get current application API Key (OAuth Client key) * * Return value: API key or NULL if none set */ @@ -620,17 +665,21 @@ * @fc: flickcurl object * @secret: shared secret * - * Set Shared Secret for flickcurl requests + * Set legacy Flickr auth secret */ void flickcurl_set_shared_secret(flickcurl* fc, const char *secret) { + size_t len; + #if FLICKCURL_DEBUG > 1 - fprintf(stderr, "Secret: '%s'\n", secret); + fprintf(stderr, "Legacy Flickr auth Secret: '%s'\n", secret); #endif if(fc->secret) free(fc->secret); - fc->secret = strdup(secret); + len = strlen(secret); + fc->secret = (char*)malloc(len + 1); + memcpy(fc->secret, secret, len + 1); } @@ -638,7 +687,7 @@ * flickcurl_get_shared_secret: * @fc: flickcurl object * - * Get current Shared Secret + * Get legacy Flickr auth Secret * * Return value: shared secret or NULL if none set */ @@ -654,17 +703,22 @@ * @fc: flickcurl object * @auth_token: auth token * - * Set Auth Token for flickcurl requests + * Set legacy Flickr auth Token */ void flickcurl_set_auth_token(flickcurl *fc, const char* auth_token) { + size_t len; + #if FLICKCURL_DEBUG > 1 - fprintf(stderr, "Auth token: '%s'\n", auth_token); + fprintf(stderr, "Legacy Flickr auth token: '%s'\n", auth_token); #endif if(fc->auth_token) free(fc->auth_token); - fc->auth_token = strdup(auth_token); + + len = strlen(auth_token); + fc->auth_token = (char*)malloc(len + 1); + memcpy(fc->auth_token, auth_token, len + 1); } @@ -672,7 +726,7 @@ * flickcurl_get_auth_token: * @fc: flickcurl object * - * Get current auth token + * Get legacy Flickr auth Token * * Return value: auth token or NULL if none set */ @@ -711,17 +765,35 @@ } -static int -compare_args(const void *a, const void *b) +/* + * INTERNAL: initialise parameter array + */ +void +flickcurl_init_params(flickcurl *fc) { - return strcmp(*(char**)a, *(char**)b); + fc->count = 0; + fc->parameters[fc->count][0] = NULL; } -static void -flickcurl_sort_args(flickcurl *fc, const char *parameters[][2], int count) +/* + * INTERNAL: add a new (key, value) to array of parameters + */ +void +flickcurl_add_param(flickcurl *fc, const char* key, const char* value) { - qsort((void*)parameters, count, sizeof(char*[2]), compare_args); + fc->parameters[fc->count][0] = key; + fc->parameters[fc->count][1] = value; + fc->count++; +} + +/* + * INTERNAL: finish parameters + */ +void +flickcurl_end_params(flickcurl *fc) +{ + fc->parameters[fc->count][0] = NULL; } @@ -729,228 +801,32 @@ flickcurl_prepare_common(flickcurl *fc, const char* url, const char* method, - const char* upload_field, const char* upload_value, - const char* parameters[][2], int count, + const char* upload_field, + const char* upload_value, int parameters_in_url, int need_auth) { - int i; - char *md5_string = NULL; - size_t* values_len = NULL; - unsigned int fc_uri_len = 0; - - if(!url || !parameters) - return 1; - - /* If one is given, both are required */ - if((upload_field || upload_value) && (!upload_field || !upload_value)) - return 1; - - fc->failed = 0; - fc->error_code = 0; - if(fc->error_msg) { - free(fc->error_msg); - fc->error_msg = NULL; - } - /* Default to read */ - fc->is_write = 0; - /* Default to no data */ - if(fc->data) { - if(fc->data_is_xml) - xmlFree(fc->data); - fc->data = NULL; - fc->data_length = 0; - fc->data_is_xml = 0; - } - if(fc->param_fields) { - for(i = 0; fc->param_fields[i]; i++) { - free(fc->param_fields[i]); - free(fc->param_values[i]); - } - free(fc->param_fields); - free(fc->param_values); - fc->param_fields = NULL; - fc->param_values = NULL; - fc->parameter_count = 0; - } - if(fc->upload_field) { - free(fc->upload_field); - fc->upload_field = NULL; - } - if(fc->upload_value) { - free(fc->upload_value); - fc->upload_value = NULL; - } - - if(!fc->secret) { - flickcurl_error(fc, "No shared secret"); - return 1; - } - if(!fc->api_key) { - flickcurl_error(fc, "No API key"); - return 1; - } + int rc = 1; - - if(fc->method) - free(fc->method); - if(method) - fc->method = strdup(method); + if(fc->api_key && fc->secret) + /* Call with legacy Flickr auth */ + rc = flickcurl_legacy_prepare_common(fc, url, method, + upload_field, upload_value, + parameters_in_url, need_auth); + else if(fc->od.token && fc->od.token_secret) + /* Call with OAuth */ + rc = flickcurl_oauth_prepare_common(fc, url, method, + upload_field, upload_value, + parameters_in_url, need_auth); else - fc->method = NULL; - - if(fc->method) { - parameters[count][0] = "method"; - parameters[count++][1]= fc->method; - } - - parameters[count][0] = "api_key"; - parameters[count++][1]= fc->api_key; - - if(need_auth && fc->auth_token) { - parameters[count][0] = "auth_token"; - parameters[count++][1]= fc->auth_token; - } - - parameters[count][0] = NULL; - - /* +1 for api_sig +1 for NULL terminating pointer */ - fc->param_fields = (char**)calloc(count+2, sizeof(char*)); - fc->param_values = (char**)calloc(count+2, sizeof(char*)); - values_len = (size_t*)calloc(count+2, sizeof(size_t)); - - if((need_auth && fc->auth_token) || fc->sign) - flickcurl_sort_args(fc, parameters, count); - - fc_uri_len = strlen(url); - - /* Save away the parameters and calculate the value lengths */ - for(i = 0; parameters[i][0]; i++) { - size_t param_len = strlen(parameters[i][0]); - - if(parameters[i][1]) - values_len[i] = strlen(parameters[i][1]); - else { - values_len[i] = 0; - parameters[i][1] = ""; - } - fc->param_fields[i] = (char*)malloc(param_len+1); - strcpy(fc->param_fields[i], parameters[i][0]); - fc->param_values[i] = (char*)malloc(values_len[i]+1); - strcpy(fc->param_values[i], parameters[i][1]); - - /* 3x value len is conservative URI %XX escaping on every char */ - fc_uri_len += param_len + 1 /* = */ + 3 * values_len[i]; - } - - if(upload_field) { - fc->upload_field = (char*)malloc(strlen(upload_field)+1); - strcpy(fc->upload_field, upload_field); - - fc->upload_value = (char*)malloc(strlen(upload_value)+1); - strcpy(fc->upload_value, upload_value); - } - - if((need_auth && fc->auth_token) || fc->sign) { - size_t buf_len = 0; - char *buf; - - buf_len = strlen(fc->secret); - for(i = 0; parameters[i][0]; i++) - buf_len += strlen(parameters[i][0]) + values_len[i]; - - buf = (char*)malloc(buf_len+1); - strcpy(buf, fc->secret); - for(i = 0; parameters[i][0]; i++) { - strcat(buf, parameters[i][0]); - strcat(buf, parameters[i][1]); - } - -#ifdef FLICKCURL_DEBUG - fprintf(stderr, "MD5 Buffer '%s'\n", buf); -#endif - md5_string = MD5_string(buf); - - parameters[count][0] = "api_sig"; - parameters[count][1]= md5_string; + flickcurl_error(fc, "No legacy or OAuth authentication tokens or secrets"); - /* Add a new parameter pair */ - values_len[count] = 32; /* MD5 is always 32 */ - fc->param_fields[count] = (char*)malloc(7+1); /* 7 = strlen(api_sig) */ - strcpy(fc->param_fields[count], parameters[count][0]); - fc->param_values[count] = (char*)malloc(32+1); /* 32 = MD5 */ - strcpy(fc->param_values[count], parameters[count][1]); - - fc_uri_len += 7 /* "api_sig" */ + 1 /* = */ + 32 /* MD5 value: never escaped */; - - count++; - -#ifdef FLICKCURL_DEBUG - fprintf(stderr, "Signature: '%s'\n", parameters[count-1][1]); -#endif - - free(buf); - - parameters[count][0] = NULL; - } - - /* add &s between parameters */ - fc_uri_len += count-1; - - /* reuse or grow uri buffer */ - if(fc->uri_len < fc_uri_len) { - free(fc->uri); - fc->uri = (char*)malloc(fc_uri_len+1); - fc->uri_len = fc_uri_len; - } - strcpy(fc->uri, url); - - if(parameters_in_url) { - for(i = 0; parameters[i][0]; i++) { - char *value = (char*)parameters[i][1]; - char *escaped_value = NULL; - - if(!parameters[i][1]) - continue; - - strcat(fc->uri, parameters[i][0]); - strcat(fc->uri, "="); - if(!strcmp(parameters[i][0], "method")) { - /* do not touch method name */ - } else - escaped_value = curl_escape(value, values_len[i]); - - if(escaped_value) { - strcat(fc->uri, escaped_value); - curl_free(escaped_value); - } else - strcat(fc->uri, value); - strcat(fc->uri, "&"); - } - - /* zap last & */ - fc->uri[strlen(fc->uri)-1]= '\0'; - } - -#ifdef FLICKCURL_DEBUG - fprintf(stderr, "URI is '%s'\n", fc->uri); - - FLICKCURL_ASSERT((strlen(fc->uri) == fc_uri_len), - "Final URI does not match expected length"); -#endif - - if(md5_string) - free(md5_string); - - if(values_len) - free(values_len); - - return 0; + return rc; } + int -flickcurl_prepare_noauth(flickcurl *fc, const char* method, - const char* parameters[][2], int count) +flickcurl_prepare_noauth(flickcurl *fc, const char* method) { if(!method) { flickcurl_error(fc, "No method to prepare"); @@ -961,14 +837,12 @@ fc->service_uri, method, NULL, NULL, - parameters, count, 1, 0); } int -flickcurl_prepare(flickcurl *fc, const char* method, - const char* parameters[][2], int count) +flickcurl_prepare(flickcurl *fc, const char* method) { if(!method) { flickcurl_error(fc, "No method to prepare"); @@ -979,7 +853,6 @@ fc->service_uri, method, NULL, NULL, - parameters, count, 1, 1); } @@ -987,14 +860,12 @@ int flickcurl_prepare_upload(flickcurl *fc, const char* url, - const char* upload_field, const char* upload_value, - const char* parameters[][2], int count) + const char* upload_field, const char* upload_value) { return flickcurl_prepare_common(fc, url, NULL, upload_field, upload_value, - parameters, count, 0, 1); } @@ -1033,8 +904,8 @@ t = ((ft.dwHighDateTime * FOUR_GIGA_NSEC100) - EPOCH_WIN_UNIX_DELTA) + (ft.dwLowDateTime * NSEC100); - tv->tv_sec = (long) t; - tv->tv_usec = (long) ((t - tv->tv_sec) * 1e6); + tp->tv_sec = (long) t; + tp->tv_usec = (long) ((t - tp->tv_sec) * 1e6); /* tzp is ignored */ @@ -1118,11 +989,11 @@ if(!strncmp((char*)ptr, "X-FlickrErrCode: ", EC_HEADER_LEN)) { fc->error_code = atoi((char*)ptr+EC_HEADER_LEN); } else if(!strncmp((char*)ptr, "X-FlickrErrMessage: ", EM_HEADER_LEN)) { - int len = bytes-EM_HEADER_LEN; + int len = bytes - EM_HEADER_LEN; if(fc->error_msg) free(fc->error_msg); - fc->error_msg = (char*)malloc(len+1); - strncpy(fc->error_msg, (char*)ptr+EM_HEADER_LEN, len); + fc->error_msg = (char*)malloc(len + 1); + memcpy(fc->error_msg, (char*)ptr + EM_HEADER_LEN, len + 1); fc->error_msg[len] = '\0'; while(fc->error_msg[len-1] == '\r' || fc->error_msg[len-1] == '\n') { fc->error_msg[len-1] = '\0'; @@ -1221,6 +1092,7 @@ if(1) { #ifdef HAVE_RAPTOR char* uri_string; + size_t len; #endif if(access(filename, R_OK)) { @@ -1230,7 +1102,8 @@ } #ifdef HAVE_RAPTOR uri_string = raptor_uri_filename_to_uri_string(filename); - strcpy(fc->uri, uri_string); + len = strlen(uri_string); + memcpy(fc->uri, uri_string, len + 1); raptor_free_memory(uri_string); #else sprintf(fc->uri, "file:%s", filename); @@ -1542,8 +1415,11 @@ const char *attr_value = (const char*)attr->children->content; if(!strcmp(attr_name, "code")) fc->error_code = atoi(attr_value); - else if(!strcmp(attr_name, "msg")) - fc->error_msg = strdup(attr_value); + else if(!strcmp(attr_name, "msg")) { + size_t attr_len = strlen(attr_value); + fc->error_msg = (char*)malloc(attr_len + 1); + memcpy(fc->error_msg, attr_value, attr_len + 1); + } } if(fc->method) flickcurl_error(fc, "Method %s failed with error %d - %s", @@ -1684,7 +1560,7 @@ strftime(date_buffer, len+1, ISO_DATE_FORMAT, structured_time); value = (char*)malloc(len + 1); - strncpy((char*)value, date_buffer, len+1); + memcpy(value, date_buffer, len + 1); return value; } @@ -1704,7 +1580,7 @@ strftime(date_buffer, len+1, SQL_DATETIME_FORMAT, structured_time); value = (char*)malloc(len + 1); - strncpy((char*)value, date_buffer, len+1); + memcpy(value, date_buffer, len + 1); return value; } @@ -1713,20 +1589,21 @@ flickcurl_sqltimestamp_to_isotime(const char* timestamp) { /* SQL DATETIME FORMAT "%Y %m %d %H:%M:%S" (19 chars) */ +#define SQL_DATE_LEN 19 /* ISO DATE FORMAT "%Y-%m-%dT%H:%M:%SZ" (20 chars) */ #define ISO_DATE_LEN 20 size_t len = ISO_DATE_LEN; char *value = NULL; value = (char*)malloc(len + 1); - strncpy((char*)value, timestamp, len); + memcpy(value, timestamp, SQL_DATE_LEN); value[4] = '-'; value[7] = '-'; value[10] = 'T'; value[13] = ':'; value[16] = ':'; value[19] = 'Z'; - value[20] = '\0'; + value[ISO_DATE_LEN] = '\0'; return value; } @@ -1762,8 +1639,11 @@ fc->failed = 1; break; } - if(node->children) - value = strdup((char*)node->children->content); + if(node->children) { + size_t len = strlen((char*)node->children->content); + value = (char*)malloc(len + 1); + memcpy(value, node->children->content, len + 1); + } break; } @@ -1817,7 +1697,7 @@ value = (char*)malloc(value_len+1); if(!value) goto tidy; - memcpy(value, xmlBufferContent(buffer), value_len+1); + memcpy(value, xmlBufferContent(buffer), value_len + 1); tidy: if(buffer) @@ -1937,20 +1817,18 @@ const char* method, const xmlChar* xpathExpr) { - const char * parameters[6][2]; - int count = 0; char *result = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; + flickcurl_init_params(fc); if(key && value) { - parameters[count][0] = key; - parameters[count++][1]= value; + flickcurl_add_param(fc, key, value); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, method, parameters, count)) + if(flickcurl_prepare(fc, method)) goto tidy; doc = flickcurl_invoke(fc); @@ -1998,8 +1876,8 @@ p = str; for(i = 0; array[i]; i++) { size_t item_len = strlen(array[i]); - strncpy(p, array[i], item_len); - p+= item_len; + memcpy(p, array[i], item_len); + p += item_len; if(i < array_size) *p++ = delim; } @@ -2040,14 +1918,15 @@ for(p = str; *p && *p != delim; p++) ; - item_len = p-str; - array[i] = (char*)malloc(item_len+1); + item_len = p - str; + array[i] = (char*)malloc(item_len + 1); if(!array[i]) { while(--i >= 0) free(array[i]); + free(array); return NULL; } - strncpy(array[i], str, item_len); + memcpy(array[i], str, item_len); array[i][item_len] = '\0'; str+= item_len; if(*str == delim) @@ -2304,9 +2183,8 @@ /* * flickcurl_append_photos_list_params: + * @fc: fc * @list_params: in parameter - photos list paramater - * @parameters: in/out parameter - array of name/value parameters - * @count_p: in/out parameter - updated as new parameters added * @format_p: out parameter - result format requested or NULL * * INTERNAL - append #flickcurl_photos_list_params to parameter list for API call @@ -2314,14 +2192,14 @@ * Return value: number of parameters added */ int -flickcurl_append_photos_list_params(flickcurl_photos_list_params* list_params, - const char* parameters[][2], int* count_p, +flickcurl_append_photos_list_params(flickcurl* fc, + flickcurl_photos_list_params* list_params, const char** format_p) { /* NOTE: These are SHARED and pointed to by flickcurl_prepare() to * build the URL */ - static char per_page_s[4]; - static char page_s[4]; + static char per_page_s[FLICKCURL_MAX_LIST_PARAM_COUNT]; + static char page_s[FLICKCURL_MAX_LIST_PARAM_COUNT]; int this_count = 0; if(format_p) @@ -2331,33 +2209,25 @@ return 0; if(list_params->extras) { - parameters[*count_p][0] = "extras"; - parameters[*count_p][1]= list_params->extras; - (*count_p)++; + flickcurl_add_param(fc, "extras", list_params->extras); this_count++; } if(list_params->per_page) { if(list_params->per_page >= 0 && list_params->per_page <= 999) { sprintf(per_page_s, "%d", list_params->per_page); - parameters[*count_p][0] = "per_page"; - parameters[*count_p][1]= per_page_s; - (*count_p)++; + flickcurl_add_param(fc, "per_page", per_page_s); this_count++; } } if(list_params->page) { if(list_params->page >= 0 && list_params->page <= 999) { sprintf(page_s, "%d", list_params->page); - parameters[*count_p][0] = "page"; - parameters[*count_p][1]= page_s; - (*count_p)++; + flickcurl_add_param(fc, "page", page_s); this_count++; } } if(list_params->format) { - parameters[*count_p][0] = "format"; - parameters[*count_p][1]= list_params->format; - (*count_p)++; + flickcurl_add_param(fc, "format", list_params->format); this_count++; if(format_p) @@ -2448,7 +2318,7 @@ if(!list_params) return 1; - memset(list_params, '\0', sizeof(list_params)); + memset(list_params, '\0', sizeof(*list_params)); list_params->version = 1; list_params->extras = NULL; diff -Nru flickcurl-1.22/src/commons-api.c flickcurl-1.24/src/commons-api.c --- flickcurl-1.22/src/commons-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/commons-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -5,7 +5,7 @@ * Commons API announced 2009-01-29 * http://flickr.com/groups/api/discuss/72157613093793775/ * - * Copyright (C) 2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2009-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -58,15 +58,15 @@ flickcurl_institution** flickcurl_commons_getInstitutions(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_institution** institutions = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.commons.getInstitutions", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.commons.getInstitutions")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/config.c flickcurl-1.24/src/config.c --- flickcurl-1.22/src/config.c 2011-10-21 20:41:12.000000000 +0000 +++ flickcurl-1.24/src/config.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * config.c - INI configuration file handling * - * Copyright (C) 2007-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -244,7 +244,14 @@ flickcurl_set_shared_secret(fc, value); else if(!strcmp(key, "auth_token")) flickcurl_set_auth_token(fc, value); - + else if(!strcmp(key, "oauth_client_key")) + flickcurl_set_oauth_client_key(fc, value); + else if(!strcmp(key, "oauth_client_secret")) + flickcurl_set_oauth_client_secret(fc, value); + else if(!strcmp(key, "oauth_token")) + flickcurl_set_oauth_token(fc, value); + else if(!strcmp(key, "oauth_token_secret")) + flickcurl_set_oauth_token_secret(fc, value); } @@ -280,21 +287,46 @@ fputc('[', fh); fputs(section, fh); fputc(']', fh); - s = flickcurl_get_auth_token(fc); - if(s) { - fputs("\nauth_token=", fh); - fputs(s, fh); - } - s = flickcurl_get_api_key(fc); - if(s) { - fputs("\napi_key=", fh); - fputs(s, fh); - } - s = flickcurl_get_shared_secret(fc); + + s = flickcurl_get_oauth_token(fc); if(s) { - fputs("\nsecret=", fh); + /* OAuth token and secret */ + fputs("\noauth_token=", fh); fputs(s, fh); + s = flickcurl_get_oauth_token_secret(fc); + if(s) { + fputs("\noauth_token_secret=", fh); + fputs(s, fh); + } + s = flickcurl_get_oauth_client_key(fc); + if(s) { + fputs("\noauth_client_key=", fh); + fputs(s, fh); + } + s = flickcurl_get_oauth_client_secret(fc); + if(s) { + fputs("\noauth_client_secret=", fh); + fputs(s, fh); + } + } else { + /* Legacy Flickr auth */ + s = flickcurl_get_auth_token(fc); + if(s) { + fputs("\noauth_token=", fh); + fputs(s, fh); + } + s = flickcurl_get_shared_secret(fc); + if(s) { + fputs("\noauth_secret=", fh); + fputs(s, fh); + } + s = flickcurl_get_api_key(fc); + if(s) { + fputs("\napi_key=", fh); + fputs(s, fh); + } } + fputs("\n", fh); fclose(fh); diff -Nru flickcurl-1.22/src/config.h.in flickcurl-1.24/src/config.h.in --- flickcurl-1.22/src/config.h.in 2011-12-29 00:03:45.000000000 +0000 +++ flickcurl-1.24/src/config.h.in 2013-04-11 04:56:15.000000000 +0000 @@ -6,9 +6,6 @@ /* Capture web service responses */ #undef CAPTURE -/* Experimental OAuth code */ -#undef FLICKCURL_OAUTH - /* Release version as a decimal */ #undef FLICKCURL_VERSION_DECIMAL diff -Nru flickcurl-1.22/src/contacts-api.c flickcurl-1.24/src/contacts-api.c --- flickcurl-1.22/src/contacts-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/contacts-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * contacts-api.c - Flickr flickr.contacts.* API calls * - * Copyright (C) 2007-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * Copyright (C) 2007 Vanilla I. Shu * (flickcurl_contacts_getList, flickcurl_contacts_getPublicList) * @@ -61,8 +61,6 @@ flickcurl_contacts_getList(flickcurl* fc, const char* filter, int page, int per_page) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_contact** contacts = NULL; @@ -70,24 +68,23 @@ char page_str[10]; char per_page_str[10]; + flickcurl_init_params(fc); + if(filter) { - parameters[count][0] = "filter"; - parameters[count++][1]= filter; + flickcurl_add_param(fc, "filter", filter); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_str; + flickcurl_add_param(fc, "page", page_str); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.contacts.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.contacts.getList")) goto tidy; flickcurl_set_write(fc, 1); @@ -142,28 +139,25 @@ int date_lastupload, const char* filter) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_contact** contacts = NULL; int contacts_count = 0; char date_lastupload_str[20]; + flickcurl_init_params(fc); + if(date_lastupload >= 0) { - parameters[count][0] = "date_lastupload"; sprintf(date_lastupload_str, "%d", date_lastupload); - parameters[count++][1]= date_lastupload_str; + flickcurl_add_param(fc, "date_lastupload", date_lastupload_str); } if(filter) { - parameters[count][0] = "filter"; - parameters[count++][1]= filter; + flickcurl_add_param(fc, "filter", filter); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.contacts.getListRecentlyUploaded", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.contacts.getListRecentlyUploaded")) goto tidy; doc = flickcurl_invoke(fc); @@ -210,8 +204,6 @@ flickcurl_contacts_getPublicList(flickcurl* fc, const char* user_id, int page, int per_page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_contact** contacts = NULL; @@ -219,27 +211,25 @@ char page_str[10]; char per_page_str[10]; + flickcurl_init_params(fc); + if (!user_id) return NULL; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_str; + flickcurl_add_param(fc, "page", page_str); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.contacts.getPublicList", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.contacts.getPublicList")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/contacts.c flickcurl-1.24/src/contacts.c --- flickcurl-1.22/src/contacts.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/contacts.c 2012-08-29 02:58:29.000000000 +0000 @@ -119,11 +119,12 @@ contact_object = (flickcurl_contact*)calloc(sizeof(flickcurl_contact), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "nsid")) contact_object->nsid = attr_value; diff -Nru flickcurl-1.22/src/context.c flickcurl-1.24/src/context.c --- flickcurl-1.22/src/context.c 2010-05-03 15:19:09.000000000 +0000 +++ flickcurl-1.24/src/context.c 2012-08-29 02:58:29.000000000 +0000 @@ -124,8 +124,8 @@ nodes_count++; } - contexts = (flickcurl_context**)calloc(sizeof(flickcurl_context**), - nodes_count+1); + contexts = (flickcurl_context**)calloc(sizeof(flickcurl_context*), + nodes_count + 1); /* walk children elements of root element */ xnp = xmlDocGetRootElement(doc); @@ -157,11 +157,12 @@ context->type = type; for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) context->id = attr_value; @@ -179,6 +180,8 @@ context->url = attr_value; else if(!strcmp(attr_name, "thumb")) context->thumb = attr_value; + else + free(attr_value); } /* for attributes */ #if FLICKCURL_DEBUG > 1 diff -Nru flickcurl-1.22/src/exif.c flickcurl-1.24/src/exif.c --- flickcurl-1.22/src/exif.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/exif.c 2012-08-29 02:58:29.000000000 +0000 @@ -119,11 +119,12 @@ e = (flickcurl_exif*)calloc(sizeof(flickcurl_exif), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "tagspace")) e->tagspace = attr_value; @@ -135,6 +136,8 @@ free(attr_value); } else if(!strcmp(attr_name, "label")) e->label = attr_value; + else + free(attr_value); } /* Walk children nodes for or elements */ @@ -142,11 +145,13 @@ const char *chnode_name = (const char*)chnode->name; if(chnode->type == XML_ELEMENT_NODE) { if(!strcmp(chnode_name, "raw")) { - e->raw = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(e->raw, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + e->raw = (char*)malloc(len + 1); + memcpy(e->raw, chnode->children->content, len + 1); } else if(!strcmp(chnode_name, "clean")) { - e->clean = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(e->clean, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + e->clean = (char*)malloc(len + 1); + memcpy(e->clean, chnode->children->content, len + 1); } } } diff -Nru flickcurl-1.22/src/favorites-api.c flickcurl-1.24/src/favorites-api.c --- flickcurl-1.22/src/favorites-api.c 2011-10-15 19:24:59.000000000 +0000 +++ flickcurl-1.24/src/favorites-api.c 2013-04-11 04:52:16.000000000 +0000 @@ -2,7 +2,7 @@ * * favorites-api.c - Flickr flickr.favorites.* API calls * - * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -56,20 +56,19 @@ int flickcurl_favorites_add(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; + flickcurl_init_params(fc); + if(!photo_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.favorites.add", parameters, count)) + if(flickcurl_prepare(fc, "flickr.favorites.add")) goto tidy; flickcurl_set_write(fc, 1); @@ -117,8 +116,6 @@ int num_next, const char* extras) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_photos_list** photos_lists = NULL; @@ -126,34 +123,31 @@ char num_next_str[10]; int i; + flickcurl_init_params(fc); + if(!photo_id || !user_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "user_id", user_id); if(num_prev >= 0) { sprintf(num_prev_str, "%d", num_prev); - parameters[count][0] = "num_prev"; - parameters[count++][1]= num_prev_str; + flickcurl_add_param(fc, "num_prev", num_prev_str); } if(num_next >= 0) { sprintf(num_next_str, "%d", num_next); - parameters[count][0] = "num_next"; - parameters[count++][1]= num_next_str; + flickcurl_add_param(fc, "num_next", num_next_str); } /* this is the only standard photos response parameter supported * so using flickcurl_append_photos_list_params() is not really needed */ if(extras) { - parameters[count][0] = "extras"; - parameters[count++][1]= extras; + flickcurl_add_param(fc, "extras", extras); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.favorites.getContext", parameters, count)) + if(flickcurl_prepare(fc, "flickr.favorites.getContext")) goto tidy; doc = flickcurl_invoke(fc); @@ -169,12 +163,12 @@ } /* 3 lists of photo lists: prev, next and NULL to end the list */ - photos_lists = calloc(sizeof(flickcurl_photos_list*), 3); + photos_lists = (flickcurl_photos_list**)calloc(sizeof(flickcurl_photos_list*), 3); /* Decode the prev and next into photo lists */ for(i = 0; i < 2; i++) { const xmlChar* xpathExpr = (i == 0) ? (const xmlChar*)"/rsp/prevphoto" : (const xmlChar*)"/rsp/nextphoto"; - flickcurl_photos_list* photos_list = photos_lists[i]; + flickcurl_photos_list* photos_list; xmlXPathObjectPtr xpathObj = NULL; xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); @@ -213,8 +207,11 @@ if(xpathCtx) xmlXPathFreeContext(xpathCtx); - if(fc->failed) + if(fc->failed) { + if(photos_lists) + free(photos_lists); photos_lists = NULL; + } return photos_lists; } @@ -245,22 +242,21 @@ flickcurl_favorites_getList_params(flickcurl* fc, const char* user_id, flickcurl_photos_list_params* list_params) { - const char* parameters[12][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + /* API parameters */ if(user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.favorites.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.favorites.getList")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -338,24 +334,23 @@ flickcurl_favorites_getPublicList_params(flickcurl* fc, const char* user_id, flickcurl_photos_list_params* list_params) { - const char* parameters[13][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!user_id) return NULL; /* API parameters */ - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.favorites.getPublicList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.favorites.getPublicList")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -432,20 +427,19 @@ int flickcurl_favorites_remove(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; + flickcurl_init_params(fc); + if(!photo_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.favorites.remove", parameters, count)) + if(flickcurl_prepare(fc, "flickr.favorites.remove")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/flickcurl.h flickcurl-1.24/src/flickcurl.h --- flickcurl-1.22/src/flickcurl.h 2011-10-30 02:35:57.000000000 +0000 +++ flickcurl-1.24/src/flickcurl.h 2013-04-07 23:49:53.000000000 +0000 @@ -2,7 +2,7 @@ * * flickcurl.h - Flickcurl API * - * Copyright (C) 2007-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2013, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -912,9 +912,9 @@ * @name: Group Name * @description: Description * @lang: Language - * @is_admin: is admin flag + * @is_admin: user is a group admin * @is_pool_moderated: is the pool moderated - * @is_eighteenplus: 18+ group + * @is_eighteenplus: NOT USED (will always be 0) * @privacy: privacy level * @photos: photos in group count * @iconserver: icon server ID @@ -922,6 +922,21 @@ * @throttle_count: throttle count * @throttle_mode: throttle mode (day, ...) * @throttle_remaining: throttle remaining + * @iconfarm: icon farm ID + * @is_moderator: user is a moderator + * @is_member: user is a member + * @rules: group rules + * @pool_count: pool count + * @topic_count: topic count + * @photos_ok: photos are ok + * @videos_ok: videos are ok + * @images_ok: images are ok + * @screens_ok: screens are ok + * @art_ok: art is ok + * @safe_ok: safe content is ok + * @moderate_ok: moderate content is ok + * @restricted_ok: restricted content is ok + * @has_geo: has geolocation * * A group. */ @@ -940,6 +955,21 @@ int throttle_count; char* throttle_mode; int throttle_remaining; + int iconfarm; + int is_moderator; + int is_member; + char* rules; + int pool_count; + int topic_count; + int photos_ok; + int videos_ok; + int images_ok; + int screens_ok; + int art_ok; + int safe_ok; + int moderate_ok; + int restricted_ok; + int has_geo; } flickcurl_group; @@ -1401,6 +1431,22 @@ * * A photo at a size. * + * Supported sizes and their letter suffixes used in the @source and + * the @url fields are as follows: + * + * s: small square 75x75. + * q: large square 150x150 (2011-03-12 or later). + * t: thumbnail, 100 on longest side. + * m: small, 240 on longest side. + * n: small, 320 on longest side (2011-03-12 or later). + * -: medium, 500 on longest side. + * z: medium 640, 640 on longest side. + * b: large, 1024 on longest side*. + * o: original image, either a jpg, gif or png, depending on source format. + * + * The 'q' and 'n' sizes were announced 2011-03-12 in + * http://tech.groups.yahoo.com/group/yws-flickr/message/7483 + * */ typedef struct { char *label; @@ -1840,7 +1886,43 @@ char* flickcurl_auth_getToken(flickcurl* fc, const char* frob); FLICKCURL_API int flickcurl_auth_oauth_getAccessToken(flickcurl* fc); - +FLICKCURL_API +const char* flickcurl_get_oauth_token(flickcurl *fc); +FLICKCURL_API +void flickcurl_set_oauth_token(flickcurl *fc, const char* token); +FLICKCURL_API +const char* flickcurl_get_oauth_token_secret(flickcurl* fc); +FLICKCURL_API +void flickcurl_set_oauth_token_secret(flickcurl* fc, const char *secret); +FLICKCURL_API +const char* flickcurl_get_oauth_client_key(flickcurl *fc); +FLICKCURL_API +const char* flickcurl_get_oauth_client_secret(flickcurl *fc); +FLICKCURL_API +void flickcurl_set_oauth_client_key(flickcurl *fc, const char* client_key); +FLICKCURL_API +void flickcurl_set_oauth_client_secret(flickcurl *fc, const char* client_secret); +FLICKCURL_API +const char* flickcurl_get_oauth_request_token(flickcurl* fc); +FLICKCURL_API +const char* flickcurl_get_oauth_request_token_secret(flickcurl* fc); +FLICKCURL_API +void flickcurl_set_oauth_request_token(flickcurl *fc, const char* token); +FLICKCURL_API +void flickcurl_set_oauth_request_token_secret(flickcurl *fc, const char* secret); +FLICKCURL_API +const char* flickcurl_get_oauth_username(flickcurl* fc); +FLICKCURL_API +const char* flickcurl_get_oauth_user_nsid(flickcurl* fc); + +/* OAuth flow requests */ +FLICKCURL_API +int flickcurl_oauth_create_request_token(flickcurl* fc, const char* callback); +FLICKCURL_API +char* flickcurl_oauth_get_authorize_uri(flickcurl* fc); +FLICKCURL_API +int flickcurl_oauth_create_access_token(flickcurl* fc, const char* verifier); + /* flickr.blogs */ FLICKCURL_API flickcurl_blog** flickcurl_blogs_getList(flickcurl* fc); @@ -2022,6 +2104,8 @@ FLICKCURL_API flickcurl_person** flickcurl_photos_getFavorites(flickcurl* fc, const char* photo_id, int page, int per_page); FLICKCURL_API +flickcurl_photo* flickcurl_photos_getInfo2(flickcurl *fc, const char* photo_id, const char* secret); +FLICKCURL_API FLICKCURL_DEPRECATED flickcurl_photo* flickcurl_photos_getInfo(flickcurl *fc, const char* photo_id); FLICKCURL_API flickcurl_photo** flickcurl_photos_getNotInSet(flickcurl* fc, int min_upload_date, int max_upload_date, const char* min_taken_date, const char* max_taken_date, int privacy_filter, const char* extras, int per_page, int page); diff -Nru flickcurl-1.22/src/flickcurl_internal.h flickcurl-1.24/src/flickcurl_internal.h --- flickcurl-1.22/src/flickcurl_internal.h 2011-11-12 06:21:04.000000000 +0000 +++ flickcurl-1.24/src/flickcurl_internal.h 2013-04-07 23:49:53.000000000 +0000 @@ -4,7 +4,7 @@ * * All API calls and defines here many change in any release. * - * Copyright (C) 2007-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -27,10 +27,7 @@ #include #include - -#ifdef FLICKCURL_OAUTH #include -#endif #if defined (OFFLINE) && defined (CAPTURE) #error "Cannot define both OFFLINE and CAPTURE" @@ -110,11 +107,11 @@ /* flickcurl.c */ /* Prepare Flickr API request - GET or POST with URI parameters with auth */ -int flickcurl_prepare(flickcurl *fc, const char* method, const char* parameters[][2], int count); +int flickcurl_prepare(flickcurl *fc, const char* method); /* Prepare Flickr API request - GET or POST with URI parameters without auth */ -int flickcurl_prepare_noauth(flickcurl *fc, const char* method, const char* parameters[][2], int count); +int flickcurl_prepare_noauth(flickcurl *fc, const char* method); /* Prepare Flickr API request - POST with form-data parameters */ -int flickcurl_prepare_upload(flickcurl *fc, const char* url, const char* upload_field, const char* upload_value, const char* parameters[][2], int count); +int flickcurl_prepare_upload(flickcurl *fc, const char* url, const char* upload_field, const char* upload_value); /* Invoke Flickr API at URi prepared above and get back an XML document DOM */ xmlDocPtr flickcurl_invoke(flickcurl *fc); @@ -156,7 +153,12 @@ char* flickcurl_call_get_one_string_field(flickcurl* fc, const char* key, const char* value, const char* method, const xmlChar* xpathExpr); -int flickcurl_append_photos_list_params(flickcurl_photos_list_params* list_params, const char* parameters[][2], int* count_p, const char** format_p); +int flickcurl_append_photos_list_params(flickcurl* fc, flickcurl_photos_list_params* list_params, const char** format_p); + +void flickcurl_init_params(flickcurl *fc); +void flickcurl_add_param(flickcurl *fc, const char* key, const char* value); +void flickcurl_end_params(flickcurl *fc); + /* activity.c */ flickcurl_activity** flickcurl_build_activities(flickcurl* fc, xmlXPathContextPtr xpathCtx, const xmlChar* xpathExpr, int* activity_count_p); @@ -256,6 +258,16 @@ /* video.c */ flickcurl_video* flickcurl_build_video(flickcurl* fc, xmlXPathContextPtr xpathCtx, const xmlChar* xpathExpr); + +/* flickcurl_photos_search_params */ +#define FLICKCURL_MAX_PARAM_COUNT 30 + +#define FLICKCURL_MAX_LIST_PARAM_COUNT 4 + +#define FLICKCURL_MAX_OAUTH_PARAM_COUNT 8 + +#define FLICKCURL_TOTAL_PARAM_COUNT (FLICKCURL_MAX_PARAM_COUNT + FLICKCURL_MAX_LIST_PARAM_COUNT + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1) + struct flickcurl_chunk_s { char* content; size_t size; @@ -265,7 +277,6 @@ typedef struct flickcurl_chunk_s flickcurl_chunk; -#ifdef FLICKCURL_OAUTH typedef struct { /* client credentials */ char* client_key; /* AKA consumer key or the Flickr API key */ @@ -287,6 +298,12 @@ size_t token_len; char* token_secret; size_t token_secret_len; + + /* username and user_nsid */ + char* username; + size_t username_len; + char* user_nsid; + size_t user_nsid_len; /* callback URI or NULL for "oob" */ const char* callback; /* always shared */ @@ -306,7 +323,6 @@ unsigned char* data; size_t data_len; } flickcurl_oauth_data; -#endif struct flickcurl_s { @@ -353,13 +369,18 @@ * operations can be done (in most cases). */ - /* Flickr shared secret - flickcurl_set_shared_secret() */ + /* Flickr legacy auth token secret - flickcurl_set_shared_secret() */ char* secret; - /* Flickr application/api key - flickcurl_set_api_key() */ + /* Flickr application/api key - flickcurl_set_api_key() + * + * Not owned freed here - a pointer into od.client_key + * + * FIXME: remove at some point + */ char* api_key; - /* Flickr authentication token - flickcurl_set_auth_token() */ + /* Flickr legacy auth token - flickcurl_set_auth_token() */ char* auth_token; /* API call must be signed even if 'auth_token' is NULL - flickcurl_set_sign() @@ -430,12 +451,13 @@ /* OAuth access token Web Service URI */ char *oauth_access_token_uri; -#if FLICKCURL_OAUTH /* Used for OAuth nonce generation */ mtwist* mt; flickcurl_oauth_data od; -#endif + + const char *parameters[FLICKCURL_TOTAL_PARAM_COUNT][2]; + int count; }; struct flickcurl_serializer_s @@ -449,22 +471,15 @@ void flickcurl_serializer_terminate(void); -#ifdef FLICKCURL_OAUTH - /* sha1.c */ #define SHA1_DIGEST_LENGTH 20 unsigned char* flickcurl_hmac_sha1(const void *data, size_t data_len, const void *key, size_t key_len); -/* oauth.c */ - -#define FLICKCURL_MAX_OAUTH_PARAM_COUNT 8 - +/* legacy-auth.c */ +int flickcurl_legacy_prepare_common(flickcurl *fc, const char* url, const char* method, const char* upload_field, const char* upload_value, int parameters_in_url, int need_auth); +/* oauth.c */ void flickcurl_oauth_free(flickcurl_oauth_data* od); char* flickcurl_oauth_compute_signature(flickcurl_oauth_data* od, size_t* len_p); -int flickcurl_oauth_prepare_common(flickcurl *fc, const char* url, const char* method, const char* upload_field, const char* upload_value, const char* parameters[][2], int count, int parameters_in_url, int need_auth); -int flickcurl_oauth_request_token(flickcurl* fc); -char* flickcurl_oauth_get_authorize_uri(flickcurl* fc); -int flickcurl_oauth_access_token(flickcurl* fc, const char* verifier); -#endif +int flickcurl_oauth_prepare_common(flickcurl *fc, const char* url, const char* method, const char* upload_field, const char* upload_value, int parameters_in_url, int need_auth); diff -Nru flickcurl-1.22/src/galleries-api.c flickcurl-1.24/src/galleries-api.c --- flickcurl-1.22/src/galleries-api.c 2011-05-09 04:12:51.000000000 +0000 +++ flickcurl-1.24/src/galleries-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * galleries-api.c - Flickr flickr.galleries.* API calls * - * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2010-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -55,27 +55,24 @@ flickcurl_galleries_addPhoto(flickcurl* fc, const char* gallery_id, const char* photo_id, const char* comment_text) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; void* result = NULL; + flickcurl_init_params(fc); + if(!gallery_id || !photo_id) return 1; - parameters[count][0] = "gallery_id"; - parameters[count++][1]= gallery_id; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "gallery_id", gallery_id); + flickcurl_add_param(fc, "photo_id", photo_id); if(comment_text) { - parameters[count][0] = "comment"; - parameters[count++][1]= comment_text; + flickcurl_add_param(fc, "comment", comment_text); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.addPhoto", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.addPhoto")) goto tidy; flickcurl_set_write(fc, 1); @@ -130,27 +127,24 @@ const char* primary_photo_id, char** gallery_url_p) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* gallery_id = NULL; + flickcurl_init_params(fc); + if(!title || !description) return NULL; - parameters[count][0] = "title"; - parameters[count++][1]= title; - parameters[count][0] = "description"; - parameters[count++][1]= description; + flickcurl_add_param(fc, "title", title); + flickcurl_add_param(fc, "description", description); if(primary_photo_id) { - parameters[count][0] = "primary_photo_id"; - parameters[count++][1]= primary_photo_id; + flickcurl_add_param(fc, "primary_photo_id", primary_photo_id); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.create", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.create")) goto tidy; flickcurl_set_write(fc, 1); @@ -206,26 +200,23 @@ const char* gallery_id, const char* title, const char* description) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!gallery_id || !title) return 1; - parameters[count][0] = "gallery_id"; - parameters[count++][1]= gallery_id; - parameters[count][0] = "title"; - parameters[count++][1]= title; + flickcurl_add_param(fc, "gallery_id", gallery_id); + flickcurl_add_param(fc, "title", title); if(description) { - parameters[count][0] = "description"; - parameters[count++][1]= description; + flickcurl_add_param(fc, "description", description); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.editMeta", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.editMeta")) goto tidy; flickcurl_set_write(fc, 1); @@ -265,24 +256,21 @@ flickcurl_galleries_editPhoto(flickcurl* fc, const char* gallery_id, const char* photo_id, const char* new_comment) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!gallery_id || !photo_id || !new_comment) return 1; - parameters[count][0] = "gallery_id"; - parameters[count++][1]= gallery_id; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "comment"; - parameters[count++][1]= new_comment; + flickcurl_add_param(fc, "gallery_id", gallery_id); + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "comment", new_comment); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.editPhoto", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.editPhoto")) goto tidy; flickcurl_set_write(fc, 1); @@ -323,26 +311,23 @@ const char* primary_photo_id, const char** photo_ids_array) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char* photo_ids = NULL; + flickcurl_init_params(fc); + if(!gallery_id || !primary_photo_id || !photo_ids_array) return 1; - parameters[count][0] = "gallery_id"; - parameters[count++][1]= gallery_id; - parameters[count][0] = "primary_photo_id"; - parameters[count++][1]= primary_photo_id; + flickcurl_add_param(fc, "gallery_id", gallery_id); + flickcurl_add_param(fc, "primary_photo_id", primary_photo_id); photo_ids = flickcurl_array_join(photo_ids_array, ','); - parameters[count][0] = "photo_ids"; - parameters[count++][1]= photo_ids; + flickcurl_add_param(fc, "photo_ids", photo_ids); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.editPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.editPhotos")) goto tidy; flickcurl_set_write(fc, 1); @@ -383,22 +368,21 @@ flickcurl_gallery* flickcurl_galleries_getInfo(flickcurl* fc, const char* gallery_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_gallery* gallery = NULL; flickcurl_gallery** galleries = NULL; + flickcurl_init_params(fc); + if(!gallery_id) return NULL; - parameters[count][0] = "gallery_id"; - parameters[count++][1]= gallery_id; + flickcurl_add_param(fc, "gallery_id", gallery_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.getInfo", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -452,33 +436,30 @@ flickcurl_galleries_getList(flickcurl* fc, const char* user_id, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_gallery** galleries = NULL; char page_str[10]; char per_page_str[10]; + flickcurl_init_params(fc); + if(!user_id) return NULL; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_str; + flickcurl_add_param(fc, "page", page_str); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.getList")) goto tidy; doc = flickcurl_invoke(fc); @@ -528,34 +509,30 @@ flickcurl_galleries_getListForPhoto(flickcurl* fc, const char* photo_id, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_gallery** galleries = NULL; char page_str[10]; char per_page_str[10]; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_str; + flickcurl_add_param(fc, "page", page_str); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.getListForPhoto", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.galleries.getListForPhoto")) goto tidy; doc = flickcurl_invoke(fc); @@ -604,24 +581,23 @@ flickcurl_galleries_getPhotos_params(flickcurl* fc, const char* gallery_id, flickcurl_photos_list_params* list_params) { - const char* parameters[11][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!gallery_id) return NULL; /* API parameters */ - parameters[count][0] = "gallery_id"; - parameters[count++][1]= gallery_id; + flickcurl_add_param(fc, "gallery_id", gallery_id); /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.galleries.getPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.galleries.getPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, diff -Nru flickcurl-1.22/src/gallery.c flickcurl-1.24/src/gallery.c --- flickcurl-1.22/src/gallery.c 2010-09-30 17:18:50.000000000 +0000 +++ flickcurl-1.24/src/gallery.c 2012-08-29 05:15:21.000000000 +0000 @@ -128,18 +128,20 @@ /* initialise primary photo object */ g->primary_photo = (flickcurl_photo*)calloc(sizeof(flickcurl_photo), 1); /* assumes it is a photo */ - g->primary_photo->media_type = (char*)malloc(6); - strncpy(g->primary_photo->media_type, "photo", 6); +#define PHOTO_STR_LEN 5 + g->primary_photo->media_type = (char*)malloc(PHOTO_STR_LEN + 1); + memcpy(g->primary_photo->media_type, "photo", PHOTO_STR_LEN + 1); /* empty list of tags (1 NULL pointer) */ g->primary_photo->tags = (flickcurl_tag**)calloc(sizeof(flickcurl_tag*), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) g->id = attr_value; @@ -180,13 +182,15 @@ if(chnode->type == XML_ELEMENT_NODE) { if(!strcmp(chnode_name, "title")) { if(chnode->children) { - g->title = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(g->title, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + g->title = (char*)malloc(len + 1); + memcpy(g->title, chnode->children->content, len + 1); } } else if(!strcmp(chnode_name, "description")) { if(chnode->children) { - g->description = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(g->description, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + g->description = (char*)malloc(len + 1); + memcpy(g->description, chnode->children->content, len + 1); } } } diff -Nru flickcurl-1.22/src/group.c flickcurl-1.24/src/group.c --- flickcurl-1.22/src/group.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/group.c 2013-04-11 04:52:16.000000000 +0000 @@ -123,11 +123,12 @@ g = (flickcurl_group*)calloc(sizeof(flickcurl_group), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "nsid") || !strcmp(attr_name, "id")) g->nsid = attr_value; @@ -135,9 +136,15 @@ g->name = attr_value; else if(!strcmp(attr_name, "lang")) g->lang = attr_value; - else if(!strcmp(attr_name, "admin")) { + else if(!strcmp(attr_name, "is_admin")) { g->is_admin = atoi(attr_value); free(attr_value); + } else if(!strcmp(attr_name, "is_moderator")) { + g->is_moderator = atoi(attr_value); + free(attr_value); + } else if(!strcmp(attr_name, "is_member")) { + g->is_member = atoi(attr_value); + free(attr_value); } else if(!strcmp(attr_name, "privacy")) { g->privacy = atoi(attr_value); free(attr_value); @@ -150,8 +157,8 @@ } else if(!strcmp(attr_name, "ispoolmoderated")) { g->is_pool_moderated = atoi(attr_value); free(attr_value); - } else if(!strcmp(attr_name, "eightteenplus")) { - g->is_eighteenplus = atoi(attr_value); + } else if(!strcmp(attr_name, "iconfarm")) { + g->iconfarm = atoi(attr_value); free(attr_value); } } /* end attributes */ @@ -161,16 +168,19 @@ for(chnode = node->children; chnode; chnode = chnode->next) { const char *chnode_name = (const char*)chnode->name; char* value; + size_t value_len; + if(chnode->type != XML_ELEMENT_NODE) continue; if(!strcmp(chnode_name, "throttle")) { for(attr = chnode->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "count")) { g->throttle_count = atoi(attr_value); free(attr_value); @@ -185,11 +195,39 @@ continue; } + if(!strcmp(chnode_name, "restrictions")) { + for(attr = chnode->properties; attr; attr = attr->next) { + const char *attr_name = (const char*)attr->name; + char *attr_value = (char*)attr->children->content; + + if(!strcmp(attr_name, "photos_ok")) { + g->photos_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "videos_ok")) { + g->videos_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "images_ok")) { + g->images_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "screens_ok")) { + g->screens_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "art_ok")) { + g->art_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "safe_ok")) { + g->safe_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "moderate_ok")) { + g->moderate_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "restricted_ok")) { + g->restricted_ok = atoi(attr_value); + } else if(!strcmp(attr_name, "has_geo")) { + g->has_geo = atoi(attr_value); + } + } + } + if(!chnode->children) continue; - value = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(value, (const char*)chnode->children->content); + value_len = strlen((const char*)chnode->children->content); + value = (char*)malloc(value_len + 1); + memcpy(value, chnode->children->content, value_len + 1); if(!strcmp(chnode_name, "name")) g->name = value; @@ -201,20 +239,46 @@ } else if(!strcmp(chnode_name, "privacy")) { g->privacy = atoi(value); free(value); - } + } else if(!strcmp(chnode_name, "rules")) { + g->rules = value; + } else if(!strcmp(chnode_name, "pool_count")) { + g->pool_count = atoi(value); + free(value); + } else if(!strcmp(chnode_name, "topic_count")) { + g->topic_count = atoi(value); + free(value); + } else + free(value); } #if FLICKCURL_DEBUG > 1 fprintf(stderr, - "group: nsid %s name '%s' description '%s' lang '%s'\n" - " admin %d pool moderated %d 18+ %d privacy %d\n" - " photos %d iconserver %d members %d\n" - " throttle count %d mode '%s' remaining %d\n", - g->nsid, g->name, g->description, g->lang, - g->is_admin, g->is_pool_moderated, g->is_eighteenplus, g->privacy, - g->photos, g->iconserver, g->members, - g->throttle_count, g->throttle_mode, g->throttle_remaining); + "group: nsid %s name '%s'\n" + " description '%s' lang '%s'\n" + " rules '%s'\n" + " user is? admin %d moderator %d member %d\n" + " pool moderated %d privacy %d\n" + " iconserver %d iconfarm %d\n" + " photos %d members %d\n" + " throttle count %d mode '%s' remaining %d\n" + " pool count %d topic count %d\n" + " restrictions photos %d videos %d images %d screens %d art %d\n" + " restrictions safe %d moderate %d restricted %d\n" + " restrictions has geo %d\n", + g->nsid, g->name, + (g->description ? g->description : ""), (g->lang ? g->lang : ""), + (g->rules ? g->rules: ""), + g->is_admin, g->is_moderator, g->is_member, + g->is_pool_moderated, g->privacy, + g->iconserver, g->iconfarm, + g->photos, g->members, + g->throttle_count, (g->throttle_mode ? g->throttle_mode : ""), g->throttle_remaining, + g->pool_count, g->topic_count, + g->photos_ok, g->videos_ok, g->images_ok, g->screens_ok, g->art_ok, + g->safe_ok, g->moderate_ok, g->restricted_ok, + g->has_geo + ); #endif groups[group_count++] = g; diff -Nru flickcurl-1.22/src/groups-api.c flickcurl-1.24/src/groups-api.c --- flickcurl-1.22/src/groups-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/groups-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * groups-api.c - Flickr flickr.groups.* API calls * - * Copyright (C) 2007-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -56,22 +56,21 @@ flickcurl_category* flickcurl_groups_browse(flickcurl* fc, int cat_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_category* category = NULL; char cat_id_str[10]; + flickcurl_init_params(fc); + if(cat_id >= 0) { sprintf(cat_id_str, "%d", cat_id); - parameters[count][0] = "cat_id"; - parameters[count++][1]= cat_id_str; + flickcurl_add_param(fc, "cat_id", cat_id_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.browse", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.browse")) goto tidy; doc = flickcurl_invoke(fc); @@ -118,26 +117,24 @@ flickcurl_group* flickcurl_groups_getInfo(flickcurl* fc, const char* group_id, const char* lang) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_group **groups = NULL; flickcurl_group *group = NULL; + flickcurl_init_params(fc); + if(!group_id) return NULL; - parameters[count][0] = "group_id"; - parameters[count++][1]= group_id; + flickcurl_add_param(fc, "group_id", group_id); if(lang) { - parameters[count][0] = "lang"; - parameters[count++][1]= lang; + flickcurl_add_param(fc, "lang", lang); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.getInfo", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -188,29 +185,26 @@ flickcurl_group** flickcurl_groups_search(flickcurl* fc, const char* text, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_group **groups = NULL; char per_page_s[10]; char page_s[10]; + flickcurl_init_params(fc); + if(!text) return NULL; - parameters[count][0] = "text"; - parameters[count++][1]= text; - parameters[count][0] = "per_page"; + flickcurl_add_param(fc, "text", text); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; - parameters[count][0] = "page"; + flickcurl_add_param(fc, "per_page", per_page_s); sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; + flickcurl_add_param(fc, "page", page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.search", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.search")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/groups-members-api.c flickcurl-1.24/src/groups-members-api.c --- flickcurl-1.22/src/groups-members-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/groups-members-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * groups-members-api.c - Flickr flickr.groups.members.* API calls * - * Copyright (C) 2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2009-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -67,8 +67,6 @@ const char* membertypes, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_member** members = NULL; @@ -76,28 +74,26 @@ char per_page_s[10]; char page_s[10]; + flickcurl_init_params(fc); + if(!group_id) return NULL; - parameters[count][0] = "group_id"; - parameters[count++][1]= group_id; + flickcurl_add_param(fc, "group_id", group_id); if(membertypes) { - parameters[count][0] = "membertypes"; - parameters[count++][1]= membertypes; + flickcurl_add_param(fc, "membertypes", membertypes); } if(per_page >= 0) { sprintf(per_page_s, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1]= per_page_s; + flickcurl_add_param(fc, "per_page", per_page_s); } if(page >= 0) { sprintf(page_s, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1]= page_s; + flickcurl_add_param(fc, "page", page_s); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.members.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.members.getList")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/groups-pools-api.c flickcurl-1.24/src/groups-pools-api.c --- flickcurl-1.22/src/groups-pools-api.c 2010-05-10 03:12:12.000000000 +0000 +++ flickcurl-1.24/src/groups-pools-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * groups-pools-api.c - Flickr flickr.groups.pool.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -58,22 +58,20 @@ flickcurl_groups_pools_add(flickcurl* fc, const char* photo_id, const char* group_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photo_id || !group_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "group_id"; - parameters[count++][1]= group_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "group_id", group_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.pools.add", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.pools.add")) goto tidy; flickcurl_set_write(fc, 1); @@ -110,23 +108,21 @@ flickcurl_groups_pools_getContext(flickcurl* fc, const char* photo_id, const char* group_id) { - const char * parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; flickcurl_context** contexts = NULL; + flickcurl_init_params(fc); + if(!photo_id || !group_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = "group_id"; - parameters[count++][1]= group_id; + flickcurl_add_param(fc, "group_id", group_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.pools.getContext", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.pools.getContext")) goto tidy; doc = flickcurl_invoke(fc); @@ -158,24 +154,22 @@ flickcurl_group** flickcurl_groups_pools_getGroups(flickcurl* fc, int page, int per_page) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_group** groups = NULL; char per_page_s[10]; char page_s[10]; - parameters[count][0] = "page"; + flickcurl_init_params(fc); + sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; - parameters[count][0] = "per_page"; + flickcurl_add_param(fc, "page", page_s); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; + flickcurl_add_param(fc, "per_page", per_page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.pools.getGroups", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.pools.getGroups")) goto tidy; doc = flickcurl_invoke(fc); @@ -228,32 +222,29 @@ const char* tags, const char* user_id, flickcurl_photos_list_params* list_params) { - const char* parameters[14][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!group_id) return NULL; /* API parameters */ - parameters[count][0] = "group_id"; - parameters[count++][1]= group_id; + flickcurl_add_param(fc, "group_id", group_id); if(tags) { - parameters[count][0] = "tags"; - parameters[count++][1]= tags; + flickcurl_add_param(fc, "tags", tags); } if(user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.pools.getPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.pools.getPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -335,22 +326,20 @@ flickcurl_groups_pools_remove(flickcurl* fc, const char* photo_id, const char* group_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photo_id || !group_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "group_id"; - parameters[count++][1]= group_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "group_id", group_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.groups.pools.remove", parameters, count)) + if(flickcurl_prepare(fc, "flickr.groups.pools.remove")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/institution.c flickcurl-1.24/src/institution.c --- flickcurl-1.22/src/institution.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/institution.c 2012-08-29 01:48:38.000000000 +0000 @@ -267,8 +267,11 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); - if(fc->failed) + if(fc->failed) { + if(institutions) + flickcurl_free_institutions(institutions); institutions = NULL; + } return institutions; } diff -Nru flickcurl-1.22/src/interestingness-api.c flickcurl-1.24/src/interestingness-api.c --- flickcurl-1.22/src/interestingness-api.c 2010-05-10 03:12:12.000000000 +0000 +++ flickcurl-1.24/src/interestingness-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * interestingness-api.c - Flickr flickr.interestingness.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -59,23 +59,22 @@ flickcurl_interestingness_getList_params(flickcurl* fc, const char* date, flickcurl_photos_list_params* list_params) { - const char* parameters[12][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + /* API parameters */ if(date) { - parameters[count][0] = "date"; - parameters[count++][1]= date; + flickcurl_add_param(fc, "date", date); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.interestingness.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.interestingness.getList")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, diff -Nru flickcurl-1.22/src/legacy-auth.c flickcurl-1.24/src/legacy-auth.c --- flickcurl-1.22/src/legacy-auth.c 1970-01-01 00:00:00.000000000 +0000 +++ flickcurl-1.24/src/legacy-auth.c 2012-08-29 03:42:02.000000000 +0000 @@ -0,0 +1,300 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * legacy-auth.c - Flickr Legacy authentication + * + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ + * + * This file is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef WIN32 +#include +#endif + +#include +#include + + + +static int +compare_args(const void *a, const void *b) +{ + return strcmp(*(char**)a, *(char**)b); +} + + +static void +flickcurl_sort_args(flickcurl *fc) +{ + qsort((void*)fc->parameters, fc->count, sizeof(char*[2]), compare_args); +} + + +int +flickcurl_legacy_prepare_common(flickcurl *fc, + const char* url, + const char* method, + const char* upload_field, + const char* upload_value, + int parameters_in_url, int need_auth) +{ + int i; + char *md5_string = NULL; + size_t* values_len = NULL; + unsigned int fc_uri_len = 0; + unsigned int full_uri_len = 0; + + if(!url) + return 1; + + /* If one is given, both are required */ + if((upload_field || upload_value) && (!upload_field || !upload_value)) + return 1; + + fc->failed = 0; + fc->error_code = 0; + if(fc->error_msg) { + free(fc->error_msg); + fc->error_msg = NULL; + } + /* Default to read */ + fc->is_write = 0; + /* Default to no data */ + if(fc->data) { + if(fc->data_is_xml) + xmlFree(fc->data); + fc->data = NULL; + fc->data_length = 0; + fc->data_is_xml = 0; + } + if(fc->param_fields) { + for(i = 0; fc->param_fields[i]; i++) { + free(fc->param_fields[i]); + free(fc->param_values[i]); + } + free(fc->param_fields); + free(fc->param_values); + fc->param_fields = NULL; + fc->param_values = NULL; + fc->parameter_count = 0; + } + if(fc->upload_field) { + free(fc->upload_field); + fc->upload_field = NULL; + } + if(fc->upload_value) { + free(fc->upload_value); + fc->upload_value = NULL; + } + + if(!fc->secret) { + flickcurl_error(fc, "No legacy Flickr auth secret"); + return 1; + } + if(!fc->api_key) { + flickcurl_error(fc, "No API Key (OAuth Client Key)"); + return 1; + } + + + if(fc->method) + free(fc->method); + if(method) { + size_t len = strlen(method); + fc->method = (char*)malloc(len + 1); + memcpy(fc->method, method, len + 1); + } else + fc->method = NULL; + + if(fc->method) + flickcurl_add_param(fc, "method", fc->method); + + flickcurl_add_param(fc, "api_key", fc->api_key); + + if(need_auth && fc->auth_token) + flickcurl_add_param(fc, "auth_token", fc->auth_token); + + flickcurl_end_params(fc); + + /* +1 for api_sig +1 for NULL terminating pointer */ + fc->param_fields = (char**)calloc(fc->count + 2, sizeof(char*)); + fc->param_values = (char**)calloc(fc->count + 2, sizeof(char*)); + values_len = (size_t*)calloc(fc->count + 2, sizeof(size_t)); + + if((need_auth && fc->auth_token) || fc->sign) + flickcurl_sort_args(fc); + + fc_uri_len = strlen(url); + full_uri_len = fc_uri_len; + + /* Save away the parameters and calculate the value lengths */ + for(i = 0; fc->parameters[i][0]; i++) { + size_t param_len = strlen(fc->parameters[i][0]); + + if(fc->parameters[i][1]) + values_len[i] = strlen(fc->parameters[i][1]); + else { + values_len[i] = 0; + fc->parameters[i][1] = ""; + } + + fc->param_fields[i] = (char*)malloc(param_len + 1); + memcpy(fc->param_fields[i], fc->parameters[i][0], param_len + 1); + + fc->param_values[i] = (char*)malloc(values_len[i] + 1); + memcpy(fc->param_values[i], fc->parameters[i][1], values_len[i] + 1); + + /* 3x value len is conservative URI %XX escaping on every char */ + full_uri_len += param_len + 1 /* = */ + 3 * values_len[i]; + } + + if(upload_field) { + size_t len = strlen(upload_field); + fc->upload_field = (char*)malloc(len + 1); + memcpy(fc->upload_field, upload_field, len + 1); + + len = strlen(upload_value); + fc->upload_value = (char*)malloc(len + 1); + memcpy(fc->upload_value, upload_value, len + 1); + } + + if((need_auth && fc->auth_token) || fc->sign) { + size_t secret_len; + size_t buf_len = 0; + char *buf; + char *p; + + secret_len = strlen(fc->secret); + buf_len = secret_len; + for(i = 0; fc->parameters[i][0]; i++) + buf_len += strlen(fc->parameters[i][0]) + values_len[i]; + + buf = (char*)malloc(buf_len + 1); + + p = buf; + memcpy(p, fc->secret, secret_len); + p += secret_len; + for(i = 0; fc->parameters[i][0]; i++) { + size_t len = strlen(fc->parameters[i][0]); + memcpy(p, fc->parameters[i][0], len); + p += len; + memcpy(p, fc->parameters[i][1], values_len[i]); + p += values_len[i]; + } + *p = '\0'; + +#ifdef FLICKCURL_DEBUG + fprintf(stderr, "MD5 Buffer '%s'\n", buf); +#endif + md5_string = MD5_string(buf); + + flickcurl_add_param(fc, "api_sig", md5_string); + fc->count--; + + /* Add a new parameter pair */ + values_len[fc->count] = 32; /* MD5 is always 32 */ + fc->param_fields[fc->count] = (char*)malloc(7+1); /* 7 = strlen(api_sig) */ + memcpy(fc->param_fields[fc->count], fc->parameters[fc->count][0], 7 + 1); + + fc->param_values[fc->count] = (char*)malloc(32+1); /* 32 = MD5 */ + memcpy(fc->param_values[fc->count], fc->parameters[fc->count][1], 32 + 1); + + full_uri_len += 7 /* "api_sig" */ + 1 /* = */ + 32 /* MD5 value: never escaped */; + + fc->count++; + +#ifdef FLICKCURL_DEBUG + fprintf(stderr, "Signature: '%s'\n", fc->parameters[fc->count - 1][1]); +#endif + + free(buf); + + flickcurl_end_params(fc); + } + + /* add &s between parameters */ + full_uri_len += fc->count - 1; + + /* reuse or grow uri buffer */ + if(fc->uri_len < full_uri_len) { + free(fc->uri); + fc->uri = (char*)malloc(full_uri_len + 1); + fc->uri_len = full_uri_len; + } + memcpy(fc->uri, url, fc_uri_len); + fc->uri[fc_uri_len] = '\0'; + + if(parameters_in_url) { + char* p = fc->uri + fc_uri_len; + + for(i = 0; fc->parameters[i][0]; i++) { + char *value = (char*)fc->parameters[i][1]; + int value_is_escaped = 0; + size_t len; + + if(!fc->parameters[i][1]) + continue; + + len = strlen(fc->parameters[i][0]); + memcpy(p, fc->parameters[i][0], len); + p += len; + *p++ = '='; + + len = values_len[i]; + if(!strcmp(fc->parameters[i][0], "method")) { + /* do not touch method name */ + } else { + value = curl_escape(value, len); + len = strlen(value); + value_is_escaped = 1; + } + + memcpy(p, value, len); + p += len; + + if(value_is_escaped) + curl_free(value); + + *p++ = '&'; + } + + /* zap last & and terminate fc->url */ + *--p = '\0'; + } + +#ifdef FLICKCURL_DEBUG + fprintf(stderr, "URI is '%s'\n", fc->uri); + + FLICKCURL_ASSERT((strlen(fc->uri) == full_uri_len), + "Final URI does not match expected length"); +#endif + + if(md5_string) + free(md5_string); + + if(values_len) + free(values_len); + + return 0; +} + + diff -Nru flickcurl-1.22/src/location.c flickcurl-1.24/src/location.c --- flickcurl-1.22/src/location.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/location.c 2013-01-17 00:14:48.000000000 +0000 @@ -30,6 +30,12 @@ #include #endif +/* for atof() */ +#ifdef HAVE_STDLIB_H +#include +#undef HAVE_STDLIB_H +#endif + #include #include @@ -87,16 +93,19 @@ for(attr = node->properties; attr; attr = attr->next) { const char *attr_name = (const char*)attr->name; char *attr_value; - - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + size_t attr_value_len = strlen((const char*)attr->children->content); + + attr_value = (char*)malloc(attr_value_len + 1); + memcpy(attr_value, attr->children->content, attr_value_len + 1); if(!strcmp(attr_name, "latitude")) - location->latitude = atoi(attr_value); + location->latitude = atof(attr_value); else if(!strcmp(attr_name, "longitude")) - location->longitude = atoi(attr_value); + location->longitude = atof(attr_value); else if(!strcmp(attr_name, "accuracy")) location->accuracy = atoi(attr_value); + + free(attr_value); } diff -Nru flickcurl-1.22/src/machinetags-api.c flickcurl-1.24/src/machinetags-api.c --- flickcurl-1.22/src/machinetags-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/machinetags-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * machinetags-api.c - Flickr flickr.machinetags.* API calls * - * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -60,27 +60,23 @@ flickcurl_machinetags_getNamespaces(flickcurl* fc, const char* predicate, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char per_page_s[4]; char page_s[4]; flickcurl_tag_namespace** tag_namespaces = NULL; - parameters[count][0] = "predicate"; - parameters[count++][1]= predicate; - parameters[count][0] = "per_page"; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "predicate", predicate); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; - parameters[count][0] = "page"; + flickcurl_add_param(fc, "per_page", per_page_s); sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; + flickcurl_add_param(fc, "page", page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.machinetags.getNamespaces", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.machinetags.getNamespaces")) goto tidy; doc = flickcurl_invoke(fc); @@ -134,28 +130,24 @@ const char* predicate, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char per_page_s[4]; char page_s[4]; flickcurl_tag_predicate_value** tag_pvs = NULL; - parameters[count][0] = "namespace"; - parameters[count++][1]= nspace; - parameters[count][0] = "predicate"; - parameters[count++][1]= predicate; - parameters[count][0] = "per_page"; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "namespace", nspace); + flickcurl_add_param(fc, "predicate", predicate); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; - parameters[count][0] = "page"; + flickcurl_add_param(fc, "per_page", per_page_s); sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; + flickcurl_add_param(fc, "page", page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.machinetags.getPairs", parameters, count)) + if(flickcurl_prepare(fc, "flickr.machinetags.getPairs")) goto tidy; doc = flickcurl_invoke(fc); @@ -208,27 +200,23 @@ flickcurl_machinetags_getPredicates(flickcurl* fc, const char *nspace, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char per_page_s[4]; char page_s[4]; flickcurl_tag_predicate_value** tag_pvs = NULL; - parameters[count][0] = "namespace"; - parameters[count++][1]= nspace; - parameters[count][0] = "per_page"; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "namespace", nspace); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; - parameters[count][0] = "page"; + flickcurl_add_param(fc, "per_page", per_page_s); sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; + flickcurl_add_param(fc, "page", page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.machinetags.getPredicates", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.machinetags.getPredicates")) goto tidy; doc = flickcurl_invoke(fc); @@ -283,31 +271,27 @@ const char* predicate, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char per_page_s[4]; char page_s[4]; flickcurl_tag_predicate_value** tag_pvs = NULL; + flickcurl_init_params(fc); + if(!nspace || !predicate) return NULL; - parameters[count][0] = "namespace"; - parameters[count++][1]= nspace; - parameters[count][0] = "predicate"; - parameters[count++][1]= predicate; - parameters[count][0] = "per_page"; + flickcurl_add_param(fc, "namespace", nspace); + flickcurl_add_param(fc, "predicate", predicate); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; - parameters[count][0] = "page"; + flickcurl_add_param(fc, "per_page", per_page_s); sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; + flickcurl_add_param(fc, "page", page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.machinetags.getValues", parameters, count)) + if(flickcurl_prepare(fc, "flickr.machinetags.getValues")) goto tidy; doc = flickcurl_invoke(fc); @@ -357,33 +341,29 @@ const char* predicate, int added_since) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag_predicate_value** tag_pvs = NULL; char added_since_s[20]; + flickcurl_init_params(fc); + if(nspace) { - parameters[count][0] = "namespace"; - parameters[count++][1]= nspace; + flickcurl_add_param(fc, "namespace", nspace); } if(predicate) { - parameters[count][0] = "predicate"; - parameters[count++][1]= predicate; + flickcurl_add_param(fc, "predicate", predicate); } if(added_since >= 0) { sprintf(added_since_s, "%d", added_since); - parameters[count][0] = "added_since"; - parameters[count++][1]= added_since_s; + flickcurl_add_param(fc, "added_since", added_since_s); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.machinetags.getRecentValues", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.machinetags.getRecentValues")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/machinetags.c flickcurl-1.24/src/machinetags.c --- flickcurl-1.22/src/machinetags.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/machinetags.c 2012-08-29 03:42:02.000000000 +0000 @@ -98,11 +98,12 @@ tn = (flickcurl_tag_namespace*)calloc(sizeof(flickcurl_tag_namespace), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, (const char*)attr->children->content, attr_len + 1); if(!strcmp(attr_name, "usage")) { tn->usage_count = atoi(attr_value); @@ -110,14 +111,16 @@ } else if(!strcmp(attr_name, "predicates")) { tn->predicates_count = atoi(attr_value); free(attr_value); - } + } else + free(attr_value); } /* Walk children for text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - tn->name = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(tn->name, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + tn->name = (char*)malloc(len + 1); + memcpy(tn->name, chnode->content, len + 1); } } @@ -247,11 +250,12 @@ tpv = (flickcurl_tag_predicate_value*)calloc(sizeof(flickcurl_tag_predicate_value), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "usage")) { tpv->usage_count = atoi(attr_value); @@ -263,16 +267,18 @@ tpv->predicate = attr_value; } else if(!strcmp(attr_name, "value")) { tpv->value = attr_value; - } + } else + free(attr_value); } if(content_mode >= 1 && content_mode <= 2) { /* Walk children for predicate */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { + size_t len = strlen((const char*)chnode->content); char **ptr = (content_mode == 1) ? &tpv->predicate : &tpv->value; - *ptr = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(*ptr, (const char*)chnode->content); + *ptr = (char*)malloc(len + 1); + memcpy(*ptr, chnode->content, len + 1); } } } diff -Nru flickcurl-1.22/src/md5.c flickcurl-1.24/src/md5.c --- flickcurl-1.22/src/md5.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/md5.c 2013-04-09 05:02:49.000000000 +0000 @@ -221,7 +221,6 @@ MD5Transform(ctx->buf, (u32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(ctx->digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ } diff -Nru flickcurl-1.22/src/members.c flickcurl-1.24/src/members.c --- flickcurl-1.22/src/members.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/members.c 2012-08-29 02:58:29.000000000 +0000 @@ -115,11 +115,12 @@ member_object = (flickcurl_member*)calloc(sizeof(flickcurl_member), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "nsid")) member_object->nsid = attr_value; diff -Nru flickcurl-1.22/src/method.c flickcurl-1.24/src/method.c --- flickcurl-1.22/src/method.c 2011-05-09 04:12:51.000000000 +0000 +++ flickcurl-1.24/src/method.c 2012-08-29 01:48:38.000000000 +0000 @@ -156,8 +156,11 @@ &method->args_count); tidy: - if(fc->failed) + if(fc->failed) { + if(method) + free(method); method = NULL; + } return method; } diff -Nru flickcurl-1.22/src/note.c flickcurl-1.24/src/note.c --- flickcurl-1.22/src/note.c 2010-07-24 16:58:06.000000000 +0000 +++ flickcurl-1.24/src/note.c 2012-08-29 02:58:29.000000000 +0000 @@ -96,11 +96,12 @@ n = (flickcurl_note*)calloc(sizeof(flickcurl_note), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) { n->id = atoi(attr_value); @@ -121,14 +122,16 @@ } else if(!strcmp(attr_name, "h")) { n->h = atoi(attr_value); free(attr_value); - } + } else + free(attr_value); } /* Walk children nodes for text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - n->text = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(n->text, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + n->text = (char*)malloc(len + 1); + memcpy(n->text, chnode->content, len + 1); } } diff -Nru flickcurl-1.22/src/oauth.c flickcurl-1.24/src/oauth.c --- flickcurl-1.22/src/oauth.c 2011-11-12 02:27:03.000000000 +0000 +++ flickcurl-1.24/src/oauth.c 2013-04-11 04:52:16.000000000 +0000 @@ -2,7 +2,7 @@ * * oauth.c - OAuth 1.0 for Flickr * - * Copyright (C) 2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2011-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -169,6 +169,13 @@ if(od->data) free(od->data); + + if(od->username) + free(od->username); + + if(od->user_nsid) + free(od->user_nsid); + } @@ -200,7 +207,7 @@ else od->key_len += od->token_secret_len; - od->key = malloc(od->key_len + 1); /* for NUL */ + od->key = (unsigned char*)malloc(od->key_len + 1); /* for NUL */ if(!od->key) return 1; @@ -258,9 +265,9 @@ static void -flickcurl_sort_args(flickcurl *fc, const char *parameters[][2], int count) +flickcurl_sort_args(flickcurl *fc) { - qsort((void*)parameters, count, sizeof(char*[2]), compare_args); + qsort((void*)fc->parameters, fc->count, sizeof(char*[2]), compare_args); } @@ -276,7 +283,6 @@ const char* method, const char* upload_field, const char* upload_value, - const char* parameters[][2], int count, int parameters_in_url, int need_auth) { flickcurl_oauth_data* od = &fc->od; @@ -284,15 +290,16 @@ char *signature_string = NULL; size_t* values_len = NULL; unsigned int fc_uri_len = 0; + unsigned int full_uri_len = 0; char* nonce = NULL; int free_nonce = 0; char* timestamp = NULL; int rc = 0; int need_to_add_query = 0; - const char* http_method = "GET"; int is_oauth_method = 0; + char *p; - if(!url || !parameters) + if(!url) return 1; /* If one is given, both are required */ @@ -337,8 +344,10 @@ if(fc->method) free(fc->method); - if(method) { - fc->method = strdup(method); + if(method) { + size_t len = strlen(method); + fc->method = (char*)malloc(len + 1); + memcpy(fc->method, method, len + 1); is_oauth_method = !strncmp(method, "flickr.oauth.", 13); } else fc->method = NULL; @@ -357,18 +366,13 @@ * oauth_token access token or request token */ - if(fc->method && !is_oauth_method) { - parameters[count][0] = "method"; - parameters[count++][1]= fc->method; - } + if(fc->method && !is_oauth_method) + flickcurl_add_param(fc, "method", fc->method); - if(od->callback) { - parameters[count][0] = "oauth_callback"; - parameters[count++][1]= od->callback; - } + if(od->callback) + flickcurl_add_param(fc, "oauth_callback", od->callback); - parameters[count][0] = "oauth_consumer_key"; - parameters[count++][1]= od->client_key; + flickcurl_add_param(fc, "oauth_consumer_key", od->client_key); nonce = (char*)od->nonce; if(!nonce) { @@ -376,12 +380,10 @@ free_nonce = 1; sprintf(nonce, "%ld", mtwist_u32rand(fc->mt)); } - parameters[count][0] = "oauth_nonce"; - parameters[count++][1]= nonce; + flickcurl_add_param(fc, "oauth_nonce", nonce); /* oauth_signature - computed over these fields */ - parameters[count][0] = "oauth_signature_method"; - parameters[count++][1]= "HMAC-SHA1"; + flickcurl_add_param(fc, "oauth_signature_method", "HMAC-SHA1"); timestamp = (char*)malloc(20); if(od->timestamp) @@ -391,64 +393,63 @@ (void)gettimeofday(&tp, NULL); sprintf(timestamp, "%ld", (long)tp.tv_sec); } - parameters[count][0] = "oauth_timestamp"; - parameters[count++][1]= timestamp; + flickcurl_add_param(fc, "oauth_timestamp", timestamp); - parameters[count][0] = "oauth_version"; - parameters[count++][1]= "1.0"; + flickcurl_add_param(fc, "oauth_version", "1.0"); - if(od->token) { - parameters[count][0] = "oauth_token"; - parameters[count++][1]= od->token; - } else if(od->request_token) { - parameters[count][0] = "oauth_token"; - parameters[count++][1]= od->request_token; - } - if(od->verifier) { - parameters[count][0] = "oauth_verifier"; - parameters[count++][1]= od->verifier; - } + if(od->token) + flickcurl_add_param(fc, "oauth_token", od->token); + else if(od->request_token) + flickcurl_add_param(fc, "oauth_token", od->request_token); - parameters[count][0] = NULL; + if(od->verifier) + flickcurl_add_param(fc, "oauth_verifier", od->verifier); + + flickcurl_end_params(fc); /* +FLICKCURL_FLICKCURL_MAX_OAUTH_PARAM_COUNT for oauth fields +1 for NULL terminating pointer */ - fc->param_fields = (char**)calloc(count + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1, sizeof(char*)); - fc->param_values = (char**)calloc(count + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1, sizeof(char*)); - values_len = (size_t*)calloc(count + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1, sizeof(size_t)); + fc->param_fields = (char**)calloc(fc->count + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1, sizeof(char*)); + fc->param_values = (char**)calloc(fc->count + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1, sizeof(char*)); + values_len = (size_t*)calloc(fc->count + FLICKCURL_MAX_OAUTH_PARAM_COUNT + 1, sizeof(size_t)); if((need_auth && (od->client_secret || od->token_secret)) || fc->sign) - flickcurl_sort_args(fc, parameters, count); + flickcurl_sort_args(fc); fc_uri_len = strlen(url); - if(url[fc_uri_len -1] != '?') + full_uri_len = fc_uri_len; + + if(url[fc_uri_len - 1] != '?') need_to_add_query++; /* Save away the parameters and calculate the value lengths */ - for(i = 0; parameters[i][0]; i++) { - size_t param_len = strlen(parameters[i][0]); + for(i = 0; fc->parameters[i][0]; i++) { + size_t param_len = strlen(fc->parameters[i][0]); - if(parameters[i][1]) - values_len[i] = strlen(parameters[i][1]); + if(fc->parameters[i][1]) + values_len[i] = strlen(fc->parameters[i][1]); else { values_len[i] = 0; - parameters[i][1] = ""; + fc->parameters[i][1] = ""; } fc->param_fields[i] = (char*)malloc(param_len + 1); - strcpy(fc->param_fields[i], parameters[i][0]); + memcpy(fc->param_fields[i], fc->parameters[i][0], param_len + 1); + fc->param_values[i] = (char*)malloc(values_len[i] + 1); - strcpy(fc->param_values[i], parameters[i][1]); + memcpy(fc->param_values[i], fc->parameters[i][1], values_len[i] + 1); /* 3x value len is conservative URI %XX escaping on every char */ - fc_uri_len += param_len + 1 /* = */ + 3 * values_len[i]; + full_uri_len += param_len + 1 /* = */ + 3 * values_len[i]; } if(upload_field) { - fc->upload_field = (char*)malloc(strlen(upload_field) + 1); - strcpy(fc->upload_field, upload_field); - - fc->upload_value = (char*)malloc(strlen(upload_value) + 1); - strcpy(fc->upload_value, upload_value); + size_t len = strlen(upload_field); + fc->upload_field = (char*)malloc(len + 1); + memcpy(fc->upload_field, upload_field, len + 1); + + len = strlen(upload_value); + fc->upload_value = (char*)malloc(len + 1); + memcpy(fc->upload_value, upload_value, len + 1); } @@ -460,39 +461,66 @@ size_t param_buf_len = 0; size_t vlen = 0; char *escaped_value = NULL; + const char* http_method; + size_t http_method_len; + size_t escaped_value_len; - for(i = 0; parameters[i][0]; i++) - param_buf_len += strlen(parameters[i][0]) + 3 + (3 * values_len[i]) + 3; + for(i = 0; fc->parameters[i][0]; i++) + param_buf_len += strlen(fc->parameters[i][0]) + 3 + (3 * values_len[i]) + 3; param_buf = (char*)malloc(param_buf_len + 1); *param_buf = '\0'; - for(i = 0; parameters[i][0]; i++) { + p = param_buf; + + for(i = 0; fc->parameters[i][0]; i++) { + size_t len = strlen(fc->parameters[i][0]); if(i > 0) - strcat(param_buf, "&"); - strcat(param_buf, parameters[i][0]); - strcat(param_buf, "="); - escaped_value = curl_escape(parameters[i][1], 0); - strcat(param_buf, escaped_value); + *p++ = '&'; + memcpy(p, fc->parameters[i][0], len); + p += len; + + *p++ = '='; + + escaped_value = curl_escape(fc->parameters[i][1], 0); + escaped_value_len = strlen(escaped_value); + memcpy(p, escaped_value, escaped_value_len); + p += escaped_value_len; curl_free(escaped_value); } + *p = '\0'; + + http_method = (upload_field || fc->is_write) ? "POST" : "GET"; + http_method_len = (upload_field || fc->is_write) ? 4 : 3; - buf_len = strlen(http_method); + buf_len = http_method_len; buf_len += 1; /* & */ buf_len += (3 * strlen(url)); buf_len += 1; /* & */ buf_len += param_buf_len * 3; buf = (char*)malloc(buf_len + 1); - strcpy(buf, http_method); - strcat(buf, "&"); + + p = buf; + memcpy(p, http_method, http_method_len); + p += http_method_len; + + *p++ = '&'; + escaped_value = curl_escape(url, 0); - strcat(buf, escaped_value); + escaped_value_len = strlen(escaped_value); + memcpy(p, escaped_value, escaped_value_len); + p += escaped_value_len; curl_free(escaped_value); - strcat(buf, "&"); + + *p++ = '&'; + escaped_value = curl_escape(param_buf, 0); - strcat(buf, escaped_value); + escaped_value_len = strlen(escaped_value); + memcpy(p, escaped_value, escaped_value_len); + p += escaped_value_len; curl_free(escaped_value); - + *p = '\0'; + free(param_buf); if(flickcurl_oauth_build_key(od)) { @@ -517,20 +545,21 @@ free(od->key); od->key = NULL; - parameters[count][0] = "oauth_signature"; - parameters[count][1] = signature_string; - + flickcurl_add_param(fc, "oauth_signature", signature_string); + fc->count--; + /* Add a new parameter pair */ - values_len[count] = vlen; + values_len[fc->count] = vlen; /* 15 = strlen(oauth_signature) */ - fc->param_fields[count] = (char*)malloc(15 + 1); - strcpy(fc->param_fields[count], parameters[count][0]); - fc->param_values[count] = (char*)malloc(vlen + 1); - strcpy(fc->param_values[count], parameters[count][1]); + fc->param_fields[fc->count] = (char*)malloc(15 + 1); + memcpy(fc->param_fields[fc->count], fc->parameters[fc->count][0], 15 + 1); - fc_uri_len += 15 /* "oauth_signature" */ + 1 /* = */ + vlen; + fc->param_values[fc->count] = (char*)malloc(vlen + 1); + memcpy(fc->param_values[fc->count], fc->parameters[fc->count][1], vlen + 1); - count++; + full_uri_len += 15 /* "oauth_signature" */ + 1 /* = */ + vlen; + + fc->count++; #ifdef FLICKCURL_DEBUG fprintf(stderr, "HMAC-SHA1 signature:\n %s\n", signature_string); @@ -540,41 +569,50 @@ od->data = NULL; od->data_len = 0; - parameters[count][0] = NULL; + flickcurl_end_params(fc); } - /* add &s between parameters */ - fc_uri_len += count-1; + /* add &s between fc->parameters */ + full_uri_len += fc->count - 1; /* reuse or grow uri buffer */ - if(fc->uri_len < fc_uri_len) { + if(fc->uri_len < full_uri_len) { free(fc->uri); - fc->uri = (char*)malloc(fc_uri_len+1); - fc->uri_len = fc_uri_len; + fc->uri = (char*)malloc(full_uri_len + 1); + fc->uri_len = full_uri_len; } - strcpy(fc->uri, url); + memcpy(fc->uri, url, fc_uri_len); + + p = fc->uri + fc_uri_len; + *p = '\0'; if(need_to_add_query) - strcat(fc->uri, "?"); + *p++ = '?'; if(parameters_in_url) { - for(i = 0; parameters[i][0]; i++) { - char *value = (char*)parameters[i][1]; - char *escaped_value = NULL; + for(i = 0; fc->parameters[i][0]; i++) { + char *value = (char*)fc->parameters[i][1]; + size_t len; - if(!parameters[i][1]) + if(!fc->parameters[i][1]) continue; - strcat(fc->uri, parameters[i][0]); - strcat(fc->uri, "="); - escaped_value = curl_escape(value, values_len[i]); - strcat(fc->uri, escaped_value); - curl_free(escaped_value); - strcat(fc->uri, "&"); + len = strlen(fc->parameters[i][0]); + memcpy(p, fc->parameters[i][0], len); + p += len; + *p++ = '='; + + value = curl_escape(value, values_len[i]); + len = strlen(value); + memcpy(p, value, len); + p += len; + curl_free(value); + + *p++ = '&'; } - /* zap last & */ - fc->uri[strlen(fc->uri)-1] = '\0'; + /* zap last & and terminate fc->url */ + *--p = '\0'; } #ifdef FLICKCURL_DEBUG @@ -602,44 +640,50 @@ -/* - * flickcurl_oauth_request_token: +/** + * flickcurl_oauth_create_request_token: * @fc: flickcurl object + * @callback: callback URL or NULL for out of band * - * INTERNAL - get a Flickr OAuth request token + * Request an OAuth request token from Flickr for the application API Key/secret * - * Calls the Flickr OAuth endpoint to get a request token. + * Requires the OAuth Client key (API key) and Client secret to have + * been set with flickcurl_set_oauth_client_key() and + * flickcurl_set_oauth_client_secret() respectively. + * + * Calls the Flickr OAuth endpoint to get a request token for the + * given callback or uses out-of-band if @callback is NULL. * - * Stores the request token in @od fields 'request_token' and - * 'request_token_secret' on success. + * On success, stores the request token in the @fc structure. * * Return value: non-0 on failure */ int -flickcurl_oauth_request_token(flickcurl* fc) +flickcurl_oauth_create_request_token(flickcurl* fc, const char* callback) { flickcurl_oauth_data* od = &fc->od; - const char * parameters[2 + FLICKCURL_MAX_OAUTH_PARAM_COUNT][2]; - int count = 0; char* request_token = NULL; char* request_token_secret = NULL; char** form = NULL; int rc = 0; const char* uri = fc->oauth_request_token_uri; int i; + int count; - parameters[count][0] = NULL; + flickcurl_end_params(fc); /* Require signature */ flickcurl_set_sign(fc); - od->callback = "oob"; + if(!callback || !*callback) + callback = "oob"; + od->callback = callback; + rc = flickcurl_oauth_prepare_common(fc, uri, /* method */ "flickr.oauth.request_token", /* upload_field */ NULL, /* upload_value */ NULL, - parameters, count, /* parameters_in_url */ 1, /* need_auth */ 1); od->callback = NULL; @@ -668,10 +712,15 @@ if(request_token && request_token_secret) { /* Take copies that are owned by od */ - od->request_token = strdup(request_token); - od->request_token_len = strlen(od->request_token); - od->request_token_secret = strdup(request_token_secret); - od->request_token_secret_len = strlen(od->request_token_secret); + size_t len = strlen(request_token); + od->request_token = (char*)malloc(len + 1); + memcpy(od->request_token, request_token, len + 1); + od->request_token_len = len; + + len = strlen(request_token_secret); + od->request_token_secret = (char*)malloc(len + 1); + memcpy(od->request_token_secret, request_token_secret, len + 1); + od->request_token_secret_len = len; #ifdef FLICKCURL_DEBUG fprintf(stderr, @@ -689,15 +738,21 @@ } -/* +/** * flickcurl_oauth_get_authorize_uri: * @fc: flickcurl object * - * INTERNAL - get the URL for the user to authorize an application + * Get the URL for the user to authorize Flickr OAuth of an application * * Forms the URL the user needs to start at to authorize the - * application. The application should pass the verifier to - * flickcurl_oauth_access_token() for the final step in OAuth. + * application. + * + * This function requires flickcurl_oauth_create_request_token() to have + * been called to build a request token / secret pair. + * + * After this function, the application should pass the verifier to + * flickcurl_oauth_create_access_token() for the final step in OAuth along + * with the request token and request token secret. * * Return value: authorize URI or NULL on failure */ @@ -732,38 +787,37 @@ } -/* - * flickcurl_oauth_access_token: +/** + * flickcurl_oauth_create_access_token: * @fc: flickcurl object * @verifier: verifier from OOB authentication * - * INTERNAL - get a Flickr OAuth access token from a verifier + * Get a Flickr OAuth access token from request token credentials and verifier * * Calls the Flickr OAuth access token endpoint using the verifier - * from out of band authentication to get an access token. - * - * Uses the @verifier and the @od fields 'request_token' and - * 'request_token_secret' to get an access token stored which on - * success is stored in the @od fields 'access_token' and - * 'access_token_secret'. The request token fields are deleted on - * success. + * from out of band authentication to get an access token to enable + * authenticated calls to the Flickr API. * * Return value: non-0 on failure */ int -flickcurl_oauth_access_token(flickcurl* fc, const char* verifier) +flickcurl_oauth_create_access_token(flickcurl* fc, const char* verifier) { flickcurl_oauth_data* od = &fc->od; - const char * parameters[2 + FLICKCURL_MAX_OAUTH_PARAM_COUNT][2]; - int count = 0; char* access_token = NULL; char* access_token_secret = NULL; + char* username = NULL; + char* user_nsid = NULL; char** form = NULL; int rc = 0; const char* uri = fc->oauth_access_token_uri; int i; + int count; - parameters[count][0] = NULL; + if(!verifier) + return 1; + + flickcurl_end_params(fc); /* Require signature */ flickcurl_set_sign(fc); @@ -776,7 +830,6 @@ /* method */ "flickr.oauth.access_token", /* upload_field */ NULL, /* upload_value */ NULL, - parameters, count, /* parameters_in_url */ 1, /* need_auth */ 1); @@ -801,17 +854,46 @@ access_token = form[i+1]; } else if(!strcmp(form[i], "oauth_token_secret")) { access_token_secret = form[i+1]; + } else if(!strcmp(form[i], "username")) { + username = form[i+1]; + } else if(!strcmp(form[i], "user_nsid")) { + user_nsid = form[i+1]; } - /* ignoring: fullname, user_nsid, username */ + /* ignoring: fullname */ } if(access_token && access_token_secret) { /* Take copies that are owned by od */ - od->token = strdup(access_token); - od->token_len = strlen(od->token); - od->token_secret = strdup(access_token_secret); - od->token_secret_len = strlen(od->token_secret); + size_t len = strlen(access_token); + od->token = (char*)malloc(len + 1); + memcpy(od->token, access_token, len + 1); + od->token_len = len; + + len = strlen(access_token_secret); + od->token_secret = (char*)malloc(len + 1); + memcpy(od->token_secret, access_token_secret, len + 1); + od->token_secret_len = len; + + if(username) { + len = strlen(username); + od->username = (char*)malloc(len + 1); + memcpy(od->username, username, len + 1); + od->username_len = len; + } else { + od->username = NULL; + od->username_len = 0; + } + if(user_nsid) { + len = strlen(user_nsid); + od->user_nsid = (char*)malloc(len + 1); + memcpy(od->user_nsid, user_nsid, len + 1); + od->user_nsid_len = len; + } else { + od->user_nsid = NULL; + od->user_nsid_len = 0; + } + /* Delete temporary request token and secret */ free(od->request_token); od->request_token = NULL; @@ -835,6 +917,300 @@ return rc; } + + + +/** + * flickcurl_get_oauth_client_key: + * @fc: flickcurl object + * + * Get OAuth Client Key (aka Consumer key, API Key) + * + * See also flickcurl_get_oauth_client_secret() + * + * Return value: client key or NULL if none set + */ +const char* +flickcurl_get_oauth_client_key(flickcurl *fc) +{ + return fc->od.client_key; +} + + +/** + * flickcurl_get_oauth_client_secret: + * @fc: flickcurl object + * + * Get OAuth Client secret + * + * See also flickcurl_get_oauth_client_key() + * + * Return value: client secret or NULL if none set + */ +const char* +flickcurl_get_oauth_client_secret(flickcurl *fc) +{ + return fc->od.client_secret; +} + + +/** + * flickcurl_set_oauth_client_key: + * @fc: flickcurl object + * @client_key: client key (API key) + * + * Set OAuth client key (aka API key) + * + * See also flickcurl_get_oauth_client_key() + */ +void +flickcurl_set_oauth_client_key(flickcurl *fc, const char* client_key) +{ + if(fc->od.client_key) { + free(fc->od.client_key); + fc->od.client_key = NULL; + fc->od.client_key_len = 0; + } + + if(client_key) { + size_t len = strlen(client_key); + fc->od.client_key = (char*)malloc(len + 1); + memcpy(fc->od.client_key, client_key, len + 1); + fc->od.client_key_len = len; + } +} + + +/** + * flickcurl_set_oauth_client_secret: + * @fc: flickcurl object + * @client_secret: client key (shared key) + * + * Set OAuth client key (aka shared secret) + * + * See also flickcurl_set_oauth_client_secret() + */ +void +flickcurl_set_oauth_client_secret(flickcurl *fc, const char* client_secret) +{ + if(fc->od.client_secret) { + free(fc->od.client_secret); + fc->od.client_secret = NULL; + fc->od.client_secret_len = 0; + } + + if(client_secret) { + size_t len = strlen(client_secret); + fc->od.client_secret = (char*)malloc(len + 1); + memcpy(fc->od.client_secret, client_secret, len + 1); + fc->od.client_secret_len = len; + } +} + + +/** + * flickcurl_get_oauth_token: + * @fc: flickcurl object + * + * Get OAuth Token + * + * Return value: auth token or NULL if none set + */ +const char* +flickcurl_get_oauth_token(flickcurl *fc) +{ + return fc->od.token; +} + + +/** + * flickcurl_set_oauth_token: + * @fc: flickcurl object + * @token: auth token + * + * Set OAuth Token + */ +void +flickcurl_set_oauth_token(flickcurl *fc, const char* token) +{ +#if FLICKCURL_DEBUG > 1 + fprintf(stderr, "OAuth token: '%s'\n", token); +#endif + if(fc->od.token) { + free(fc->od.token); + fc->od.token = NULL; + fc->od.token_len = 0; + } + if(token) { + size_t len = strlen(token); + fc->od.token = (char*)malloc(len + 1); + memcpy(fc->od.token, token, len + 1); + fc->od.token_len = len; + } +} + + +/** + * flickcurl_get_oauth_token_secret: + * @fc: flickcurl object + * + * Get OAuth token secret + * + * Return value: secret or NULL if none set + */ +const char* +flickcurl_get_oauth_token_secret(flickcurl* fc) +{ + return fc->od.token_secret; +} + +/** + * flickcurl_get_oauth_username: + * @fc: flickcurl object + * + * Get the username for the authenticated user + * + * Return value: username or NULL if none set + */ +const char* +flickcurl_get_oauth_username(flickcurl* fc) +{ + return fc->od.username; +} + +/** + * flickcurl_get_oauth_user_nsid: + * @fc: flickcurl object + * + * Get the user_nsid for the authenticated user + * + * Return value: user_nsid or NULL if none set + */ +const char* +flickcurl_get_oauth_user_nsid(flickcurl* fc) +{ + return fc->od.user_nsid; +} + +/** + * flickcurl_set_oauth_token_secret: + * @fc: flickcurl object + * @secret: shared secret + * + * Set OAuth token Secret + */ +void +flickcurl_set_oauth_token_secret(flickcurl* fc, const char *secret) +{ +#if FLICKCURL_DEBUG > 1 + fprintf(stderr, "OAuth token secret: '%s'\n", secret); +#endif + if(fc->od.token_secret) { + free(fc->od.token_secret); + fc->od.token_secret = NULL; + fc->od.token_secret_len = 0; + } + + if(secret) { + size_t len = strlen(secret); + fc->od.token_secret = (char*)malloc(len + 1); + memcpy(fc->od.token_secret, secret, len + 1); + fc->od.token_secret_len = len; + } +} + + +/** + * flickcurl_get_oauth_request_token: + * @fc: flickcurl object + * + * Get OAuth request token + * + * Return value: request token or NULL if none set + */ +const char* +flickcurl_get_oauth_request_token(flickcurl* fc) +{ + return fc->od.request_token; +} + + +/** + * flickcurl_get_oauth_request_token_secret: + * @fc: flickcurl object + * + * Get OAuth request token secret + * + * Return value: request token secret or NULL if none set + */ +const char* +flickcurl_get_oauth_request_token_secret(flickcurl* fc) +{ + return fc->od.request_token_secret; +} + + +/** + * flickcurl_set_oauth_request_token: + * @fc: flickcurl object + * @token: request token + * + * Set OAuth request token + * + * See also flickcurl_get_oauth_request_token() + */ +void +flickcurl_set_oauth_request_token(flickcurl *fc, const char* token) +{ +#if FLICKCURL_DEBUG > 1 + fprintf(stderr, "OAuth request token: '%s'\n", token); +#endif + if(fc->od.request_token) { + free(fc->od.request_token); + fc->od.request_token = NULL; + fc->od.request_token_len = 0; + } + + if(token) { + size_t len = strlen(token); + fc->od.request_token = (char*)malloc(len + 1); + memcpy(fc->od.request_token, token, len + 1); + fc->od.request_token_len = len; + } +} + + +/** + * flickcurl_set_oauth_request_token_secret: + * @fc: flickcurl object + * @secret: request token secret + * + * Set OAuth request token secret credentials + * + * See also flickcurl_get_oauth_request_token_secret() + */ +void +flickcurl_set_oauth_request_token_secret(flickcurl *fc, const char* secret) +{ +#if FLICKCURL_DEBUG > 1 + fprintf(stderr, "OAuth request token secret: '%s'\n", secret); +#endif + if(fc->od.request_token_secret) { + free(fc->od.request_token_secret); + fc->od.request_token_secret = NULL; + fc->od.request_token_secret = 0; + } + if(secret) { + size_t len = strlen(secret); + fc->od.request_token_secret = (char*)malloc(len + 1); + memcpy(fc->od.request_token_secret, secret, len + 1); + fc->od.request_token_secret_len = len; + } +} + + + + #endif @@ -902,7 +1278,7 @@ oauth_init_test_secrets(od); - rc = flickcurl_oauth_request_token(fc); + rc = flickcurl_oauth_create_request_token(fc, NULL); memset(od, '\0', sizeof(*od)); @@ -927,7 +1303,7 @@ oauth_init_test_secrets(od); - rc = flickcurl_oauth_access_token(fc, verifier); + rc = flickcurl_oauth_create_access_token(fc, verifier); memset(od, '\0', sizeof(*od)); @@ -1006,11 +1382,21 @@ test_uri_base_string, test_request_parameters); - fprintf(stderr, "%s: key is (%d bytes)\n %s\n", program, (int)od->key_len, od->key); - fprintf(stderr, "%s: expected key is\n %s\n", program, expected_key); - - fprintf(stderr, "%s: data is (%d bytes)\n %s\n", program, (int)od->data_len, od->data); - fprintf(stderr, "%s: expected data is\n %s\n", program, expected_data); + if(strcmp((const char*)od->key, expected_key)) { + fprintf(stderr, "%s: FAIL\n" + " key is (%d bytes)\n %s\n" + " expected key is\n %s\n", + program, (int)od->key_len, od->key, expected_key); + rc++; + } + + if(strcmp((const char*)od->data, expected_data)) { + fprintf(stderr, "%s: FAIL\n" + " data is (%d bytes)\n %s\n" + " expected data is\n %s\n", + program, (int)od->data_len, od->data, expected_data); + rc++; + } signature = flickcurl_oauth_compute_signature(od, &escaped_s_len); @@ -1018,11 +1404,13 @@ free(signature); escaped_s_len = strlen(escaped_s); - fprintf(stdout, "URI Escaped result (%d bytes):\n %s\n", - (int)escaped_s_len, escaped_s); - - fprintf(stdout, "Expected URI escaped result\n %s\n", - expected_signature); + if(strcmp(escaped_s, expected_signature)) { + fprintf(stdout, "%s: FAIL\n" + " URI Escaped result (%d bytes):\n %s\n" + " Expected URI escaped result\n %s\n", + program, (int)escaped_s_len, escaped_s, expected_signature); + rc++; + } curl_free(escaped_s); diff -Nru flickcurl-1.22/src/panda-api.c flickcurl-1.24/src/panda-api.c --- flickcurl-1.22/src/panda-api.c 2011-10-15 19:24:59.000000000 +0000 +++ flickcurl-1.24/src/panda-api.c 2012-08-29 02:58:29.000000000 +0000 @@ -2,7 +2,7 @@ * * flickr.panda-api.c - Flickr flickr.panda.* API calls * - * Copyright (C) 2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2009-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -77,8 +77,9 @@ /* Use first text child node of as panda name */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - panda = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(panda, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + panda = (char*)malloc(len + 1); + memcpy(panda, chnode->content, len + 1); break; } } @@ -121,15 +122,15 @@ char** flickcurl_panda_getList(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char **pandas = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.panda.getList", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.panda.getList")) goto tidy; doc = flickcurl_invoke(fc); @@ -153,8 +154,11 @@ if(xpathCtx) xmlXPathFreeContext(xpathCtx); - if(fc->failed) + if(fc->failed) { + if(pandas) + free(pandas); pandas = NULL; + } return pandas; } @@ -185,21 +189,20 @@ flickcurl_photo** flickcurl_panda_getPhotos(flickcurl *fc, const char *panda_name) { - const char* parameters[8][2]; - int count = 0; flickcurl_photo** photos = NULL; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!panda_name) return NULL; - parameters[count][0] = "panda_name"; - parameters[count++][1]= panda_name; + flickcurl_add_param(fc, "panda_name", panda_name); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.panda.getPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.panda.getPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, diff -Nru flickcurl-1.22/src/people-api.c flickcurl-1.24/src/people-api.c --- flickcurl-1.22/src/people-api.c 2010-05-10 03:12:12.000000000 +0000 +++ flickcurl-1.24/src/people-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * people-api.c - Flickr flickr.people.* API calls * - * Copyright (C) 2007-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -99,18 +99,17 @@ flickcurl_person* flickcurl_people_getInfo(flickcurl* fc, const char* user_id) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_person* person = NULL; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_init_params(fc); - parameters[count][0] = NULL; + flickcurl_add_param(fc, "user_id", user_id); - if(flickcurl_prepare(fc, "flickr.people.getInfo", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.people.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -150,21 +149,20 @@ flickcurl_group** flickcurl_people_getPublicGroups(flickcurl* fc, const char* user_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_group** groups = NULL; + flickcurl_init_params(fc); + if(!user_id) return NULL; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.people.getPublicGroups", parameters, count)) + if(flickcurl_prepare(fc, "flickr.people.getPublicGroups")) goto tidy; doc = flickcurl_invoke(fc); @@ -214,24 +212,23 @@ flickcurl_people_getPublicPhotos_params(flickcurl* fc, const char* user_id, flickcurl_photos_list_params* list_params) { - const char* parameters[12][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!user_id) return NULL; /* API parameters */ - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.people.getPublicPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.people.getPublicPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -306,15 +303,15 @@ flickcurl_user_upload_status* flickcurl_people_getUploadStatus(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_user_upload_status* status = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.people.getUploadStatus", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.people.getUploadStatus")) goto tidy; doc = flickcurl_invoke(fc); @@ -374,57 +371,49 @@ int privacy_filter, flickcurl_photos_list_params* list_params) { - const char* parameters[18][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; char safe_search_s[4]; char content_type_s[4]; char privacy_filter_s[4]; + flickcurl_init_params(fc); + if(!user_id) return NULL; - parameters[count][0] = "user_id"; - parameters[count++][1] = user_id; + flickcurl_add_param(fc, "user_id", user_id); if(safe_search >= 0 && safe_search < 10) { sprintf(safe_search_s, "%d", safe_search); - parameters[count][0] = "safe_search"; - parameters[count++][1] = safe_search_s; + flickcurl_add_param(fc, "safe_search", safe_search_s); } if(min_upload_date) { - parameters[count][0] = "min_upload_date"; - parameters[count++][1] = min_upload_date; + flickcurl_add_param(fc, "min_upload_date", min_upload_date); } if(max_upload_date) { - parameters[count][0] = "max_upload_date"; - parameters[count++][1] = max_upload_date; + flickcurl_add_param(fc, "max_upload_date", max_upload_date); } if(min_taken_date) { - parameters[count][0] = "min_taken_date"; - parameters[count++][1] = min_taken_date; + flickcurl_add_param(fc, "min_taken_date", min_taken_date); } if(max_taken_date) { - parameters[count][0] = "max_taken_date"; - parameters[count++][1] = max_taken_date; + flickcurl_add_param(fc, "max_taken_date", max_taken_date); } if(content_type >= 0 && content_type < 10) { sprintf(content_type_s, "%d", content_type); - parameters[count][0] = "content_type"; - parameters[count++][1] = content_type_s; + flickcurl_add_param(fc, "content_type", content_type_s); } if(privacy_filter >= 0 && privacy_filter < 10) { sprintf(privacy_filter_s, "%d", privacy_filter); - parameters[count][0] = "privacy_filter"; - parameters[count++][1] = privacy_filter_s; + flickcurl_add_param(fc, "privacy_filter", privacy_filter_s); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.people.getPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.people.getPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -526,23 +515,22 @@ flickcurl_people_getPhotosOf_params(flickcurl* fc, const char* user_id, flickcurl_photos_list_params* list_params) { - const char* parameters[11][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!user_id) return photos_list; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.people.getPhotosOf", parameters, count)) + if(flickcurl_prepare(fc, "flickr.people.getPhotosOf")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, diff -Nru flickcurl-1.22/src/perms.c flickcurl-1.24/src/perms.c --- flickcurl-1.22/src/perms.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/perms.c 2012-08-29 02:58:29.000000000 +0000 @@ -85,11 +85,12 @@ perms = (flickcurl_perms*)calloc(sizeof(flickcurl_perms), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) ; /* perms->id = attr_value; */ @@ -105,6 +106,8 @@ perms->perm_comment = atoi(attr_value); else if(!strcmp(attr_name, "permaddmeta")) perms->perm_addmeta = atoi(attr_value); + + free(attr_value); } diff -Nru flickcurl-1.22/src/person.c flickcurl-1.24/src/person.c --- flickcurl-1.22/src/person.c 2011-05-09 04:12:51.000000000 +0000 +++ flickcurl-1.24/src/person.c 2012-08-29 05:15:21.000000000 +0000 @@ -2,7 +2,7 @@ * * person.c - Flickr person support calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -244,7 +244,7 @@ int i; xpathExpr_len = strlen((const char*)xpathExpr); - strncpy((char*)full_xpath, (const char*)xpathExpr, xpathExpr_len+1); + memcpy(full_xpath, xpathExpr, xpathExpr_len + 1); xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); if(!xpathObj) { @@ -261,7 +261,7 @@ for(i = 0, person_count = 0; i < nodes_count; i++) { xmlNodePtr node = nodes->nodeTab[i]; - flickcurl_person* person; + flickcurl_person* person = NULL; int expri; xmlXPathContextPtr xpathNodeCtx = NULL; @@ -358,10 +358,22 @@ #endif if(fc->failed) - goto tidy; + break; + } /* end for person fields */ + + if(fc->failed) { + if(person) + flickcurl_free_person(person); + } else { + persons[person_count++] = person; } + + if(xpathNodeCtx) + xmlXPathFreeContext(xpathNodeCtx); + + if(fc->failed) + goto tidy; - persons[person_count++] = person; } /* for persons */ if(person_count_p) @@ -371,8 +383,11 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); - if(fc->failed) + if(fc->failed) { + if(persons) + flickcurl_free_persons(persons); persons = NULL; + } return persons; } diff -Nru flickcurl-1.22/src/photo.c flickcurl-1.24/src/photo.c --- flickcurl-1.22/src/photo.c 2011-10-15 19:24:59.000000000 +0000 +++ flickcurl-1.24/src/photo.c 2012-08-29 05:15:21.000000000 +0000 @@ -2,7 +2,7 @@ * * photo.c - Flickcurl photo functions * - * Copyright (C) 2007-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -203,8 +203,8 @@ photo->fields[PHOTO_FIELD_secret].string); } len = strlen(buf); - result = (char*)malloc(len+1); - strcpy(result, buf); + result = (char*)malloc(len + 1); + memcpy(result, buf, len + 1); return result; } @@ -229,8 +229,8 @@ photo->fields[PHOTO_FIELD_owner_nsid].string, photo->id); len = strlen(buf); - result = (char*)malloc(len+1); - strncpy(result, buf, len+1); + result = (char*)malloc(len + 1); + memcpy(result, buf, len + 1); return result; } @@ -286,7 +286,7 @@ return NULL; r = result; - strncpy(result, short_uri_prefix, SHORT_URI_PREFIX_LEN); + memcpy(result, short_uri_prefix, SHORT_URI_PREFIX_LEN); r += SHORT_URI_PREFIX_LEN; /* now copy it backwards into new result string */ while(p != buf) @@ -405,18 +405,21 @@ { char buf[1024]; char *result; - size_t len; - if(server && farm && nsid) - /* http://farm{icon-farm}.static.flickr.com/{icon-server}/buddyicons/{nsid}.jpg */ + if(server && farm && nsid) { + size_t len; + /* http://farm{icon-farm}.static.flickr.com/{icon-server}/buddyicons/{nsid}.jpg */ sprintf(buf, "http://farm%d.static.flickr.com/%d/buddicons/%s.jpg", - farm, server, nsid); - else - strcpy(buf, "http://www.flickr.com/images/buddyicon.jpg"); + farm, server, nsid); + len = strlen(buf); + result = (char*)malloc(len + 1); + memcpy(result, buf, len + 1); + } else { + #define MAGIC_LEN 42 + result = (char*)malloc(MAGIC_LEN + 1); + memcpy(result, "http://www.flickr.com/images/buddyicon.jpg", MAGIC_LEN + 1); + } - len = strlen(buf); - result = (char*)malloc(len+1); - strncpy(result, buf, len+1); return result; } @@ -968,7 +971,7 @@ int i; xpathExpr_len = strlen((const char*)xpathExpr); - strncpy((char*)full_xpath, (const char*)xpathExpr, xpathExpr_len+1); + memcpy(full_xpath, xpathExpr, xpathExpr_len + 1); xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx); if(!xpathObj) { @@ -1060,8 +1063,8 @@ string_value, (long)unix_time, new_value); #endif free(string_value); - string_value= new_value; - int_value= (int)unix_time; + string_value = new_value; + int_value = (int)unix_time; datatype = VALUE_TYPE_DATETIME; } else /* failed to convert, make it a string */ @@ -1072,6 +1075,7 @@ case VALUE_TYPE_BOOLEAN: if(!*string_value && datatype == VALUE_TYPE_BOOLEAN) { /* skip setting field with a boolean value '' */ + free(string_value); special = 1; break; } @@ -1084,6 +1088,7 @@ photo->tags = flickcurl_build_tags_from_string(fc, photo, (const char*)string_value, &photo->tags_count); + free(string_value); special = 1; break; @@ -1100,6 +1105,7 @@ abort(); } + /* If special, do not store here */ if(special) continue; @@ -1134,8 +1140,9 @@ &photo->notes_count); if(!photo->media_type) { - photo->media_type = (char*)malloc(6); - strncpy(photo->media_type, "photo", 6); +#define PHOTO_STR_LEN 5 + photo->media_type = (char*)malloc(PHOTO_STR_LEN + 1); + memcpy(photo->media_type, "photo", PHOTO_STR_LEN + 1); } if(xpathNodeCtx) @@ -1150,8 +1157,11 @@ tidy: if(xpathObj) xmlXPathFreeObject(xpathObj); - if(fc->failed) + if(fc->failed) { + if(photos) + flickcurl_free_photos(photos); photos = NULL; + } return photos; } @@ -1215,6 +1225,9 @@ size_t format_len; photos_list = flickcurl_new_photos_list(fc); + if(!photos_list) + return NULL; + if(format) { nformat = format; format_len = strlen(format); @@ -1327,7 +1340,7 @@ fc->failed = 1; goto tidy; } - memcpy(photos_list->format, nformat, format_len+1); + memcpy(photos_list->format, nformat, format_len + 1); tidy: if(xpathNodeCtx) diff -Nru flickcurl-1.22/src/photos-api.c flickcurl-1.24/src/photos-api.c --- flickcurl-1.22/src/photos-api.c 2011-03-01 17:20:53.000000000 +0000 +++ flickcurl-1.24/src/photos-api.c 2013-02-20 19:47:30.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-api.c - Flickr flickr.photos.* API calls * - * Copyright (C) 2007-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -57,22 +57,20 @@ int flickcurl_photos_addTags(flickcurl* fc, const char* photo_id, const char* tags) { - const char * parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; + flickcurl_init_params(fc); + if(!photo_id || !tags) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = "tags"; - parameters[count++][1]= tags; + flickcurl_add_param(fc, "tags", tags); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.addTags", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.addTags")) goto tidy; flickcurl_set_write(fc, 1); @@ -102,20 +100,19 @@ int flickcurl_photos_delete(flickcurl* fc, const char* photo_id) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photo_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.delete", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.delete")) goto tidy; flickcurl_set_write(fc, 1); @@ -152,17 +149,16 @@ flickcurl_context** flickcurl_photos_getAllContexts(flickcurl* fc, const char* photo_id) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; flickcurl_context** contexts = NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_init_params(fc); - parameters[count][0] = NULL; + flickcurl_add_param(fc, "photo_id", photo_id); - if(flickcurl_prepare(fc, "flickr.photos.getAllContexts", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.photos.getAllContexts")) goto tidy; doc = flickcurl_invoke(fc); @@ -204,39 +200,34 @@ int single_photo, int include_self, flickcurl_photos_list_params* list_params) { - const char* parameters[13][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char true_s[2] = "1"; const char* format = NULL; + flickcurl_init_params(fc); + /* API parameters */ if(contact_count > 1) { char count_s[20]; sprintf(count_s, "%d", contact_count); - parameters[count][0] = "count"; - parameters[count++][1]= count_s; + flickcurl_add_param(fc, "count", count_s); } if(just_friends) { - parameters[count][0] = "just_friends"; - parameters[count++][1]= true_s; + flickcurl_add_param(fc, "just_friends", true_s); } if(single_photo) { - parameters[count][0] = "single_photo"; - parameters[count++][1]= true_s; + flickcurl_add_param(fc, "single_photo", true_s); } if(include_self) { - parameters[count][0] = "include_self"; - parameters[count++][1]= true_s; + flickcurl_add_param(fc, "include_self", true_s); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getContactsPhotos", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.getContactsPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -334,42 +325,36 @@ int include_self, flickcurl_photos_list_params* list_params) { - const char* parameters[14][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char true_s[2] = "1"; char photo_count_s[10]; const char* format = NULL; + flickcurl_init_params(fc); + if(!user_id) return NULL; /* API parameters */ - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; - parameters[count][0] = "count"; + flickcurl_add_param(fc, "user_id", user_id); sprintf(photo_count_s, "%d", photo_count); - parameters[count++][1]= photo_count_s; + flickcurl_add_param(fc, "count", photo_count_s); if(just_friends) { - parameters[count][0] = "just_friends"; - parameters[count++][1]= true_s; + flickcurl_add_param(fc, "just_friends", true_s); } if(single_photo) { - parameters[count][0] = "single_photo"; - parameters[count++][1]= true_s; + flickcurl_add_param(fc, "single_photo", true_s); } if(include_self) { - parameters[count][0] = "include_self"; - parameters[count++][1]= true_s; + flickcurl_add_param(fc, "include_self", true_s); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getContactsPublicPhotos", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.getContactsPublicPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -457,17 +442,16 @@ flickcurl_context** flickcurl_photos_getContext(flickcurl* fc, const char* photo_id) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; flickcurl_context** contexts = NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getContext", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getContext")) goto tidy; doc = flickcurl_invoke(fc); @@ -527,11 +511,12 @@ row[j]= -1; for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "count")) { row[0] = atoi(attr_value); @@ -542,7 +527,8 @@ } else if(!strcmp(attr_name, "todate")) { row[2] = atoi(attr_value); free(attr_value); - } + } else + free(attr_value); } #if FLICKCURL_DEBUG > 1 @@ -586,32 +572,30 @@ const char** dates_array, const char** taken_dates_array) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int** counts = NULL; char* dates = NULL; char* taken_dates = NULL; + flickcurl_init_params(fc); + /* one must be not empty */ if(!dates_array && !taken_dates_array) return NULL; if(dates_array) { dates = flickcurl_array_join(dates_array, ','); - parameters[count][0] = "dates"; - parameters[count++][1] = dates; + flickcurl_add_param(fc, "dates", dates); } if(taken_dates_array) { taken_dates = flickcurl_array_join(taken_dates_array, ','); - parameters[count][0] = "taken_dates"; - parameters[count++][1] = taken_dates; + flickcurl_add_param(fc, "taken_dates", taken_dates); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getCounts", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getCounts")) goto tidy; doc = flickcurl_invoke(fc); @@ -634,8 +618,11 @@ if(xpathCtx) xmlXPathFreeContext(xpathCtx); - if(fc->failed) + if(fc->failed) { + if(counts) + free(counts); counts = NULL; + } if(dates) free(dates); @@ -666,25 +653,23 @@ flickcurl_photos_getExif(flickcurl* fc, const char* photo_id, const char* secret) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_exif** exifs = NULL; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); if(secret) { - parameters[count][0] = "secret"; - parameters[count++][1]= secret; + flickcurl_add_param(fc, "secret", secret); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getExif", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getExif")) goto tidy; doc = flickcurl_invoke(fc); @@ -730,29 +715,26 @@ flickcurl_photos_getFavorites(flickcurl* fc, const char* photo_id, int page, int per_page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_person** persons = NULL; char per_page_s[4]; char page_s[4]; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "page"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(page_s, "%d", page); - parameters[count++][1]= page_s; - parameters[count][0] = "per_page"; + flickcurl_add_param(fc, "page", page_s); sprintf(per_page_s, "%d", per_page); - parameters[count++][1]= per_page_s; + flickcurl_add_param(fc, "per_page", per_page_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getFavorites", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getFavorites")) goto tidy; doc = flickcurl_invoke(fc); @@ -782,9 +764,10 @@ /** - * flickcurl_photos_getInfo: + * flickcurl_photos_getInfo2: * @fc: flickcurl context * @photo_id: photo ID + * @secret: secret (or NULL) * * Get information about a photo * @@ -793,20 +776,23 @@ * Return value: #flickcurl_photo or NULL on failure **/ flickcurl_photo* -flickcurl_photos_getInfo(flickcurl* fc, const char* photo_id) +flickcurl_photos_getInfo2(flickcurl* fc, const char* photo_id, + const char* secret) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_photo* photo = NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + if(secret) + flickcurl_add_param(fc, "secret", secret); - if(flickcurl_prepare(fc, "flickr.photos.getInfo", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.photos.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -834,6 +820,25 @@ } +/** + * flickcurl_photos_getInfo: + * @fc: flickcurl context + * @photo_id: photo ID + * + * Get information about a photo + * + * Deprecated for flickcurl_photos_getInfo2() that allows passing the + * optional secret. + * + * Return value: #flickcurl_photo or NULL on failure + **/ +flickcurl_photo* +flickcurl_photos_getInfo(flickcurl* fc, const char* photo_id) +{ + return flickcurl_photos_getInfo2(fc, photo_id, NULL); +} + + static flickcurl_photos_list* flickcurl_get_photoslist_params(flickcurl* fc, const char* method, @@ -843,45 +848,40 @@ int privacy_filter, flickcurl_photos_list_params* list_params) { - const char* parameters[16][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char min_upload_date_s[20]; char max_upload_date_s[20]; char privacy_filter_s[20]; const char* format = NULL; + flickcurl_init_params(fc); + /* API parameters */ if(min_upload_date > 0) { - parameters[count][0] = "min_upload_date"; sprintf(min_upload_date_s, "%d", min_upload_date); - parameters[count++][1]= min_upload_date_s; + flickcurl_add_param(fc, "min_upload_date", min_upload_date_s); } if(max_upload_date > 0) { - parameters[count][0] = "max_upload_date"; sprintf(max_upload_date_s, "%d", max_upload_date); - parameters[count++][1]= max_upload_date_s; + flickcurl_add_param(fc, "max_upload_date", max_upload_date_s); } if(min_taken_date) { - parameters[count][0] = "min_taken_date"; - parameters[count++][1]= min_taken_date; + flickcurl_add_param(fc, "min_taken_date", min_taken_date); } if(max_taken_date) { - parameters[count][0] = "max_taken_date"; - parameters[count++][1]= max_taken_date; + flickcurl_add_param(fc, "max_taken_date", max_taken_date); } if(privacy_filter >= 1 && privacy_filter <= 5) { - parameters[count][0] = "privacy_filter"; sprintf(privacy_filter_s, "%d", privacy_filter); - parameters[count++][1]= privacy_filter_s; + flickcurl_add_param(fc, "privacy_filter", privacy_filter_s); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, method, parameters, count)) + if(flickcurl_prepare(fc, method)) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -1003,21 +1003,20 @@ flickcurl_perms* flickcurl_photos_getPerms(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_perms* perms = NULL; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getPerms", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getPerms")) goto tidy; doc = flickcurl_invoke(fc); @@ -1065,19 +1064,19 @@ flickcurl_photos_getRecent_params(flickcurl* fc, flickcurl_photos_list_params* list_params) { - const char* parameters[11][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + /* No API parameters */ /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getRecent", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getRecent")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -1151,21 +1150,20 @@ flickcurl_size** flickcurl_photos_getSizes(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_size** sizes = NULL; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.getSizes", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.getSizes")) goto tidy; doc = flickcurl_invoke(fc); @@ -1503,28 +1501,27 @@ flickcurl_photos_recentlyUpdated_params(flickcurl* fc, int min_date, flickcurl_photos_list_params* list_params) { - const char* parameters[12][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char min_date_s[20]; const char* format = NULL; + flickcurl_init_params(fc); + if(min_date <= 0) return NULL; /* API parameters */ if(min_date >0) { - parameters[count][0] = "min_date"; sprintf(min_date_s, "%d", min_date); - parameters[count++][1]= min_date_s; + flickcurl_add_param(fc, "min_date", min_date_s); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.recentlyUpdated", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.recentlyUpdated")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -1603,19 +1600,18 @@ int flickcurl_photos_removeTag(flickcurl* fc, const char* tag_id) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; + flickcurl_init_params(fc); + if(!tag_id) return 1; - parameters[count][0] = "tag_id"; - parameters[count++][1]= tag_id; + flickcurl_add_param(fc, "tag_id", tag_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.removeTag", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.removeTag")) goto tidy; flickcurl_set_write(fc, 1); @@ -1691,8 +1687,6 @@ flickcurl_search_params* params, flickcurl_photos_list_params* list_params) { - const char* parameters[40][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char min_upload_date_s[15]; char max_upload_date_s[15]; @@ -1706,156 +1700,110 @@ char geo_context_s[2]; const char* format = NULL; + flickcurl_init_params(fc); + FLICKCURL_ASSERT_OBJECT_POINTER_RETURN_VALUE(params, flickcurl_search_params, NULL); /* Search parameters */ - if(params->user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= params->user_id; - } - if(params->tags) { - parameters[count][0] = "tags"; - parameters[count++][1]= params->tags; - } - if(params->tag_mode) { - parameters[count][0] = "tag_mode"; - parameters[count++][1]= params->tag_mode; - } - if(params->text) { - parameters[count][0] = "text"; - parameters[count++][1]= params->text; - } + if(params->user_id) + flickcurl_add_param(fc, "user_id", params->user_id); + if(params->tags) + flickcurl_add_param(fc, "tags", params->tags); + if(params->tag_mode) + flickcurl_add_param(fc, "tag_mode", params->tag_mode); + if(params->text) + flickcurl_add_param(fc, "text", params->text); if(params->min_upload_date) { sprintf(min_upload_date_s, "%d", params->min_upload_date); - parameters[count][0] = "min_upload_date"; - parameters[count++][1]= min_upload_date_s; + flickcurl_add_param(fc, "min_upload_date", min_upload_date_s); } if(params->max_upload_date) { sprintf(max_upload_date_s, "%d", params->max_upload_date); - parameters[count][0] = "max_upload_date"; - parameters[count++][1]= max_upload_date_s; - } - if(params->min_taken_date) { - parameters[count][0] = "min_taken_date"; - parameters[count++][1]= params->min_taken_date; - } - if(params->max_taken_date) { - parameters[count][0] = "max_taken_date"; - parameters[count++][1]= params->max_taken_date; - } - if(params->license) { - parameters[count][0] = "license"; - parameters[count++][1]= params->license; - } - if(params->sort) { - parameters[count][0] = "sort"; - parameters[count++][1]= params->sort; - } - if(params->privacy_filter) { - parameters[count][0] = "privacy_filter"; - parameters[count++][1]= params->privacy_filter; - } - if(params->bbox) { - parameters[count][0] = "bbox"; - parameters[count++][1]= params->bbox; + flickcurl_add_param(fc, "max_upload_date", max_upload_date_s); } + if(params->min_taken_date) + flickcurl_add_param(fc, "min_taken_date", params->min_taken_date); + if(params->max_taken_date) + flickcurl_add_param(fc, "max_taken_date", params->max_taken_date); + if(params->license) + flickcurl_add_param(fc, "license", params->license); + if(params->sort) + flickcurl_add_param(fc, "sort", params->sort); + if(params->privacy_filter) + flickcurl_add_param(fc, "privacy_filter", params->privacy_filter); + if(params->bbox) + flickcurl_add_param(fc, "bbox", params->bbox); if(params->accuracy) { if(params->accuracy >= 0 && params->accuracy <= 16) { sprintf(accuracy_s, "%d", params->accuracy); - parameters[count][0] = "accuracy"; - parameters[count++][1]= accuracy_s; + flickcurl_add_param(fc, "accuracy", accuracy_s); } } if(params->safe_search) { if(params->safe_search >= 0 && params->safe_search <= 3) { sprintf(safe_search_s, "%d", params->safe_search); - parameters[count][0] = "safe_search"; - parameters[count++][1]= safe_search_s; + flickcurl_add_param(fc, "safe_search", safe_search_s); } } if(params->content_type) { if(params->content_type >= 0 && params->content_type <= 4) { sprintf(content_type_s, "%d", params->content_type); - parameters[count][0] = "content_type"; - parameters[count++][1]= content_type_s; + flickcurl_add_param(fc, "content_type", content_type_s); } } - if(params->machine_tags) { - parameters[count][0] = "machine_tags"; - parameters[count++][1]= params->machine_tags; - } - if(params->machine_tag_mode) { - parameters[count][0] = "machine_tag_mode"; - parameters[count++][1]= params->machine_tag_mode; - } - if(params->group_id) { - parameters[count][0] = "group_id"; - parameters[count++][1]= params->group_id; - } - if(params->place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= params->place_id; - } - if(params->media) { - parameters[count][0] = "media"; - parameters[count++][1]= params->media; - } - if(params->has_geo) { - parameters[count][0] = "has_geo"; - parameters[count++][1]= "1"; - } + if(params->machine_tags) + flickcurl_add_param(fc, "machine_tags", params->machine_tags); + if(params->machine_tag_mode) + flickcurl_add_param(fc, "machine_tag_mode", params->machine_tag_mode); + if(params->group_id) + flickcurl_add_param(fc, "group_id", params->group_id); + if(params->place_id) + flickcurl_add_param(fc, "place_id", params->place_id); + if(params->media) + flickcurl_add_param(fc, "media", params->media); + if(params->has_geo) + flickcurl_add_param(fc, "has_geo", "1"); if(params->geo_context > 0 && params->geo_context < 3) { - parameters[count][0] = "geo_context"; sprintf(geo_context_s, "%d", params->geo_context); - parameters[count++][1]= geo_context_s; + flickcurl_add_param(fc, "geo_context", geo_context_s); } if(params->radius) { if(params->lat) { sprintf(lat_s, "%f", params->lat); - parameters[count][0] = "lat"; - parameters[count++][1]= lat_s; + flickcurl_add_param(fc, "lat", lat_s); } if(params->lon) { sprintf(lon_s, "%f", params->lon); - parameters[count][0] = "lon"; - parameters[count++][1]= lon_s; + flickcurl_add_param(fc, "lon", lon_s); } if(params->radius) { sprintf(radius_s, "%f", params->radius); - parameters[count][0] = "radius"; - parameters[count++][1]= radius_s; + flickcurl_add_param(fc, "radius", radius_s); if(params->radius_units) { - parameters[count][0] = "radius_units"; - parameters[count++][1]= params->radius_units; + flickcurl_add_param(fc, "radius_units", params->radius_units); } } } if(params->contacts && params->user_id) { - parameters[count][0] = "contacts"; - parameters[count++][1]= params->contacts; + flickcurl_add_param(fc, "contacts", params->contacts); } if(params->woe_id > 0) { sprintf(woe_id_s, "%d", params->woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_s; - } - if(params->is_commons) { - parameters[count][0] = "is_commons"; - parameters[count++][1]= ""; - } - if(params->in_gallery) { - parameters[count][0] = "in_gallery"; - parameters[count++][1]= ""; + flickcurl_add_param(fc, "woe_id", woe_id_s); } + if(params->is_commons) + flickcurl_add_param(fc, "is_commons", ""); + if(params->in_gallery) + flickcurl_add_param(fc, "in_gallery", ""); /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.search", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.search")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -1940,27 +1888,25 @@ flickcurl_photos_setContentType(flickcurl* fc, const char* photo_id, int content_type) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char content_type_str[2]; + flickcurl_init_params(fc); + if(!photo_id || !content_type) return 1; if(content_type <1 || content_type > 3) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "content_type"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(content_type_str, "%d", content_type); - parameters[count++][1]= content_type_str; + flickcurl_add_param(fc, "content_type", content_type_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.setContentType", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.setContentType")) goto tidy; flickcurl_set_write(fc, 1); @@ -1999,8 +1945,6 @@ int date_posted, int date_taken, int date_taken_granularity) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int result = 1; @@ -2008,6 +1952,8 @@ char* date_taken_str = NULL; char date_taken_granularity_str[3]; + flickcurl_init_params(fc); + if(!photo_id) return 1; @@ -2018,28 +1964,25 @@ if(date_taken_granularity > 10) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); if(date_posted >= 0) { - parameters[count][0] = "date_posted"; /* posted date is always a unix time */ sprintf(date_posted_str, "%d", date_posted); - parameters[count++][1]= date_posted_str; + flickcurl_add_param(fc, "date_posted", date_posted_str); } if(date_taken >= 0) { - parameters[count][0] = "date_taken"; /* taken date is always a SQL timestamp */ date_taken_str = flickcurl_unixtime_to_sqltimestamp(date_taken); + flickcurl_add_param(fc, "date_taken", date_taken_str); } if(date_taken_granularity >= 0) { - parameters[count][0] = "date_taken_granularity"; sprintf(date_taken_granularity_str, "%d", date_taken_granularity); - parameters[count++][1]= date_taken_granularity_str; + flickcurl_add_param(fc, "date_taken_granularity", date_taken_granularity_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.setDates", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.setDates")) goto tidy; flickcurl_set_write(fc, 1); @@ -2090,25 +2033,22 @@ flickcurl_photos_setMeta(flickcurl* fc, const char* photo_id, const char* title, const char* description) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photo_id || !title || !description) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "title"; - parameters[count++][1]= title; - parameters[count][0] = "description"; - parameters[count++][1]= description; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "title", title); + flickcurl_add_param(fc, "description", description); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.setMeta", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.setMeta")) goto tidy; flickcurl_set_write(fc, 1); @@ -2155,8 +2095,6 @@ flickcurl_photos_setPerms(flickcurl* fc, const char* photo_id, flickcurl_perms* perms) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int result = 1; @@ -2166,6 +2104,8 @@ char perm_comment_str[2]; char perm_addmeta_str[2]; + flickcurl_init_params(fc); + if(!photo_id || !perms) return 1; @@ -2175,27 +2115,21 @@ if(perms->perm_addmeta <0 || perms->perm_addmeta >3) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "is_public"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(is_public_str, "%d", (perms->is_public ? 1 : 0)); - parameters[count++][1]= is_public_str; - parameters[count][0] = "is_friend"; + flickcurl_add_param(fc, "is_public", is_public_str); sprintf(is_friend_str, "%d", (perms->is_friend ? 1 : 0)); - parameters[count++][1]= is_friend_str; - parameters[count][0] = "is_family"; + flickcurl_add_param(fc, "is_friend", is_friend_str); sprintf(is_family_str, "%d", (perms->is_family ? 1 : 0)); - parameters[count++][1]= is_family_str; - parameters[count][0] = "perm_comment"; + flickcurl_add_param(fc, "is_family", is_family_str); sprintf(perm_comment_str, "%d", perms->perm_comment); - parameters[count++][1]= perm_comment_str; - parameters[count][0] = "perm_addmeta"; + flickcurl_add_param(fc, "perm_comment", perm_comment_str); sprintf(perm_addmeta_str, "%d", perms->perm_addmeta); - parameters[count++][1]= perm_addmeta_str; + flickcurl_add_param(fc, "perm_addmeta", perm_addmeta_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.setPerms", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.setPerms")) goto tidy; flickcurl_set_write(fc, 1); @@ -2243,36 +2177,33 @@ flickcurl_photos_setSafetyLevel(flickcurl* fc, const char* photo_id, int safety_level, int hidden) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int result = 1; char safety_level_str[2]; char hidden_str[2]; + flickcurl_init_params(fc); + if(!photo_id) return 1; if(safety_level <= 0 && hidden <0) return 0; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); if(safety_level >0) { - parameters[count][0] = "safety_level"; sprintf(safety_level_str, "%d", safety_level); - parameters[count++][1]= safety_level_str; + flickcurl_add_param(fc, "safety_level", safety_level_str); } if(hidden >= 0) { - parameters[count][0] = "hidden"; sprintf(hidden_str, "%d", hidden ? 1 : 0); - parameters[count++][1]= hidden_str; + flickcurl_add_param(fc, "hidden", hidden_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.setSafetyLevel", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.setSafetyLevel")) goto tidy; flickcurl_set_write(fc, 1); @@ -2320,22 +2251,20 @@ int flickcurl_photos_setTags(flickcurl* fc, const char* photo_id, const char* tags) { - const char * parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; + flickcurl_init_params(fc); + if(!photo_id || !tags) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = "tags"; - parameters[count++][1]= tags; + flickcurl_add_param(fc, "tags", tags); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.setTags", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.setTags")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/photos-comments-api.c flickcurl-1.24/src/photos-comments-api.c --- flickcurl-1.22/src/photos-comments-api.c 2010-09-30 03:52:30.000000000 +0000 +++ flickcurl-1.24/src/photos-comments-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-comments-api.c - Flickr flickr.photos.comments.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -58,24 +58,21 @@ flickcurl_photos_comments_addComment(flickcurl* fc, const char* photo_id, const char* comment_text) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* id = NULL; + flickcurl_init_params(fc); + if(!photo_id || !comment_text) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "comment_text"; - parameters[count++][1]= comment_text; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "comment_text", comment_text); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.comments.addComment", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.comments.addComment")) goto tidy; flickcurl_set_write(fc, 1); @@ -119,21 +116,19 @@ int flickcurl_photos_comments_deleteComment(flickcurl* fc, const char* comment_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!comment_id) return 1; - parameters[count][0] = "comment_id"; - parameters[count++][1]= comment_id; + flickcurl_add_param(fc, "comment_id", comment_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.comments.deleteComment", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.comments.deleteComment")) goto tidy; flickcurl_set_write(fc, 1); @@ -169,23 +164,20 @@ flickcurl_photos_comments_editComment(flickcurl* fc, const char* comment_id, const char* comment_text) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!comment_id || !comment_text) return 1; - parameters[count][0] = "comment_id"; - parameters[count++][1]= comment_id; - parameters[count][0] = "comment_text"; - parameters[count++][1]= comment_text; + flickcurl_add_param(fc, "comment_id", comment_id); + flickcurl_add_param(fc, "comment_text", comment_text); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.comments.editComment", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.comments.editComment")) goto tidy; flickcurl_set_write(fc, 1); @@ -219,22 +211,21 @@ flickcurl_comment** flickcurl_photos_comments_getList(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_comment** comments = NULL; int comments_count = 0; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.comments.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.comments.getList")) goto tidy; doc = flickcurl_invoke(fc); @@ -284,29 +275,26 @@ const char* contacts_filter, flickcurl_photos_list_params* list_params) { - const char* parameters[12][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; char date_lastcomment_str[20]; + flickcurl_init_params(fc); + /* API parameters */ if(date_lastcomment >= 0) { - parameters[count][0] = "date_lastcomment"; sprintf(date_lastcomment_str, "%d", date_lastcomment); - parameters[count++][1]= date_lastcomment_str; + flickcurl_add_param(fc, "date_lastcomment", date_lastcomment_str); } if(contacts_filter) { - parameters[count][0] = "contacts_filter"; - parameters[count++][1]= contacts_filter; + flickcurl_add_param(fc, "contacts_filter", contacts_filter); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); - parameters[count][0] = NULL; + flickcurl_append_photos_list_params(fc, list_params, &format); + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.comments.getRecentForContacts", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.comments.getRecentForContacts")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, diff -Nru flickcurl-1.22/src/photos-geo-api.c flickcurl-1.24/src/photos-geo-api.c --- flickcurl-1.22/src/photos-geo-api.c 2010-09-30 03:52:30.000000000 +0000 +++ flickcurl-1.24/src/photos-geo-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-geo-api.c - Flickr flickr.photos.geo.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -67,8 +67,6 @@ flickcurl_location* location, const char* place_id, int woe_id) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; char latitude_s[50]; char longitude_s[50]; @@ -76,6 +74,8 @@ char woe_id_str[10]; int result = 0; + flickcurl_init_params(fc); + if(!place_id || !woe_id) return 1; @@ -91,28 +91,22 @@ location->accuracy = 0; - parameters[count][0] = "lat"; sprintf(latitude_s, "%f", location->latitude); - parameters[count++][1]= latitude_s; - parameters[count][0] = "lon"; + flickcurl_add_param(fc, "lat", latitude_s); sprintf(longitude_s, "%f", location->longitude); - parameters[count++][1]= longitude_s; - parameters[count][0] = "accuracy"; + flickcurl_add_param(fc, "lon", longitude_s); sprintf(accuracy_s, "%d", location->accuracy); - parameters[count++][1]= accuracy_s; + flickcurl_add_param(fc, "accuracy", accuracy_s); if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } if(woe_id > 0) { sprintf(woe_id_str, "%d", woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.batchCorrectLocation", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.batchCorrectLocation")) goto tidy; flickcurl_set_write(fc, 1); @@ -151,29 +145,25 @@ flickcurl_photos_geo_correctLocation(flickcurl* fc, const char* photo_id, const char* place_id, int woe_id) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; void* result = NULL; char woe_id_str[10]; + flickcurl_init_params(fc); + if(!photo_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "place_id", place_id); if(woe_id > 0) { sprintf(woe_id_str, "%d", woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.correctLocation")) goto tidy; doc = flickcurl_invoke(fc); @@ -215,21 +205,20 @@ flickcurl_location* flickcurl_photos_geo_getLocation(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_location* location = NULL; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.getLocation", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.getLocation")) goto tidy; doc = flickcurl_invoke(fc); @@ -272,21 +261,20 @@ flickcurl_perms* flickcurl_photos_geo_getPerms(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_perms* perms = NULL; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.getPerms", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.getPerms")) goto tidy; doc = flickcurl_invoke(fc); @@ -331,14 +319,14 @@ flickcurl_location* location, flickcurl_photos_list_params* list_params) { - const char* parameters[13][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char latitude_s[50]; char longitude_s[50]; char accuracy_s[50]; const char* format = NULL; + flickcurl_init_params(fc); + if(!location) return NULL; @@ -354,23 +342,19 @@ location->accuracy = 0; - parameters[count][0] = "lat"; sprintf(latitude_s, "%f", location->latitude); - parameters[count++][1]= latitude_s; - parameters[count][0] = "lon"; + flickcurl_add_param(fc, "lat", latitude_s); sprintf(longitude_s, "%f", location->longitude); - parameters[count++][1]= longitude_s; - parameters[count][0] = "accuracy"; + flickcurl_add_param(fc, "lon", longitude_s); sprintf(accuracy_s, "%d", location->accuracy); - parameters[count++][1]= accuracy_s; + flickcurl_add_param(fc, "accuracy", accuracy_s); /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.photosForLocation", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.photosForLocation")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -447,20 +431,18 @@ int flickcurl_photos_geo_removeLocation(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; + flickcurl_init_params(fc); + if(!photo_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.removeLocation", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.removeLocation")) goto tidy; flickcurl_set_write(fc, 1); @@ -495,25 +477,23 @@ flickcurl_photos_geo_setContext(flickcurl* fc, const char* photo_id, int context) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char context_str[3]; void* result = NULL; + flickcurl_init_params(fc); + if(!photo_id || context < 0 || context > 2) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "context"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(context_str, "%d", context); - parameters[count++][1]= context_str; + flickcurl_add_param(fc, "context", context_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.setContext", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.setContext")) goto tidy; flickcurl_set_write(fc, 1); @@ -561,14 +541,14 @@ flickcurl_photos_geo_setLocation(flickcurl* fc, const char* photo_id, flickcurl_location* location) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; char latitude_s[50]; char longitude_s[50]; char accuracy_s[50]; int result = 1; + flickcurl_init_params(fc); + if(!photo_id) return 1; @@ -584,23 +564,19 @@ location->accuracy = 0; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "lat"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(latitude_s, "%f", location->latitude); - parameters[count++][1]= latitude_s; - parameters[count][0] = "lon"; + flickcurl_add_param(fc, "lat", latitude_s); sprintf(longitude_s, "%f", location->longitude); - parameters[count++][1]= longitude_s; + flickcurl_add_param(fc, "lon", longitude_s); if(location->accuracy >= 1) { - parameters[count][0] = "accuracy"; sprintf(accuracy_s, "%d", location->accuracy); - parameters[count++][1]= accuracy_s; + flickcurl_add_param(fc, "accuracy", accuracy_s); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.setLocation", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.setLocation")) goto tidy; flickcurl_set_write(fc, 1); @@ -636,8 +612,6 @@ flickcurl_photos_geo_setPerms(flickcurl* fc, const char* photo_id, flickcurl_perms* perms) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; char is_public_str[2]; char is_contact_str[2]; @@ -645,27 +619,24 @@ char is_family_str[2]; int result = 1; + flickcurl_init_params(fc); + if(!photo_id || !perms) return 1; - parameters[count][0] = "is_public"; sprintf(is_public_str, "%d", (perms->is_public ? 1 : 0)); - parameters[count++][1]= is_public_str; - parameters[count][0] = "is_contact"; + flickcurl_add_param(fc, "is_public", is_public_str); sprintf(is_contact_str, "%d", (perms->is_contact ? 1 : 0)); - parameters[count++][1]= is_contact_str; - parameters[count][0] = "is_friend"; + flickcurl_add_param(fc, "is_contact", is_contact_str); sprintf(is_friend_str, "%d", (perms->is_friend ? 1 : 0)); - parameters[count++][1]= is_friend_str; - parameters[count][0] = "is_family"; + flickcurl_add_param(fc, "is_friend", is_friend_str); sprintf(is_family_str, "%d", (perms->is_family ? 1 : 0)); - parameters[count++][1]= is_family_str; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "is_family", is_family_str); + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.geo.setPerms", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.geo.setPerms")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/photos-licenses-api.c flickcurl-1.24/src/photos-licenses-api.c --- flickcurl-1.22/src/photos-licenses-api.c 2010-01-02 19:42:59.000000000 +0000 +++ flickcurl-1.24/src/photos-licenses-api.c 2012-08-29 02:58:29.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-licenses.c - Flickr flickr.photos.licenses.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -60,8 +60,6 @@ static void flickcurl_read_licenses(flickcurl *fc) { - const char * parameters[5][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; @@ -70,9 +68,11 @@ int i; int size; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.licenses.getInfo", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.photos.licenses.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -113,11 +113,12 @@ l = (flickcurl_license*)calloc(sizeof(flickcurl_license), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) { l->id = atoi(attr_value); @@ -129,7 +130,8 @@ l->url = attr_value; else free(attr_value); - } + } else + free(attr_value); } #if FLICKCURL_DEBUG > 1 @@ -219,25 +221,22 @@ flickcurl_photos_licenses_setLicense(flickcurl* fc, const char* photo_id, int license_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char license_id_s[5]; + flickcurl_init_params(fc); + if(!photo_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "license_id"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(license_id_s, "%d", license_id); - parameters[count++][1]= license_id_s; + flickcurl_add_param(fc, "license_id", license_id_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.licenses.setLicense", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.licenses.setLicense")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/photos-notes-api.c flickcurl-1.24/src/photos-notes-api.c --- flickcurl-1.22/src/photos-notes-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/photos-notes-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-notes-api.c - Flickr flickr.photos.notes.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -66,8 +66,6 @@ int note_x, int note_y, int note_w, int note_h, const char* note_text) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char *id = NULL; @@ -76,29 +74,25 @@ char note_w_s[10]; char note_h_s[10]; + flickcurl_init_params(fc); + if(!photo_id || !note_text) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "note_x"; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(note_x_s, "%d", note_x); - parameters[count++][1]= note_x_s; - parameters[count][0] = "note_y"; + flickcurl_add_param(fc, "note_x", note_x_s); sprintf(note_y_s, "%d", note_y); - parameters[count++][1]= note_y_s; - parameters[count][0] = "note_w"; + flickcurl_add_param(fc, "note_y", note_y_s); sprintf(note_w_s, "%d", note_w); - parameters[count++][1]= note_w_s; - parameters[count][0] = "note_h"; + flickcurl_add_param(fc, "note_w", note_w_s); sprintf(note_h_s, "%d", note_h); - parameters[count++][1]= note_h_s; - parameters[count][0] = "note_text"; - parameters[count++][1]= note_text; + flickcurl_add_param(fc, "note_h", note_h_s); + flickcurl_add_param(fc, "note_text", note_text); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.notes.add", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.notes.add")) goto tidy; flickcurl_set_write(fc, 1); @@ -143,20 +137,19 @@ int flickcurl_photos_notes_delete(flickcurl* fc, const char* note_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!note_id) return 1; - parameters[count][0] = "note_id"; - parameters[count++][1]= note_id; + flickcurl_add_param(fc, "note_id", note_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.notes.delete", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.notes.delete")) goto tidy; flickcurl_set_write(fc, 1); @@ -199,8 +192,6 @@ int note_x, int note_y, int note_w, int note_h, const char* note_text) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char note_x_s[10]; @@ -208,29 +199,25 @@ char note_w_s[10]; char note_h_s[10]; + flickcurl_init_params(fc); + if(!note_id || !note_text) return 1; - parameters[count][0] = "note_id"; - parameters[count++][1]= note_id; - parameters[count][0] = "note_x"; + flickcurl_add_param(fc, "note_id", note_id); sprintf(note_x_s, "%d", note_x); - parameters[count++][1]= note_x_s; - parameters[count][0] = "note_y"; + flickcurl_add_param(fc, "note_x", note_x_s); sprintf(note_y_s, "%d", note_y); - parameters[count++][1]= note_y_s; - parameters[count][0] = "note_w"; + flickcurl_add_param(fc, "note_y", note_y_s); sprintf(note_w_s, "%d", note_w); - parameters[count++][1]= note_w_s; - parameters[count][0] = "note_h"; + flickcurl_add_param(fc, "note_w", note_w_s); sprintf(note_h_s, "%d", note_h); - parameters[count++][1]= note_h_s; - parameters[count][0] = "note_text"; - parameters[count++][1]= note_text; + flickcurl_add_param(fc, "note_h", note_h_s); + flickcurl_add_param(fc, "note_text", note_text); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.notes.edit", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.notes.edit")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/photos-people-api.c flickcurl-1.24/src/photos-people-api.c --- flickcurl-1.22/src/photos-people-api.c 2010-01-22 00:56:15.000000000 +0000 +++ flickcurl-1.24/src/photos-people-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-people-api.c - Flickr flickr.photos.people.* API calls * - * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2010-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -63,8 +63,6 @@ int person_x, int person_y, int person_w, int person_h) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int rc = 0; @@ -73,38 +71,34 @@ char person_w_str[10]; char person_h_str[10]; + flickcurl_init_params(fc); + if(!photo_id || !user_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "user_id", user_id); if(person_x >= 0) { sprintf(person_x_str, "%d", person_x); - parameters[count][0] = "person_x"; - parameters[count++][1]= person_x_str; + flickcurl_add_param(fc, "person_x", person_x_str); } if(person_y >= 0) { sprintf(person_y_str, "%d", person_y); - parameters[count][0] = "person_y"; - parameters[count++][1]= person_y_str; + flickcurl_add_param(fc, "person_y", person_y_str); } if(person_w >= 0) { sprintf(person_w_str, "%d", person_w); - parameters[count][0] = "person_w"; - parameters[count++][1]= person_w_str; + flickcurl_add_param(fc, "person_w", person_w_str); } if(person_h >= 0) { sprintf(person_h_str, "%d", person_h); - parameters[count][0] = "person_h"; - parameters[count++][1]= person_h_str; + flickcurl_add_param(fc, "person_h", person_h_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.people.add", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.people.add")) goto tidy; flickcurl_set_write(fc, 1); @@ -152,23 +146,21 @@ flickcurl_photos_people_delete(flickcurl* fc, const char* photo_id, const char* user_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; void* result = NULL; + flickcurl_init_params(fc); + if(!photo_id || !user_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "user_id", user_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.people.delete", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.people.delete")) goto tidy; flickcurl_set_write(fc, 1); @@ -216,24 +208,21 @@ flickcurl_photos_people_deleteCoords(flickcurl* fc, const char* photo_id, const char* user_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; void* result = NULL; + flickcurl_init_params(fc); + if(!photo_id || !user_id) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "user_id", user_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.people.deleteCoords", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.people.deleteCoords")) goto tidy; flickcurl_set_write(fc, 1); @@ -287,8 +276,6 @@ int person_x, int person_y, int person_w, int person_h) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; int rc = 0; @@ -297,32 +284,27 @@ char person_w_str[10]; char person_h_str[10]; + flickcurl_init_params(fc); + if(!photo_id || !user_id || person_x < 0 || person_y < 0 || person_w <0 || person_h < 0) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "user_id", user_id); sprintf(person_x_str, "%d", person_x); - parameters[count][0] = "person_x"; - parameters[count++][1]= person_x_str; + flickcurl_add_param(fc, "person_x", person_x_str); sprintf(person_y_str, "%d", person_y); - parameters[count][0] = "person_y"; - parameters[count++][1]= person_y_str; + flickcurl_add_param(fc, "person_y", person_y_str); sprintf(person_w_str, "%d", person_w); - parameters[count][0] = "person_w"; - parameters[count++][1]= person_w_str; + flickcurl_add_param(fc, "person_w", person_w_str); sprintf(person_h_str, "%d", person_h); - parameters[count][0] = "person_h"; - parameters[count++][1]= person_h_str; + flickcurl_add_param(fc, "person_h", person_h_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.people.editCoords", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photos.people.editCoords")) goto tidy; flickcurl_set_write(fc, 1); @@ -368,21 +350,20 @@ flickcurl_person** flickcurl_photos_people_getList(flickcurl* fc, const char* photo_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_person** people = NULL; + flickcurl_init_params(fc); + if(!photo_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.people.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.people.getList")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/photos-transform-api.c flickcurl-1.24/src/photos-transform-api.c --- flickcurl-1.22/src/photos-transform-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/photos-transform-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photos-transform-api.c - Flickr flickr.photos.transform.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -58,24 +58,22 @@ flickcurl_photos_transform_rotate(flickcurl* fc, const char* photo_id, int degrees) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; char degrees_str[4]; int result = 0; + flickcurl_init_params(fc); + if(!photo_id || !(degrees == 90 || degrees == 180 || degrees == 270)) return 1; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); sprintf(degrees_str, "%d", degrees); - parameters[count][0] = "degrees"; - parameters[count++][1]= degrees_str; + flickcurl_add_param(fc, "degrees", degrees_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.transform.rotate", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.transform.rotate")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/photos-upload-api.c flickcurl-1.24/src/photos-upload-api.c --- flickcurl-1.22/src/photos-upload-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/photos-upload-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * flickr.photos.upload-api.c - Flickr flickr.photos.upload.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -57,23 +57,22 @@ flickcurl_photos_upload_checkTickets(flickcurl* fc, const char** tickets_ids) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_ticket** tickets = NULL; char* tickets_ids_string = NULL; + flickcurl_init_params(fc); + if(!tickets_ids) return NULL; tickets_ids_string = flickcurl_array_join(tickets_ids, ','); - parameters[count][0] = "tickets"; - parameters[count++][1]= tickets_ids_string; + flickcurl_add_param(fc, "tickets", tickets_ids_string); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photos.upload.checkTickets", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photos.upload.checkTickets")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/photoset.c flickcurl-1.24/src/photoset.c --- flickcurl-1.22/src/photoset.c 2011-03-29 20:25:41.000000000 +0000 +++ flickcurl-1.24/src/photoset.c 2012-08-29 02:58:29.000000000 +0000 @@ -126,11 +126,12 @@ ps = (flickcurl_photoset*)calloc(sizeof(flickcurl_photoset), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) ps->id = attr_value; @@ -159,13 +160,15 @@ if(chnode->type == XML_ELEMENT_NODE) { if(!strcmp(chnode_name, "title")) { if(chnode->children) { - ps->title = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(ps->title, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + ps->title = (char*)malloc(len + 1); + memcpy(ps->title, chnode->children->content, len + 1); } } else if(!strcmp(chnode_name, "description")) { if(chnode->children) { - ps->description = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(ps->description, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + ps->description = (char*)malloc(len + 1); + memcpy(ps->description, chnode->children->content, len + 1); } } } diff -Nru flickcurl-1.22/src/photosets-api.c flickcurl-1.24/src/photosets-api.c --- flickcurl-1.22/src/photosets-api.c 2011-05-09 04:12:51.000000000 +0000 +++ flickcurl-1.24/src/photosets-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photosets-api.c - Flickr flickr.photosets.* API calls * - * Copyright (C) 2007-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -58,22 +58,20 @@ flickcurl_photosets_addPhoto(flickcurl* fc, const char* photoset_id, const char* photo_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photoset_id || !photo_id) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.addPhoto", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.addPhoto")) goto tidy; flickcurl_set_write(fc, 1); @@ -113,27 +111,24 @@ const char* primary_photo_id, char** photoset_url_p) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* photoset_id = NULL; + flickcurl_init_params(fc); + if(!title || !primary_photo_id) return NULL; - parameters[count][0] = "title"; - parameters[count++][1]= title; + flickcurl_add_param(fc, "title", title); if(description) { - parameters[count][0] = "description"; - parameters[count++][1]= description; + flickcurl_add_param(fc, "description", description); } - parameters[count][0] = "primary_photo_id"; - parameters[count++][1]= primary_photo_id; + flickcurl_add_param(fc, "primary_photo_id", primary_photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.create", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.create")) goto tidy; flickcurl_set_write(fc, 1); @@ -182,19 +177,18 @@ int flickcurl_photosets_delete(flickcurl* fc, const char* photoset_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; + flickcurl_init_params(fc); + if(!photoset_id) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.delete", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.delete")) goto tidy; flickcurl_set_write(fc, 1); @@ -227,26 +221,23 @@ flickcurl_photosets_editMeta(flickcurl* fc, const char* photoset_id, const char* title, const char* description) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photoset_id || !title) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "title"; - parameters[count++][1]= title; + flickcurl_add_param(fc, "photoset_id", photoset_id); + flickcurl_add_param(fc, "title", title); if(description) { - parameters[count][0] = "description"; - parameters[count++][1]= description; + flickcurl_add_param(fc, "description", description); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.editMeta", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.editMeta")) goto tidy; flickcurl_set_write(fc, 1); @@ -286,26 +277,23 @@ const char* primary_photo_id, const char** photo_ids_array) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char* photo_ids = NULL; + flickcurl_init_params(fc); + if(!photoset_id || !primary_photo_id || !photo_ids_array) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "primary_photo_id"; - parameters[count++][1]= primary_photo_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); + flickcurl_add_param(fc, "primary_photo_id", primary_photo_id); photo_ids = flickcurl_array_join(photo_ids_array, ','); - parameters[count][0] = "photo_ids"; - parameters[count++][1]= photo_ids; + flickcurl_add_param(fc, "photo_ids", photo_ids); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.editPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.editPhotos")) goto tidy; flickcurl_set_write(fc, 1); @@ -344,23 +332,21 @@ flickcurl_photosets_getContext(flickcurl* fc, const char* photo_id, const char* photoset_id) { - const char * parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; flickcurl_context** contexts = NULL; + flickcurl_init_params(fc); + if(!photo_id || !photoset_id) return NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.getContext", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.getContext")) goto tidy; doc = flickcurl_invoke(fc); @@ -391,21 +377,20 @@ flickcurl_photoset* flickcurl_photosets_getInfo(flickcurl* fc, const char* photoset_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_photoset* photoset = NULL; + flickcurl_init_params(fc); + if(!photoset_id) return NULL; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.getInfo", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -447,20 +432,19 @@ flickcurl_photoset** flickcurl_photosets_getList(flickcurl* fc, const char* user_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_photoset** photoset_list = NULL; + flickcurl_init_params(fc); + if(user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.getList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.getList")) goto tidy; doc = flickcurl_invoke(fc); @@ -512,30 +496,28 @@ int privacy_filter, flickcurl_photos_list_params* list_params) { - const char* parameters[13][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; char privacy_filter_str[2]; const char* format = NULL; + flickcurl_init_params(fc); + if(!photoset_id) return NULL; /* API parameters */ - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); if(privacy_filter >= 1 && privacy_filter <= 5) { - parameters[count][0] = "privacy_filter"; sprintf(privacy_filter_str, "%d", privacy_filter); - parameters[count++][1]= privacy_filter_str; + flickcurl_add_param(fc, "privacy_filter", privacy_filter_str); } /* Photos List parameters */ - flickcurl_append_photos_list_params(list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.getPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.getPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -614,22 +596,21 @@ int flickcurl_photosets_orderSets(flickcurl* fc, const char** photoset_ids_array) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char* photoset_ids; + flickcurl_init_params(fc); + if(!photoset_ids_array) return 1; photoset_ids = flickcurl_array_join(photoset_ids_array, ','); - parameters[count][0] = "photoset_ids"; - parameters[count++][1]= photoset_ids; + flickcurl_add_param(fc, "photoset_ids", photoset_ids); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.orderSets", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.orderSets")) goto tidy; doc = flickcurl_invoke(fc); @@ -664,22 +645,20 @@ flickcurl_photosets_removePhoto(flickcurl* fc, const char* photoset_id, const char* photo_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photoset_id || !photo_id) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.removePhoto", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.removePhoto")) goto tidy; flickcurl_set_write(fc, 1); @@ -715,24 +694,22 @@ flickcurl_photosets_removePhotos(flickcurl* fc, const char* photoset_id, const char** photo_ids_array) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char* photo_ids = NULL; + flickcurl_init_params(fc); + if(!photoset_id || !photo_ids_array) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "photo_ids"; + flickcurl_add_param(fc, "photoset_id", photoset_id); photo_ids = flickcurl_array_join(photo_ids_array, ','); - parameters[count++][1]= photo_ids; + flickcurl_add_param(fc, "photo_ids", photo_ids); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.removePhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.removePhotos")) goto tidy; flickcurl_set_write(fc, 1); @@ -771,24 +748,22 @@ flickcurl_photosets_reorderPhotos(flickcurl* fc, const char* photoset_id, const char** photo_ids_array) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; char* photo_ids = NULL; + flickcurl_init_params(fc); + if(!photoset_id || !photo_ids_array) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "photo_ids"; + flickcurl_add_param(fc, "photoset_id", photoset_id); photo_ids = flickcurl_array_join(photo_ids_array, ','); - parameters[count++][1]= photo_ids; + flickcurl_add_param(fc, "photo_ids", photo_ids); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.reorderPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.reorderPhotos")) goto tidy; doc = flickcurl_invoke(fc); @@ -824,23 +799,20 @@ flickcurl_photosets_setPrimaryPhoto(flickcurl* fc, const char* photoset_id, const char* photo_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!photoset_id || !photo_id) return 1; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.setPrimaryPhoto", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photosets.setPrimaryPhoto")) goto tidy; flickcurl_set_write(fc, 1); diff -Nru flickcurl-1.22/src/photosets-comments-api.c flickcurl-1.24/src/photosets-comments-api.c --- flickcurl-1.22/src/photosets-comments-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/photosets-comments-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * photosets-comments-api.c - Flickr flickr.photosets.comments.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -59,24 +59,21 @@ const char* photoset_id, const char* comment_text) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* id = NULL; + flickcurl_init_params(fc); + if(!photoset_id || !comment_text) return NULL; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; - parameters[count][0] = "comment_text"; - parameters[count++][1]= comment_text; + flickcurl_add_param(fc, "photoset_id", photoset_id); + flickcurl_add_param(fc, "comment_text", comment_text); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.comments.addComment", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photosets.comments.addComment")) goto tidy; flickcurl_set_write(fc, 1); @@ -122,21 +119,19 @@ flickcurl_photosets_comments_deleteComment(flickcurl* fc, const char* comment_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!comment_id) return 1; - parameters[count][0] = "comment_id"; - parameters[count++][1]= comment_id; + flickcurl_add_param(fc, "comment_id", comment_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.comments.deleteComment", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.photosets.comments.deleteComment")) goto tidy; flickcurl_set_write(fc, 1); @@ -173,23 +168,20 @@ const char* comment_id, const char* comment_text) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; int result = 1; + flickcurl_init_params(fc); + if(!comment_id || !comment_text) return 1; - parameters[count][0] = "comment_id"; - parameters[count++][1]= comment_id; - parameters[count][0] = "comment_text"; - parameters[count++][1]= comment_text; + flickcurl_add_param(fc, "comment_id", comment_id); + flickcurl_add_param(fc, "comment_text", comment_text); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.comments.editComment", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photosets.comments.editComment")) goto tidy; flickcurl_set_write(fc, 1); @@ -223,23 +215,21 @@ flickcurl_comment** flickcurl_photosets_comments_getList(flickcurl* fc, const char* photoset_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_comment** comments = NULL; int comments_count = 0; + flickcurl_init_params(fc); + if(!photoset_id) return NULL; - parameters[count][0] = "photoset_id"; - parameters[count++][1]= photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.photosets.comments.getList", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.photosets.comments.getList")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/place.c flickcurl-1.24/src/place.c --- flickcurl-1.22/src/place.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/place.c 2012-08-29 02:58:29.000000000 +0000 @@ -559,8 +559,11 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); - if(fc->failed) + if(fc->failed) { + if(places) + flickcurl_free_places(places); places = NULL; + } return places; } @@ -667,7 +670,8 @@ nodes = xpathObj->nodesetval; /* This is a max size - it can include nodes that are CDATA */ nodes_count = xmlXPathNodeSetGetLength(nodes); - place_types = (flickcurl_place_type_info**)calloc(sizeof(flickcurl_place_type*), nodes_count + 1); + place_types = (flickcurl_place_type_info**)calloc(nodes_count + 1, + sizeof(flickcurl_place_type_info*)); for(i = 0, place_type_count = 0; i < nodes_count; i++) { xmlNodePtr node = nodes->nodeTab[i]; @@ -681,27 +685,30 @@ break; } - pt = (flickcurl_place_type_info*)calloc(sizeof(flickcurl_place_type), 1); + pt = (flickcurl_place_type_info*)calloc(1, sizeof(*pt)); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) { pt->id = atoi(attr_value); free(attr_value); pt->type = flickcurl_place_id_to_type(pt->id); - } + } else + free(attr_value); } /* Walk children nodes for name text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - pt->name = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(pt->name, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + pt->name = (char*)malloc(len + 1); + memcpy(pt->name, chnode->content, len + 1); } } diff -Nru flickcurl-1.22/src/places-api.c flickcurl-1.24/src/places-api.c --- flickcurl-1.22/src/places-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/places-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -5,7 +5,7 @@ * Places API announced 2008-01-11 * http://tech.groups.yahoo.com/group/yws-flickr/message/3688 * - * Copyright (C) 2008-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -67,21 +67,20 @@ flickcurl_place** flickcurl_places_find(flickcurl* fc, const char* query) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place** places = NULL; + flickcurl_init_params(fc); + if(!query) return NULL; - parameters[count][0] = "query"; - parameters[count++][1]= query; + flickcurl_add_param(fc, "query", query); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.find", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.find")) goto tidy; doc = flickcurl_invoke(fc); @@ -134,8 +133,6 @@ flickcurl_places_findByLatLon(flickcurl* fc, double lat, double lon, int accuracy) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place* place = NULL; @@ -143,22 +140,21 @@ char lon_str[20]; char accuracy_str[4]; + flickcurl_init_params(fc); + if(accuracy < 0 || accuracy > 16) accuracy = 16; sprintf(lat_str, "%f", lat); - parameters[count][0] = "lat"; - parameters[count++][1]= lat_str; + flickcurl_add_param(fc, "lat", lat_str); sprintf(lon_str, "%f", lon); - parameters[count][0] = "lon"; - parameters[count++][1]= lon_str; + flickcurl_add_param(fc, "lon", lon_str); sprintf(accuracy_str, "%d", accuracy); - parameters[count][0] = "accuracy"; - parameters[count++][1]= accuracy_str; + flickcurl_add_param(fc, "accuracy", accuracy_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.findByLatLon", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.findByLatLon")) goto tidy; doc = flickcurl_invoke(fc); @@ -232,27 +228,24 @@ flickcurl_places_getChildrenWithPhotosPublic2(flickcurl* fc, const char* place_id, int woe_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place** places = NULL; char woe_id_str[10]; + flickcurl_init_params(fc); + if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } else if(woe_id >= 0) { sprintf(woe_id_str, "%d", woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } else return NULL; - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.getChildrenWithPhotosPublic", - parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.getChildrenWithPhotosPublic")) goto tidy; doc = flickcurl_invoke(fc); @@ -330,26 +323,24 @@ flickcurl_place* flickcurl_places_getInfo2(flickcurl* fc, const char* place_id, int woe_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place* place = NULL; char woe_id_str[10]; + flickcurl_init_params(fc); + if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } else if(woe_id >= 0) { sprintf(woe_id_str, "%d", woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } else return NULL; - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare_noauth(fc, "flickr.places.getInfo", parameters, count)) + if(flickcurl_prepare_noauth(fc, "flickr.places.getInfo")) goto tidy; doc = flickcurl_invoke(fc); @@ -396,21 +387,20 @@ flickcurl_place* flickcurl_places_getInfoByUrl(flickcurl* fc, const char* url) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place* place = NULL; + flickcurl_init_params(fc); + if(!url) return NULL; - parameters[count][0] = "url"; - parameters[count++][1]= url; + flickcurl_add_param(fc, "url", url); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.getInfoByUrl", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.getInfoByUrl")) goto tidy; doc = flickcurl_invoke(fc); @@ -451,15 +441,15 @@ flickcurl_place_type_info** flickcurl_places_getPlaceTypes(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place_type_info** place_types = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.getPlaceTypes", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.getPlaceTypes")) goto tidy; doc = flickcurl_invoke(fc); @@ -514,29 +504,27 @@ flickcurl_places_getShapeHistory(flickcurl* fc, const char* place_id, int woe_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_shapedata** shapes = NULL; char woe_id_str[20]; + flickcurl_init_params(fc); + if(!place_id && woe_id < 0) return NULL; if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } if(woe_id >= 0) { - parameters[count][0] = "woe_id"; sprintf(woe_id_str, "%d", woe_id); - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.getShapeHistory", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.getShapeHistory")) goto tidy; doc = flickcurl_invoke(fc); @@ -586,8 +574,6 @@ const char* date, int woe_id, const char* place_id) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place** places = NULL; @@ -595,31 +581,29 @@ int place_type_id; char place_type_id_str[3]; + flickcurl_init_params(fc); + place_type_id = flickcurl_place_type_to_id(place_type); if(place_type_id < 0) return NULL; - parameters[count][0] = "place_type_id"; sprintf(place_type_id_str, "%d", place_type_id); - parameters[count++][1]= place_type_id_str; + flickcurl_add_param(fc, "place_type_id", place_type_id_str); if(date) { - parameters[count][0] = "date"; - parameters[count++][1]= date; + flickcurl_add_param(fc, "date", date); } if(woe_id >= 0) { sprintf(woe_id_str, "%d", woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } else if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.getTopPlacesList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.getTopPlacesList")) goto tidy; doc = flickcurl_invoke(fc); @@ -676,8 +660,6 @@ double maximum_longitude, double maximum_latitude) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place** places = NULL; @@ -685,27 +667,25 @@ int place_type_id = -1; char bbox[255]; + flickcurl_init_params(fc); + place_type_id = flickcurl_place_type_to_id(place_type); if(place_type_id < 0) return NULL; sprintf(bbox, "%f,%f,%f,%f", minimum_longitude, minimum_latitude, maximum_longitude, maximum_latitude); - parameters[count][0] = "bbox"; - parameters[count++][1]= bbox; + flickcurl_add_param(fc, "bbox", bbox); /* deliberately not using deprecated parameter place_type */ /* - parameters[count][0] = "place_type"; - parameters[count++][1]= place_type; + flickcurl_add_param(fc, "place_type", place_type); */ - parameters[count][0] = "place_type_id"; sprintf(place_type_id_str, "%d", place_type_id); - parameters[count++][1]= place_type_id_str; + flickcurl_add_param(fc, "place_type_id", place_type_id_str); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.placesForBoundingBox", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.places.placesForBoundingBox")) goto tidy; doc = flickcurl_invoke(fc); @@ -768,8 +748,6 @@ int min_taken_date, int max_taken_date) { - const char* parameters[17][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place** places = NULL; @@ -782,6 +760,8 @@ char woe_id_str[10]; char threshold_str[10]; + flickcurl_init_params(fc); + if(!woe_id && !place_id) return NULL; @@ -791,54 +771,43 @@ /* deliberately not using deprecated parameter place_type */ /* - parameters[count][0] = "place_type"; - parameters[count++][1]= place_type; + flickcurl_add_param(fc, "place_type", place_type); */ - parameters[count][0] = "place_type_id"; sprintf(place_type_id_str, "%d", place_type_id); - parameters[count++][1]= place_type_id_str; + flickcurl_add_param(fc, "place_type_id", place_type_id_str); if(woe_id >= 0) { - parameters[count][0] = "woe_id"; sprintf(woe_id_str, "%d", woe_id); - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } - parameters[count][0] = "threshold"; sprintf(threshold_str, "%d", threshold); - parameters[count++][1]= threshold_str; + flickcurl_add_param(fc, "threshold", threshold_str); if(contacts) { - parameters[count][0] = "contacts"; - parameters[count++][1]= contacts; + flickcurl_add_param(fc, "contacts", contacts); } if(min_upload_date >= 0) { sprintf(min_upload_date_s, "%d", min_upload_date); - parameters[count][0] = "min_upload_date"; - parameters[count++][1]= min_upload_date_s; + flickcurl_add_param(fc, "min_upload_date", min_upload_date_s); } if(max_upload_date >= 0) { sprintf(max_upload_date_s, "%d", max_upload_date); - parameters[count][0] = "max_upload_date"; - parameters[count++][1]= max_upload_date_s; + flickcurl_add_param(fc, "max_upload_date", max_upload_date_s); } if(min_taken_date >= 0) { sprintf(min_taken_date_s, "%d", min_taken_date); - parameters[count][0] = "min_taken_date"; - parameters[count++][1]= min_taken_date_s; + flickcurl_add_param(fc, "min_taken_date", min_taken_date_s); } if(max_taken_date >= 0) { sprintf(max_taken_date_s, "%d", max_taken_date); - parameters[count][0] = "max_taken_date"; - parameters[count++][1]= max_taken_date_s; + flickcurl_add_param(fc, "max_taken_date", max_taken_date_s); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.placesForContacts", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.places.placesForContacts")) goto tidy; doc = flickcurl_invoke(fc); @@ -915,8 +884,6 @@ const char* min_upload_date, const char* max_upload_date, const char* min_taken_date, const char* max_taken_date) { - const char* parameters[19][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; void* result = NULL; @@ -924,40 +891,30 @@ int place_type_id; char woe_id_str[10]; + flickcurl_init_params(fc); + place_type_id = flickcurl_place_type_to_id(place_type); if(place_type_id < 0) return 1; - parameters[count][0] = "place_type_id"; sprintf(place_type_id_str, "%d", place_type_id); - parameters[count++][1]= place_type_id_str; - parameters[count][0] = "woe_id"; + flickcurl_add_param(fc, "place_type_id", place_type_id_str); sprintf(woe_id_str, "%d", woe_id); - parameters[count++][1]= woe_id_str; - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; - parameters[count][0] = "threshold"; - parameters[count++][1]= threshold; - parameters[count][0] = "tags"; - parameters[count++][1]= tags; - parameters[count][0] = "tag_mode"; - parameters[count++][1]= tag_mode; - parameters[count][0] = "machine_tags"; - parameters[count++][1]= machine_tags; - parameters[count][0] = "machine_tag_mode"; - parameters[count++][1]= machine_tag_mode; - parameters[count][0] = "min_upload_date"; - parameters[count++][1]= min_upload_date; - parameters[count][0] = "max_upload_date"; - parameters[count++][1]= max_upload_date; - parameters[count][0] = "min_taken_date"; - parameters[count++][1]= min_taken_date; - parameters[count][0] = "max_taken_date"; - parameters[count++][1]= max_taken_date; + flickcurl_add_param(fc, "woe_id", woe_id_str); + flickcurl_add_param(fc, "place_id", place_id); + flickcurl_add_param(fc, "threshold", threshold); + flickcurl_add_param(fc, "tags", tags); + flickcurl_add_param(fc, "tag_mode", tag_mode); + flickcurl_add_param(fc, "machine_tags", machine_tags); + flickcurl_add_param(fc, "machine_tag_mode", machine_tag_mode); + flickcurl_add_param(fc, "min_upload_date", min_upload_date); + flickcurl_add_param(fc, "max_upload_date", max_upload_date); + flickcurl_add_param(fc, "min_taken_date", min_taken_date); + flickcurl_add_param(fc, "max_taken_date", max_taken_date); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.placesForTags", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.placesForTags")) goto tidy; doc = flickcurl_invoke(fc); @@ -999,22 +956,20 @@ flickcurl_place* flickcurl_places_resolvePlaceId(flickcurl* fc, const char* place_id) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place* place = NULL; + flickcurl_init_params(fc); + if(!place_id) return NULL; - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare_noauth(fc, "flickr.places.resolvePlaceId", - parameters, count)) + if(flickcurl_prepare_noauth(fc, "flickr.places.resolvePlaceId")) goto tidy; doc = flickcurl_invoke(fc); @@ -1057,22 +1012,20 @@ flickcurl_place* flickcurl_places_resolvePlaceURL(flickcurl* fc, const char* url) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place* place = NULL; + flickcurl_init_params(fc); + if(!url) return NULL; - parameters[count][0] = "url"; - parameters[count++][1]= url; + flickcurl_add_param(fc, "url", url); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare_noauth(fc, "flickr.places.resolvePlaceURL", - parameters, count)) + if(flickcurl_prepare_noauth(fc, "flickr.places.resolvePlaceURL")) goto tidy; doc = flickcurl_invoke(fc); @@ -1123,8 +1076,6 @@ int woe_id, const char* place_id, int threshold) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_place** places = NULL; @@ -1132,6 +1083,8 @@ char woe_id_str[20]; char threshold_str[4]; + flickcurl_init_params(fc); + place_type_str = flickcurl_get_place_type_label(place_type); if(!place_type_str) { flickcurl_error(fc, "Invalid place type %d", place_type); @@ -1147,29 +1100,25 @@ return NULL; } - parameters[count][0] = "place_type"; - parameters[count++][1]= place_type_str; + flickcurl_add_param(fc, "place_type", place_type_str); if(woe_id >= 0) { sprintf(woe_id_str, "%d", woe_id); - parameters[count][0] = "woe_id"; - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } if(threshold >= 0) { sprintf(threshold_str, "%d", threshold); - parameters[count][0] = "threshold"; - parameters[count++][1]= threshold_str; + flickcurl_add_param(fc, "threshold", threshold_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.placesForUser", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.placesForUser")) goto tidy; doc = flickcurl_invoke(fc); @@ -1244,8 +1193,6 @@ int min_upload_date, int max_upload_date, int min_taken_date, int max_taken_date) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char woe_id_str[20]; @@ -1255,42 +1202,38 @@ char max_taken_date_str[20]; flickcurl_tag** tags = NULL; + flickcurl_init_params(fc); + if(woe_id < 0 && !place_id) return NULL; if(woe_id >= 0) { - parameters[count][0] = "woe_id"; sprintf(woe_id_str, "%d", woe_id); - parameters[count++][1]= woe_id_str; + flickcurl_add_param(fc, "woe_id", woe_id_str); } if(place_id) { - parameters[count][0] = "place_id"; - parameters[count++][1]= place_id; + flickcurl_add_param(fc, "place_id", place_id); } if(min_upload_date) { - parameters[count][0] = "min_upload_date"; sprintf(min_upload_date_str, "%d", min_upload_date); - parameters[count++][1]= min_upload_date_str; + flickcurl_add_param(fc, "min_upload_date", min_upload_date_str); } if(min_upload_date) { - parameters[count][0] = "max_upload_date"; sprintf(min_upload_date_str, "%d", min_upload_date); - parameters[count++][1]= max_upload_date_str; + flickcurl_add_param(fc, "max_upload_date", max_upload_date_str); } if(max_upload_date) { - parameters[count][0] = "min_taken_date"; sprintf(max_upload_date_str, "%d", max_upload_date); - parameters[count++][1]= min_taken_date_str; + flickcurl_add_param(fc, "min_taken_date", min_taken_date_str); } if(min_taken_date) { - parameters[count][0] = "max_taken_date"; sprintf(min_taken_date_str, "%d", min_taken_date); - parameters[count++][1]= max_taken_date_str; + flickcurl_add_param(fc, "max_taken_date", max_taken_date_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.places.tagsForPlace", parameters, count)) + if(flickcurl_prepare(fc, "flickr.places.tagsForPlace")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/prefs-api.c flickcurl-1.24/src/prefs-api.c --- flickcurl-1.22/src/prefs-api.c 2011-05-09 04:12:51.000000000 +0000 +++ flickcurl-1.24/src/prefs-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * flickr.prefs-api.c - Flickr flickr.prefs.* API calls * - * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -51,16 +51,16 @@ int flickcurl_prefs_getContentType(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* content_type_str = NULL; int content_type= -1; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.prefs.getContentType", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.prefs.getContentType")) goto tidy; doc = flickcurl_invoke(fc); @@ -137,16 +137,16 @@ int flickcurl_prefs_getHidden(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* hidden_str = NULL; int hidden= -1; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.prefs.getHidden", parameters, count)) + if(flickcurl_prepare(fc, "flickr.prefs.getHidden")) goto tidy; doc = flickcurl_invoke(fc); @@ -195,16 +195,16 @@ int flickcurl_prefs_getPrivacy(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* privacy_level_str= NULL; int privacy_level= -1; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.prefs.getPrivacy", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.prefs.getPrivacy")) goto tidy; doc = flickcurl_invoke(fc); @@ -251,16 +251,16 @@ int flickcurl_prefs_getSafetyLevel(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* safety_level_str= NULL; int safety_level= -1; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.prefs.getSafetyLevel", parameters, count)) + if(flickcurl_prepare(fc, "flickr.prefs.getSafetyLevel")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/reflection-api.c flickcurl-1.24/src/reflection-api.c --- flickcurl-1.22/src/reflection-api.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/reflection-api.c 2012-08-29 02:58:29.000000000 +0000 @@ -2,7 +2,7 @@ * * reflection-api.c - Flickr flickr.reflection.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -55,8 +55,6 @@ char** flickcurl_reflection_getMethods(flickcurl* fc) { - const char * parameters[5][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; @@ -65,10 +63,13 @@ int i; int size; char **methods = NULL; + int count; - parameters[count][0] = NULL; + flickcurl_init_params(fc); - if(flickcurl_prepare(fc, "flickr.reflection.getMethods", parameters, count)) + flickcurl_end_params(fc); + + if(flickcurl_prepare_noauth(fc, "flickr.reflection.getMethods")) goto tidy; doc = flickcurl_invoke(fc); @@ -109,8 +110,9 @@ /* Walk children nodes for description text */ for(chnode = node->children; chnode; chnode = chnode->next) { if(chnode->type == XML_TEXT_NODE) { - methods[count] = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(methods[count], (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + methods[count] = (char*)malloc(len + 1); + memcpy(methods[count], chnode->content, len + 1); count++; break; } @@ -144,18 +146,17 @@ flickcurl_method* flickcurl_reflection_getMethodInfo(flickcurl* fc, const char* name) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_method* method = NULL; - parameters[count][0] = "method_name"; - parameters[count++][1]= name; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "method_name", name); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.reflection.getMethodInfo", parameters, count)) + if(flickcurl_prepare(fc, "flickr.reflection.getMethodInfo")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/serializer.c flickcurl-1.24/src/serializer.c --- flickcurl-1.22/src/serializer.c 2009-12-21 03:25:38.000000000 +0000 +++ flickcurl-1.24/src/serializer.c 2012-08-29 02:58:29.000000000 +0000 @@ -2,7 +2,7 @@ * * serializer.c - Triples from photo metadata * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -215,7 +215,7 @@ static flickrdf_nspace* -nspace_add_new(flickrdf_nspace* list, char* prefix, char *uri) +nspace_add_new(flickrdf_nspace* list, char* prefix, char *uri) { flickrdf_nspace* ns; @@ -223,11 +223,11 @@ ns->prefix_len = strlen(prefix); ns->uri_len = strlen(uri); - ns->prefix = (char*)malloc(ns->prefix_len+1); - strcpy(ns->prefix, prefix); + ns->prefix = (char*)malloc(ns->prefix_len + 1); + memcpy(ns->prefix, prefix, ns->prefix_len + 1); - ns->uri = (char*)malloc(ns->uri_len+1); - strcpy(ns->uri, uri); + ns->uri = (char*)malloc(ns->uri_len + 1); + memcpy(ns->uri, uri, ns->uri_len + 1); ns->next = list; return ns; diff -Nru flickcurl-1.22/src/sha1.c flickcurl-1.24/src/sha1.c --- flickcurl-1.22/src/sha1.c 2011-06-24 00:17:40.000000000 +0000 +++ flickcurl-1.24/src/sha1.c 2013-04-11 04:52:16.000000000 +0000 @@ -308,14 +308,14 @@ if(!key || !data) return NULL; - result = malloc(SHA1_DIGEST_LENGTH); + result = (unsigned char*)malloc(SHA1_DIGEST_LENGTH); if(!result) return NULL; if(key_len > HMAC_SHA1_BLOCKSIZE) { /* When key (K) is > blocksize, key := sha1-hash(key) */ SHA1Init(&key_hash); - SHA1Update(&key_hash, key, key_len); + SHA1Update(&key_hash, (const unsigned char*)key, key_len); SHA1Final(&key_hash); key = key_hash.digest; @@ -330,7 +330,7 @@ /* inner := sha1-hash(ipad // message) */ SHA1Init(&inner); SHA1Update(&inner, kpad, HMAC_SHA1_BLOCKSIZE); - SHA1Update(&inner, data, data_len); + SHA1Update(&inner, (const unsigned char*)data, data_len); SHA1Final(&inner); memset(kpad, '\0', sizeof(kpad)); diff -Nru flickcurl-1.22/src/shape.c flickcurl-1.24/src/shape.c --- flickcurl-1.22/src/shape.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/shape.c 2012-08-29 01:48:38.000000000 +0000 @@ -314,8 +314,11 @@ if(xpathObj) xmlXPathFreeObject(xpathObj); - if(fc->failed) + if(fc->failed) { + if(shapes) + flickcurl_free_shapes(shapes); shapes = NULL; + } return shapes; } diff -Nru flickcurl-1.22/src/size.c flickcurl-1.24/src/size.c --- flickcurl-1.22/src/size.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/size.c 2012-08-29 02:58:29.000000000 +0000 @@ -119,11 +119,12 @@ s = (flickcurl_size*)calloc(sizeof(flickcurl_size), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "label")) s->label = attr_value; @@ -139,7 +140,8 @@ s->url = attr_value; } else if(!strcmp(attr_name, "media")) { s->media = attr_value; - } + } else + free(attr_value); } #if FLICKCURL_DEBUG > 1 diff -Nru flickcurl-1.22/src/stat.c flickcurl-1.24/src/stat.c --- flickcurl-1.22/src/stat.c 2010-07-03 05:29:18.000000000 +0000 +++ flickcurl-1.24/src/stat.c 2012-08-29 02:58:29.000000000 +0000 @@ -129,11 +129,12 @@ s = (flickcurl_stat*)calloc(sizeof(flickcurl_stat), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "views")) { s->views = atoi(attr_value); @@ -150,6 +151,8 @@ s->url = attr_value; else if(!strcmp(attr_name, "searchterms")) s->searchterms = attr_value; + else + free(attr_value); } /* end attributes */ diff -Nru flickcurl-1.22/src/stats-api.c flickcurl-1.24/src/stats-api.c --- flickcurl-1.22/src/stats-api.c 2010-09-30 03:52:30.000000000 +0000 +++ flickcurl-1.24/src/stats-api.c 2012-08-29 01:48:38.000000000 +0000 @@ -2,7 +2,7 @@ * * stats-api.c - Flickr flickr.stats.* API calls * - * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2010-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -86,38 +86,33 @@ const char* collection_id, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); if(collection_id) { - parameters[count][0] = "collection_id"; - parameters[count++][1] = collection_id; + flickcurl_add_param(fc, "collection_id", collection_id); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getCollectionDomains", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.stats.getCollectionDomains")) goto tidy; doc = flickcurl_invoke(fc); @@ -174,40 +169,34 @@ const char* collection_id, int per_page, int page) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date || !domain) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "domain"; - parameters[count++][1] = domain; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "domain", domain); if(collection_id) { - parameters[count][0] = "collection_id"; - parameters[count++][1] = collection_id; + flickcurl_add_param(fc, "collection_id", collection_id); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getCollectionReferrers", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.stats.getCollectionReferrers")) goto tidy; doc = flickcurl_invoke(fc); @@ -258,23 +247,22 @@ flickcurl_stats_getCollectionStats(flickcurl* fc, const char* date, const char* collection_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* count_str; + int count = -1; + flickcurl_init_params(fc); + if(!date || !collection_id) return -1; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "collection_id"; - parameters[count++][1] = collection_id; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "collection_id", collection_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getCollectionStats", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getCollectionStats")) goto tidy; doc = flickcurl_invoke(fc); @@ -332,37 +320,33 @@ flickcurl_stats_getPhotoDomains(flickcurl* fc, const char* date, const char* photo_id, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); if(photo_id) { - parameters[count][0] = "photo_id"; - parameters[count++][1] = photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotoDomains", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotoDomains")) goto tidy; doc = flickcurl_invoke(fc); @@ -418,39 +402,34 @@ const char* domain, const char* photo_id, int per_page, int page) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date || !domain) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "domain"; - parameters[count++][1] = domain; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "domain", domain); if(photo_id) { - parameters[count][0] = "photo_id"; - parameters[count++][1] = photo_id; + flickcurl_add_param(fc, "photo_id", photo_id); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotoReferrers", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotoReferrers")) goto tidy; doc = flickcurl_invoke(fc); @@ -505,37 +484,33 @@ const char* photoset_id, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); if(photoset_id) { - parameters[count][0] = "photoset_id"; - parameters[count++][1] = photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotosetDomains", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotosetDomains")) goto tidy; doc = flickcurl_invoke(fc); @@ -592,40 +567,34 @@ const char* photoset_id, int per_page, int page) { - const char* parameters[12][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date || !domain) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "domain"; - parameters[count++][1] = domain; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "domain", domain); if(photoset_id) { - parameters[count][0] = "photoset_id"; - parameters[count++][1] = photoset_id; + flickcurl_add_param(fc, "photoset_id", photoset_id); } if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotosetReferrers", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotosetReferrers")) goto tidy; doc = flickcurl_invoke(fc); @@ -677,23 +646,22 @@ flickcurl_stats_getPhotosetStats(flickcurl* fc, const char* date, const char* photoset_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* count_str; - + int count = -1; + + flickcurl_init_params(fc); + if(!date || !photoset_id) return -1; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "photoset_id"; - parameters[count++][1] = photoset_id; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "photoset_id", photoset_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotosetStats", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotosetStats")) goto tidy; doc = flickcurl_invoke(fc); @@ -749,24 +717,22 @@ flickcurl_stats_getPhotoStats(flickcurl* fc, const char* date, const char* photo_id) { - const char* parameters[9][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; flickcurl_stat* stat1 = NULL; + flickcurl_init_params(fc); + if(!date || !photo_id) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "photo_id"; - parameters[count++][1] = photo_id; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotoStats", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotoStats")) goto tidy; doc = flickcurl_invoke(fc); @@ -825,34 +791,30 @@ flickcurl_stats_getPhotostreamDomains(flickcurl* fc, const char* date, int per_page, int page) { - const char* parameters[10][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotostreamDomains", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotostreamDomains")) goto tidy; doc = flickcurl_invoke(fc); @@ -907,36 +869,31 @@ const char* domain, int per_page, int page) { - const char* parameters[11][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_stat** stats = NULL; char per_page_str[10]; char page_str[10]; + flickcurl_init_params(fc); + if(!date || !domain) return NULL; - parameters[count][0] = "date"; - parameters[count++][1] = date; - parameters[count][0] = "domain"; - parameters[count++][1] = domain; + flickcurl_add_param(fc, "date", date); + flickcurl_add_param(fc, "domain", domain); if(per_page >= 0) { sprintf(per_page_str, "%d", per_page); - parameters[count][0] = "per_page"; - parameters[count++][1] = per_page_str; + flickcurl_add_param(fc, "per_page", per_page_str); } if(page >= 0) { sprintf(page_str, "%d", page); - parameters[count][0] = "page"; - parameters[count++][1] = page_str; + flickcurl_add_param(fc, "page", page_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotostreamReferrers", parameters, - count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotostreamReferrers")) goto tidy; doc = flickcurl_invoke(fc); @@ -986,21 +943,21 @@ int flickcurl_stats_getPhotostreamStats(flickcurl* fc, const char* date) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* count_str; - + int count = -1; + + flickcurl_init_params(fc); + if(!date) return -1; - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPhotostreamStats", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPhotostreamStats")) goto tidy; doc = flickcurl_invoke(fc); @@ -1062,12 +1019,12 @@ const char* extras) { flickcurl_photos_list_params list_params; - const char* parameters[14][2]; - int count = 0; const char* format = NULL; flickcurl_photos_list* photos_list = NULL; flickcurl_photo** photos = NULL; + flickcurl_init_params(fc); + memset(&list_params, '\0', sizeof(list_params)); list_params.format = NULL; list_params.extras = extras; @@ -1075,20 +1032,18 @@ list_params.page = page; if(date) { - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); } if(sort) { - parameters[count][0] = "sort"; - parameters[count++][1] = sort; + flickcurl_add_param(fc, "sort", sort); } /* Photos List parameters */ - flickcurl_append_photos_list_params(&list_params, parameters, &count, &format); + flickcurl_append_photos_list_params(fc, &list_params, &format); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getPopularPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getPopularPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -1135,21 +1090,20 @@ flickcurl_view_stats* flickcurl_stats_getTotalViews(flickcurl* fc, const char* date) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_view_stats* views = NULL; char* count_str; + flickcurl_init_params(fc); + if(date) { - parameters[count][0] = "date"; - parameters[count++][1] = date; + flickcurl_add_param(fc, "date", date); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.stats.getTotalViews", parameters, count)) + if(flickcurl_prepare(fc, "flickr.stats.getTotalViews")) goto tidy; doc = flickcurl_invoke(fc); @@ -1205,8 +1159,11 @@ if(xpathCtx) xmlXPathFreeContext(xpathCtx); - if(fc->failed) + if(fc->failed) { + if(views) + free(views); views = NULL; + } return views; } diff -Nru flickcurl-1.22/src/tags-api.c flickcurl-1.24/src/tags-api.c --- flickcurl-1.22/src/tags-api.c 2010-09-30 03:52:30.000000000 +0000 +++ flickcurl-1.24/src/tags-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * tags-api.c - Flickr flickr.tags.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -63,22 +63,20 @@ const char* cluster_id, flickcurl_photos_list_params* list_params) { - const char* parameters[10][2]; - int count = 0; flickcurl_photos_list* photos_list = NULL; const char* format = NULL; + flickcurl_init_params(fc); + if(!tag || !cluster_id) return NULL; - parameters[count][0] = "tag"; - parameters[count++][1]= tag; - parameters[count][0] = "cluster_id"; - parameters[count++][1]= cluster_id; + flickcurl_add_param(fc, "tag", tag); + flickcurl_add_param(fc, "cluster_id", cluster_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getClusterPhotos", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getClusterPhotos")) goto tidy; photos_list = flickcurl_invoke_photos_list(fc, @@ -117,21 +115,20 @@ flickcurl_tag_clusters* flickcurl_tags_getClusters(flickcurl* fc, const char* tag) { - const char* parameters[8][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag_clusters* clusters = NULL; + flickcurl_init_params(fc); + if(!tag) return NULL; - parameters[count][0] = "tag"; - parameters[count++][1]= tag; + flickcurl_add_param(fc, "tag", tag); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getClusters", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getClusters")) goto tidy; doc = flickcurl_invoke(fc); @@ -177,30 +174,28 @@ flickcurl_tag** flickcurl_tags_getHotList(flickcurl* fc, const char* period, int tag_count) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag** tags = NULL; char tag_count_str[10]; + flickcurl_init_params(fc); + if(period) { if(!strcmp(period, "day") || !strcmp(period, "week")) { - parameters[count][0] = "period"; - parameters[count++][1]= period; + flickcurl_add_param(fc, "period", period); } else return NULL; } if(tag_count >= 0) { sprintf(tag_count_str, "%d", tag_count); - parameters[count][0] = "count"; - parameters[count++][1]= tag_count_str; + flickcurl_add_param(fc, "count", tag_count_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getHotList", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getHotList")) goto tidy; doc = flickcurl_invoke(fc); @@ -244,18 +239,17 @@ flickcurl_tag** flickcurl_tags_getListPhoto(flickcurl* fc, const char* photo_id) { - const char* parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag** tags = NULL; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; + flickcurl_init_params(fc); + + flickcurl_add_param(fc, "photo_id", photo_id); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getListPhoto", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getListPhoto")) goto tidy; doc = flickcurl_invoke(fc); @@ -301,20 +295,19 @@ flickcurl_tag** flickcurl_tags_getListUser(flickcurl* fc, const char* user_id) { - const char* parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag** tags = NULL; + flickcurl_init_params(fc); + if(user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getListUser", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getListUser")) goto tidy; doc = flickcurl_invoke(fc); @@ -360,26 +353,24 @@ flickcurl_tags_getListUserPopular(flickcurl* fc, const char* user_id, int pop_count) { - const char* parameters[7][2]; char pop_count_str[10]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag** tags = NULL; + flickcurl_init_params(fc); + if(user_id) { - parameters[count][0] = "user_id"; - parameters[count++][1]= user_id; + flickcurl_add_param(fc, "user_id", user_id); } if(pop_count >= 0) { sprintf(pop_count_str, "%d", pop_count); - parameters[count][0] = "count"; - parameters[count++][1]= pop_count_str; + flickcurl_add_param(fc, "count", pop_count_str); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getListUserPopular", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getListUserPopular")) goto tidy; doc = flickcurl_invoke(fc); @@ -423,20 +414,19 @@ flickcurl_tag** flickcurl_tags_getListUserRaw(flickcurl* fc, const char* tag) { - const char* parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag** tags = NULL; + flickcurl_init_params(fc); + if(tag) { - parameters[count][0] = "tag"; - parameters[count++][1]= tag; + flickcurl_add_param(fc, "tag", tag); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getListUserRaw", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getListUserRaw")) goto tidy; doc = flickcurl_invoke(fc); @@ -480,21 +470,20 @@ flickcurl_tag** flickcurl_tags_getRelated(flickcurl* fc, const char* tag) { - const char* parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_tag** tags = NULL; + flickcurl_init_params(fc); + if(!tag) return NULL; - parameters[count][0] = "tag"; - parameters[count++][1]= tag; + flickcurl_add_param(fc, "tag", tag); - parameters[count][0] = NULL; + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.tags.getRelated", parameters, count)) + if(flickcurl_prepare(fc, "flickr.tags.getRelated")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/tags.c flickcurl-1.24/src/tags.c --- flickcurl-1.22/src/tags.c 2011-03-30 13:22:15.000000000 +0000 +++ flickcurl-1.24/src/tags.c 2013-01-17 00:14:48.000000000 +0000 @@ -119,11 +119,12 @@ t->photo = photo; for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) t->id = attr_value; @@ -149,7 +150,8 @@ /* from tags.getHotList TAG */ t->count = atoi(attr_value); free(attr_value); - } + } else + free(attr_value); } /* Walk children nodes for element or text */ @@ -157,13 +159,15 @@ const char *chnode_name = (const char*)chnode->name; if(chnode->type == XML_ELEMENT_NODE) { if(saw_clean && !strcmp(chnode_name, "raw")) { - t->raw = (char*)malloc(strlen((const char*)chnode->children->content)+1); - strcpy(t->raw, (const char*)chnode->children->content); + size_t len = strlen((const char*)chnode->children->content); + t->raw = (char*)malloc(len + 1); + memcpy(t->raw, chnode->children->content, len + 1); } } else if(chnode->type == XML_TEXT_NODE) { if(!saw_clean) { - t->cooked = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(t->cooked, (const char*)chnode->content); + size_t len = strlen((const char*)chnode->content); + t->cooked = (char*)malloc(len + 1); + memcpy(t->cooked, chnode->content, len + 1); } } } @@ -220,8 +224,8 @@ len = p-string; - t->cooked = (char*)malloc(len+1); - strncpy(t->cooked, string, len); + t->cooked = (char*)malloc(len + 1); + memcpy(t->cooked, string, len); t->cooked[len] = '\0'; if(fc->tag_handler) @@ -338,8 +342,10 @@ tags_count = atoi(attr_value); } - if(tags_count <= 0) + if(tags_count <= 0) { + free(tc); continue; + } tc->tags = (char**)calloc(sizeof(char*), tags_count+1); @@ -348,8 +354,9 @@ const char *chnode_name = (const char*)chnode->name; if(chnode->type == XML_ELEMENT_NODE && !strcmp(chnode_name, "tag")) { size_t len = strlen((const char*)chnode->children->content); - char *tag_name = (char*)malloc(len+1); - strcpy(tag_name, (const char*)chnode->children->content); + char *tag_name = (char*)malloc(len + 1); + + memcpy(tag_name, (const char*)chnode->children->content, len + 1); tc->tags[tc->count++] = tag_name; #if FLICKCURL_DEBUG > 1 @@ -367,6 +374,12 @@ tcs->clusters[tcs->count] = NULL; tidy: + if(fc->failed) { + if(tcs) + flickcurl_free_tag_clusters(tcs); + tcs = NULL; + } + if(xpathObj) xmlXPathFreeObject(xpathObj); diff -Nru flickcurl-1.22/src/test-api.c flickcurl-1.24/src/test-api.c --- flickcurl-1.22/src/test-api.c 2011-05-09 04:12:51.000000000 +0000 +++ flickcurl-1.24/src/test-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * test-api.c - Flickr flickr.test.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -59,17 +59,16 @@ int flickcurl_test_echo(flickcurl* fc, const char* key, const char* value) { - const char * parameters[6][2]; - int count = 0; xmlDocPtr doc = NULL; int rc = 0; - parameters[count][0] = key; - parameters[count++][1]= value; + flickcurl_init_params(fc); - parameters[count][0] = NULL; + flickcurl_add_param(fc, key, value); - if(flickcurl_prepare(fc, "flickr.test.echo", parameters, count)) { + flickcurl_end_params(fc); + + if(flickcurl_prepare(fc, "flickr.test.echo")) { rc = 1; goto tidy; } @@ -102,15 +101,15 @@ char* flickcurl_test_login(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; char* username = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.test.login", parameters, count)) + if(flickcurl_prepare(fc, "flickr.test.login")) goto tidy; doc = flickcurl_invoke(fc); @@ -152,14 +151,14 @@ int flickcurl_test_null(flickcurl* fc) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; - parameters[count][0] = NULL; + flickcurl_init_params(fc); + + flickcurl_end_params(fc); - if(flickcurl_prepare(fc, "flickr.test.null", parameters, count)) + if(flickcurl_prepare(fc, "flickr.test.null")) goto tidy; doc = flickcurl_invoke(fc); diff -Nru flickcurl-1.22/src/ticket.c flickcurl-1.24/src/ticket.c --- flickcurl-1.22/src/ticket.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/ticket.c 2012-08-29 02:58:29.000000000 +0000 @@ -107,11 +107,12 @@ t = (flickcurl_ticket*)calloc(sizeof(flickcurl_ticket), 1); for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "id")) { t->id = atoi(attr_value); @@ -125,7 +126,8 @@ } else if(!strcmp(attr_name, "invalid")) { t->invalid = atoi(attr_value); free(attr_value); - } + } else + free(attr_value); } #if FLICKCURL_DEBUG > 1 diff -Nru flickcurl-1.22/src/upload-api.c flickcurl-1.24/src/upload-api.c --- flickcurl-1.22/src/upload-api.c 2011-10-21 20:41:12.000000000 +0000 +++ flickcurl-1.24/src/upload-api.c 2012-08-29 01:48:38.000000000 +0000 @@ -2,7 +2,7 @@ * * upload-api.c - Flickr photo upload API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -57,8 +57,6 @@ flickcurl_upload_status* flickcurl_photos_upload_params(flickcurl* fc, flickcurl_upload_params* params) { - const char* parameters[13][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_upload_status* status = NULL; @@ -69,6 +67,8 @@ char content_type_s[2]; char hidden_s[2]; + flickcurl_init_params(fc); + if(!params->photo_file) return NULL; @@ -105,43 +105,33 @@ } if(params->title) { - parameters[count][0] = "title"; - parameters[count++][1]= params->title; + flickcurl_add_param(fc, "title", params->title); } if(params->description) { - parameters[count][0] = "description"; - parameters[count++][1]= params->description; + flickcurl_add_param(fc, "description", params->description); } if(params->tags) { - parameters[count][0] = "tags"; - parameters[count++][1]= params->tags; + flickcurl_add_param(fc, "tags", params->tags); } if(params->safety_level >= 0) { - parameters[count][0] = "safety_level"; - parameters[count++][1]= safety_level_s; + flickcurl_add_param(fc, "safety_level", safety_level_s); } if(params->content_type >= 0) { - parameters[count][0] = "content_type"; - parameters[count++][1]= content_type_s; + flickcurl_add_param(fc, "content_type", content_type_s); } - parameters[count][0] = "is_public"; - parameters[count++][1]= is_public_s; - parameters[count][0] = "is_friend"; - parameters[count++][1]= is_friend_s; - parameters[count][0] = "is_family"; - parameters[count++][1]= is_family_s; + flickcurl_add_param(fc, "is_public", is_public_s); + flickcurl_add_param(fc, "is_friend", is_friend_s); + flickcurl_add_param(fc, "is_family", is_family_s); if(params->hidden >= 0) { - parameters[count][0] = "hidden"; - parameters[count++][1]= hidden_s; + flickcurl_add_param(fc, "hidden", hidden_s); } - parameters[count][0] = NULL; + flickcurl_end_params(fc); if(flickcurl_prepare_upload(fc, fc->upload_service_uri, - "photo", params->photo_file, - parameters, count)) + "photo", params->photo_file)) goto tidy; doc = flickcurl_invoke(fc); @@ -167,8 +157,11 @@ if(xpathCtx) xmlXPathFreeContext(xpathCtx); - if(fc->failed) + if(fc->failed) { + if(status) + free(status); status = NULL; + } return status; } @@ -240,13 +233,13 @@ flickcurl_photos_replace(flickcurl* fc, const char* photo_file, const char *photo_id, int async) { - const char* parameters[7][2]; - int count = 0; xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; flickcurl_upload_status* status = NULL; char async_s[2]; + flickcurl_init_params(fc); + if(!photo_file || !photo_id) return NULL; @@ -259,17 +252,14 @@ async_s[0] = async ? '1' : '0'; async_s[1] = '\0'; - parameters[count][0] = "photo_id"; - parameters[count++][1]= photo_id; - parameters[count][0] = "async"; - parameters[count++][1]= async_s; + flickcurl_add_param(fc, "photo_id", photo_id); + flickcurl_add_param(fc, "async", async_s); - parameters[count][0] = NULL; + flickcurl_end_params(fc); if(flickcurl_prepare_upload(fc, fc->replace_service_uri, - "photo", photo_file, - parameters, count)) + "photo", photo_file)) goto tidy; doc = flickcurl_invoke(fc); @@ -296,8 +286,11 @@ if(xpathCtx) xmlXPathFreeContext(xpathCtx); - if(fc->failed) + if(fc->failed) { + if(status) + free(status); status = NULL; + } return status; } diff -Nru flickcurl-1.22/src/urls-api.c flickcurl-1.24/src/urls-api.c --- flickcurl-1.22/src/urls-api.c 2010-04-13 21:37:11.000000000 +0000 +++ flickcurl-1.24/src/urls-api.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * urls-api.c - Flickr flickr.urls.* API calls * - * Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version diff -Nru flickcurl-1.22/src/user_upload_status.c flickcurl-1.24/src/user_upload_status.c --- flickcurl-1.22/src/user_upload_status.c 2009-12-21 03:24:14.000000000 +0000 +++ flickcurl-1.24/src/user_upload_status.c 2012-08-29 02:58:29.000000000 +0000 @@ -95,10 +95,11 @@ if(!strcmp(node_name, "username")) { xmlNodePtr chnode; for(chnode = node->children; chnode; chnode = chnode->next) { + size_t len = strlen((const char*)chnode->content); if(chnode->type != XML_TEXT_NODE) continue; - u->username = (char*)malloc(strlen((const char*)chnode->content)+1); - strcpy(u->username, (const char*)chnode->content); + u->username = (char*)malloc(len + 1); + memcpy(u->username, chnode->content, len + 1); break; } } else if(!strcmp(node_name, "bandwidth")) { @@ -129,11 +130,12 @@ } } else if(!strcmp(node_name, "sets")) { for(attr = node->properties; attr; attr = attr->next) { + size_t attr_len = strlen((const char*)attr->children->content); const char *attr_name = (const char*)attr->name; char *attr_value; - attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1); - strcpy(attr_value, (const char*)attr->children->content); + attr_value = (char*)malloc(attr_len + 1); + memcpy(attr_value, attr->children->content, attr_len + 1); if(!strcmp(attr_name, "created")) { u->sets_created = atoi(attr_value); diff -Nru flickcurl-1.22/utils/Makefile.am flickcurl-1.24/utils/Makefile.am --- flickcurl-1.22/utils/Makefile.am 2011-11-12 06:21:04.000000000 +0000 +++ flickcurl-1.24/utils/Makefile.am 2012-08-29 05:20:08.000000000 +0000 @@ -60,17 +60,5 @@ list_methods_LDADD= $(top_builddir)/src/libflickcurl.la -if FLICKCURL_OAUTH - -EXTRA_PROGRAMS += oauth-test - -oauth_test_SOURCES = oauth-test.c -if GETOPT -oauth_test_SOURCES += getopt.c flickcurl_getopt.h -endif -oauth_test_LDADD= $(top_builddir)/src/libflickcurl.la - -endif - $(top_builddir)/src/libflickcurl.la: cd $(top_builddir)/src && $(MAKE) libflickcurl.la diff -Nru flickcurl-1.22/utils/Makefile.in flickcurl-1.24/utils/Makefile.in --- flickcurl-1.22/utils/Makefile.in 2011-12-29 00:03:27.000000000 +0000 +++ flickcurl-1.24/utils/Makefile.in 2013-04-11 04:49:28.000000000 +0000 @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 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. @@ -33,6 +33,23 @@ # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -52,8 +69,7 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = flickcurl$(EXEEXT) flickrdf$(EXEEXT) -EXTRA_PROGRAMS = codegen$(EXEEXT) list-methods$(EXEEXT) \ - $(am__EXEEXT_1) +EXTRA_PROGRAMS = codegen$(EXEEXT) list-methods$(EXEEXT) @GETOPT_TRUE@am__append_1 = getopt.c flickcurl_getopt.h @MAINTAINER_MODE_TRUE@am__append_2 = -DFLICKCURL_MAINTAINER @GETOPT_TRUE@am__append_3 = getopt.c flickcurl_getopt.h @@ -62,8 +78,6 @@ @RAPTOR_FALSE@am__append_6 = raptor_fake.c raptor_fake.h @GETOPT_TRUE@am__append_7 = getopt.c flickcurl_getopt.h @GETOPT_TRUE@am__append_8 = getopt.c flickcurl_getopt.h -@FLICKCURL_OAUTH_TRUE@am__append_9 = oauth-test -@FLICKCURL_OAUTH_TRUE@@GETOPT_TRUE@am__append_10 = getopt.c flickcurl_getopt.h subdir = utils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -79,7 +93,6 @@ CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -@FLICKCURL_OAUTH_TRUE@am__EXEEXT_1 = oauth-test$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__codegen_SOURCES_DIST = codegen.c getopt.c flickcurl_getopt.h @@ -87,8 +100,8 @@ am_codegen_OBJECTS = codegen.$(OBJEXT) $(am__objects_1) codegen_OBJECTS = $(am_codegen_OBJECTS) codegen_DEPENDENCIES = $(top_builddir)/src/libflickcurl.la -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__flickcurl_SOURCES_DIST = flickcurl.c getopt.c flickcurl_getopt.h @GETOPT_TRUE@am__objects_2 = flickcurl-getopt.$(OBJEXT) @@ -116,13 +129,6 @@ am_list_methods_OBJECTS = list-methods.$(OBJEXT) $(am__objects_1) list_methods_OBJECTS = $(am_list_methods_OBJECTS) list_methods_DEPENDENCIES = $(top_builddir)/src/libflickcurl.la -am__oauth_test_SOURCES_DIST = oauth-test.c getopt.c flickcurl_getopt.h -@FLICKCURL_OAUTH_TRUE@@GETOPT_TRUE@am__objects_5 = getopt.$(OBJEXT) -@FLICKCURL_OAUTH_TRUE@am_oauth_test_OBJECTS = oauth-test.$(OBJEXT) \ -@FLICKCURL_OAUTH_TRUE@ $(am__objects_5) -oauth_test_OBJECTS = $(am_oauth_test_OBJECTS) -@FLICKCURL_OAUTH_TRUE@oauth_test_DEPENDENCIES = \ -@FLICKCURL_OAUTH_TRUE@ $(top_builddir)/src/libflickcurl.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles @@ -133,28 +139,32 @@ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(codegen_SOURCES) $(flickcurl_SOURCES) $(flickrdf_SOURCES) \ - $(list_methods_SOURCES) $(oauth_test_SOURCES) + $(list_methods_SOURCES) DIST_SOURCES = $(am__codegen_SOURCES_DIST) \ $(am__flickcurl_SOURCES_DIST) $(am__flickrdf_SOURCES_DIST) \ - $(am__list_methods_SOURCES_DIST) \ - $(am__oauth_test_SOURCES_DIST) + $(am__list_methods_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -171,6 +181,7 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -234,12 +245,14 @@ RAPTOR_CFLAGS = @RAPTOR_CFLAGS@ RAPTOR_LIBS = @RAPTOR_LIBS@ RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@ +RECHO = @RECHO@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STANDARD_CFLAGS = @STANDARD_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -304,9 +317,6 @@ codegen_LDADD = $(top_builddir)/src/libflickcurl.la list_methods_SOURCES = list-methods.c $(am__append_8) list_methods_LDADD = $(top_builddir)/src/libflickcurl.la -@FLICKCURL_OAUTH_TRUE@oauth_test_SOURCES = oauth-test.c \ -@FLICKCURL_OAUTH_TRUE@ $(am__append_10) -@FLICKCURL_OAUTH_TRUE@oauth_test_LDADD = $(top_builddir)/src/libflickcurl.la all: all-am .SUFFIXES: @@ -343,8 +353,11 @@ $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ @@ -400,21 +413,18 @@ else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad -codegen$(EXEEXT): $(codegen_OBJECTS) $(codegen_DEPENDENCIES) +codegen$(EXEEXT): $(codegen_OBJECTS) $(codegen_DEPENDENCIES) $(EXTRA_codegen_DEPENDENCIES) @rm -f codegen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(codegen_OBJECTS) $(codegen_LDADD) $(LIBS) -flickcurl$(EXEEXT): $(flickcurl_OBJECTS) $(flickcurl_DEPENDENCIES) +flickcurl$(EXEEXT): $(flickcurl_OBJECTS) $(flickcurl_DEPENDENCIES) $(EXTRA_flickcurl_DEPENDENCIES) @rm -f flickcurl$(EXEEXT) $(AM_V_CCLD)$(flickcurl_LINK) $(flickcurl_OBJECTS) $(flickcurl_LDADD) $(LIBS) -flickrdf$(EXEEXT): $(flickrdf_OBJECTS) $(flickrdf_DEPENDENCIES) +flickrdf$(EXEEXT): $(flickrdf_OBJECTS) $(flickrdf_DEPENDENCIES) $(EXTRA_flickrdf_DEPENDENCIES) @rm -f flickrdf$(EXEEXT) $(AM_V_CCLD)$(flickrdf_LINK) $(flickrdf_OBJECTS) $(flickrdf_LDADD) $(LIBS) -list-methods$(EXEEXT): $(list_methods_OBJECTS) $(list_methods_DEPENDENCIES) +list-methods$(EXEEXT): $(list_methods_OBJECTS) $(list_methods_DEPENDENCIES) $(EXTRA_list_methods_DEPENDENCIES) @rm -f list-methods$(EXEEXT) $(AM_V_CCLD)$(LINK) $(list_methods_OBJECTS) $(list_methods_LDADD) $(LIBS) -oauth-test$(EXEEXT): $(oauth_test_OBJECTS) $(oauth_test_DEPENDENCIES) - @rm -f oauth-test$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(oauth_test_OBJECTS) $(oauth_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -430,111 +440,97 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flickrdf-raptor_fake.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list-methods.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth-test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< flickcurl-flickcurl.o: flickcurl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -MT flickcurl-flickcurl.o -MD -MP -MF $(DEPDIR)/flickcurl-flickcurl.Tpo -c -o flickcurl-flickcurl.o `test -f 'flickcurl.c' || echo '$(srcdir)/'`flickcurl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickcurl-flickcurl.Tpo $(DEPDIR)/flickcurl-flickcurl.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='flickcurl.c' object='flickcurl-flickcurl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flickcurl.c' object='flickcurl-flickcurl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-flickcurl.o `test -f 'flickcurl.c' || echo '$(srcdir)/'`flickcurl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-flickcurl.o `test -f 'flickcurl.c' || echo '$(srcdir)/'`flickcurl.c flickcurl-flickcurl.obj: flickcurl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -MT flickcurl-flickcurl.obj -MD -MP -MF $(DEPDIR)/flickcurl-flickcurl.Tpo -c -o flickcurl-flickcurl.obj `if test -f 'flickcurl.c'; then $(CYGPATH_W) 'flickcurl.c'; else $(CYGPATH_W) '$(srcdir)/flickcurl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickcurl-flickcurl.Tpo $(DEPDIR)/flickcurl-flickcurl.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='flickcurl.c' object='flickcurl-flickcurl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flickcurl.c' object='flickcurl-flickcurl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-flickcurl.obj `if test -f 'flickcurl.c'; then $(CYGPATH_W) 'flickcurl.c'; else $(CYGPATH_W) '$(srcdir)/flickcurl.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-flickcurl.obj `if test -f 'flickcurl.c'; then $(CYGPATH_W) 'flickcurl.c'; else $(CYGPATH_W) '$(srcdir)/flickcurl.c'; fi` flickcurl-getopt.o: getopt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -MT flickcurl-getopt.o -MD -MP -MF $(DEPDIR)/flickcurl-getopt.Tpo -c -o flickcurl-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickcurl-getopt.Tpo $(DEPDIR)/flickcurl-getopt.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getopt.c' object='flickcurl-getopt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='flickcurl-getopt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c flickcurl-getopt.obj: getopt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -MT flickcurl-getopt.obj -MD -MP -MF $(DEPDIR)/flickcurl-getopt.Tpo -c -o flickcurl-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickcurl-getopt.Tpo $(DEPDIR)/flickcurl-getopt.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getopt.c' object='flickcurl-getopt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='flickcurl-getopt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickcurl_CFLAGS) $(CFLAGS) -c -o flickcurl-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi` flickrdf-flickrdf.o: flickrdf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -MT flickrdf-flickrdf.o -MD -MP -MF $(DEPDIR)/flickrdf-flickrdf.Tpo -c -o flickrdf-flickrdf.o `test -f 'flickrdf.c' || echo '$(srcdir)/'`flickrdf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickrdf-flickrdf.Tpo $(DEPDIR)/flickrdf-flickrdf.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='flickrdf.c' object='flickrdf-flickrdf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flickrdf.c' object='flickrdf-flickrdf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-flickrdf.o `test -f 'flickrdf.c' || echo '$(srcdir)/'`flickrdf.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-flickrdf.o `test -f 'flickrdf.c' || echo '$(srcdir)/'`flickrdf.c flickrdf-flickrdf.obj: flickrdf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -MT flickrdf-flickrdf.obj -MD -MP -MF $(DEPDIR)/flickrdf-flickrdf.Tpo -c -o flickrdf-flickrdf.obj `if test -f 'flickrdf.c'; then $(CYGPATH_W) 'flickrdf.c'; else $(CYGPATH_W) '$(srcdir)/flickrdf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickrdf-flickrdf.Tpo $(DEPDIR)/flickrdf-flickrdf.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='flickrdf.c' object='flickrdf-flickrdf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flickrdf.c' object='flickrdf-flickrdf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-flickrdf.obj `if test -f 'flickrdf.c'; then $(CYGPATH_W) 'flickrdf.c'; else $(CYGPATH_W) '$(srcdir)/flickrdf.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-flickrdf.obj `if test -f 'flickrdf.c'; then $(CYGPATH_W) 'flickrdf.c'; else $(CYGPATH_W) '$(srcdir)/flickrdf.c'; fi` flickrdf-getopt.o: getopt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -MT flickrdf-getopt.o -MD -MP -MF $(DEPDIR)/flickrdf-getopt.Tpo -c -o flickrdf-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickrdf-getopt.Tpo $(DEPDIR)/flickrdf-getopt.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getopt.c' object='flickrdf-getopt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='flickrdf-getopt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-getopt.o `test -f 'getopt.c' || echo '$(srcdir)/'`getopt.c flickrdf-getopt.obj: getopt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -MT flickrdf-getopt.obj -MD -MP -MF $(DEPDIR)/flickrdf-getopt.Tpo -c -o flickrdf-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickrdf-getopt.Tpo $(DEPDIR)/flickrdf-getopt.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getopt.c' object='flickrdf-getopt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getopt.c' object='flickrdf-getopt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-getopt.obj `if test -f 'getopt.c'; then $(CYGPATH_W) 'getopt.c'; else $(CYGPATH_W) '$(srcdir)/getopt.c'; fi` flickrdf-raptor_fake.o: raptor_fake.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -MT flickrdf-raptor_fake.o -MD -MP -MF $(DEPDIR)/flickrdf-raptor_fake.Tpo -c -o flickrdf-raptor_fake.o `test -f 'raptor_fake.c' || echo '$(srcdir)/'`raptor_fake.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickrdf-raptor_fake.Tpo $(DEPDIR)/flickrdf-raptor_fake.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='raptor_fake.c' object='flickrdf-raptor_fake.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='raptor_fake.c' object='flickrdf-raptor_fake.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-raptor_fake.o `test -f 'raptor_fake.c' || echo '$(srcdir)/'`raptor_fake.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-raptor_fake.o `test -f 'raptor_fake.c' || echo '$(srcdir)/'`raptor_fake.c flickrdf-raptor_fake.obj: raptor_fake.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -MT flickrdf-raptor_fake.obj -MD -MP -MF $(DEPDIR)/flickrdf-raptor_fake.Tpo -c -o flickrdf-raptor_fake.obj `if test -f 'raptor_fake.c'; then $(CYGPATH_W) 'raptor_fake.c'; else $(CYGPATH_W) '$(srcdir)/raptor_fake.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/flickrdf-raptor_fake.Tpo $(DEPDIR)/flickrdf-raptor_fake.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='raptor_fake.c' object='flickrdf-raptor_fake.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='raptor_fake.c' object='flickrdf-raptor_fake.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-raptor_fake.obj `if test -f 'raptor_fake.c'; then $(CYGPATH_W) 'raptor_fake.c'; else $(CYGPATH_W) '$(srcdir)/raptor_fake.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(flickrdf_CFLAGS) $(CFLAGS) -c -o flickrdf-raptor_fake.obj `if test -f 'raptor_fake.c'; then $(CYGPATH_W) 'raptor_fake.c'; else $(CYGPATH_W) '$(srcdir)/raptor_fake.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -641,10 +637,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: diff -Nru flickcurl-1.22/utils/codegen.c flickcurl-1.24/utils/codegen.c --- flickcurl-1.22/utils/codegen.c 2011-10-21 20:41:12.000000000 +0000 +++ flickcurl-1.24/utils/codegen.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * codegen utility - Make C code from Flickr API by reflection * - * Copyright (C) 2007-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -275,7 +275,7 @@ argv[1], section); fprintf(stdout, -" * Copyright (C) 2010, David Beckett http://www.dajobe.org/\n" +" * Copyright (C) 2010-2012, David Beckett http://www.dajobe.org/\n" " * \n" " * This file is licensed under the following three licenses as alternatives:\n" " * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version\n" diff -Nru flickcurl-1.22/utils/flickcurl.c flickcurl-1.24/utils/flickcurl.c --- flickcurl-1.22/utils/flickcurl.c 2011-10-21 20:41:12.000000000 +0000 +++ flickcurl-1.24/utils/flickcurl.c 2013-03-06 05:38:09.000000000 +0000 @@ -2,7 +2,7 @@ * * flickcurl utility - Invoke the Flickcurl library * - * Copyright (C) 2007-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -21,8 +21,14 @@ * * ~/.flickcurl.conf should contain the authentication details in the form: * [flickr] - * auth_token=1234567-8901234567890123 + * oauth_token=1234567-8901234567890123 + * oauth_token_secret=fedcba9876543210 + * oauth_client_key=0123456789abcdef0123456789abcdef + * oauth_client_secret=fedcba9876543210 + * + * If the old Flickr auth is used the values will be: * api_key=0123456789abcdef0123456789abcdef + * auth_token=1234567-8901234567890123 * secret=fedcba9876543210 * * To authenticate from a FROB - to generate an auth_token from a FROB use: @@ -87,6 +93,10 @@ static FILE* output_fh; static const char *output_filename = ""; +static const char* config_filename = ".flickcurl.conf"; +static const char* config_section = "flickr"; +char config_path[1024]; + static const char* my_basename(const char *name) @@ -460,8 +470,12 @@ command_photos_getInfo(flickcurl* fc, int argc, char *argv[]) { flickcurl_photo* photo; - - photo = flickcurl_photos_getInfo(fc, argv[1]); + const char *secret = NULL; + + if(argv[2]) + secret = argv[2]; + + photo = flickcurl_photos_getInfo2(fc, argv[1], secret); if(photo) { fprintf(stdout, "%s: ", program); @@ -1909,15 +1923,31 @@ command_print_group(flickcurl_group* g) { fprintf(stdout, - "group: nsid %s name '%s' description '%s' lang '%s'\n" - " admin %d pool moderated %d 18+ %d privacy %d\n" - " photos %d iconserver %d members %d\n" - " throttle count %d mode '%s' remaining %d\n", - g->nsid, g->name, (g->description ? g->description : ""), - (g->lang ? g->lang : ""), - g->is_admin, g->is_pool_moderated, g->is_eighteenplus, g->privacy, - g->photos, g->iconserver, g->members, - g->throttle_count, (g->throttle_mode ? g->throttle_mode : ""), g->throttle_remaining); + "group: nsid %s name '%s'\n" + " description '%s' lang '%s'\n" + " rules '%s'\n" + " user is? admin %d moderator %d member %d\n" + " pool moderated %d privacy %d\n" + " iconserver %d iconfarm %d\n" + " photos %d members %d\n" + " throttle count %d mode '%s' remaining %d\n" + " pool count %d topic count %d\n" + " restrictions photos %d videos %d images %d screens %d art %d\n" + " restrictions safe %d moderate %d restricted %d\n" + " restrictions has geo %d\n", + g->nsid, g->name, + (g->description ? g->description : ""), (g->lang ? g->lang : ""), + (g->rules ? g->rules: ""), + g->is_admin, g->is_moderator, g->is_member, + g->is_pool_moderated, g->privacy, + g->iconserver, g->iconfarm, + g->photos, g->members, + g->throttle_count, (g->throttle_mode ? g->throttle_mode : ""), g->throttle_remaining, + g->pool_count, g->topic_count, + g->photos_ok, g->videos_ok, g->images_ok, g->screens_ok, g->art_ok, + g->safe_ok, g->moderate_ok, g->restricted_ok, + g->has_geo + ); } @@ -3527,6 +3557,35 @@ static int +command_contacts_getPublicList(flickcurl* fc, int argc, char *argv[]) +{ + flickcurl_contact **contacts = NULL; + const char* user_id = NULL; + int page = -1; + int per_page = -1; + + user_id = argv[1]; + if(argc >2) { + per_page = parse_page_param(argv[2]); + if(argc >3) { + page = parse_page_param(argv[3]); + } + } + + contacts = flickcurl_contacts_getPublicList(fc, user_id, page, per_page); + if(contacts) { + int i; + for(i = 0; contacts[i]; i++) + command_print_contact(contacts[i], i); + + flickcurl_free_contacts(contacts); + } + + return (contacts == NULL); +} + + +static int command_places_getShapeHistory(flickcurl* fc, int argc, char *argv[]) { flickcurl_shapedata **shapes = NULL; @@ -4930,6 +4989,99 @@ } +static int +command_oauth_create(flickcurl* fc, int argc, char *argv[]) +{ + char *callback = NULL; + char* uri; + int rc; + + if(argc > 1) + callback = argv[1]; + + rc = flickcurl_oauth_create_request_token(fc, callback); + if(rc) { + fprintf(stderr, "%s: Failed to create OAuth Request token/secret\n", + program); + return 1; + } + + fprintf(stderr, "%s: Request token %s and request token secret %s\n", + program, + flickcurl_get_oauth_request_token(fc), + flickcurl_get_oauth_request_token_secret(fc)); + + uri = flickcurl_oauth_get_authorize_uri(fc); + if(uri) { + fprintf(stderr, "%s: Authorize uri is %s\n", program, uri); + free(uri); + } + + return 0; +} + + +static int +command_oauth_verify(flickcurl* fc, int argc, char *argv[]) +{ + int rc; + + const char* request_token = argv[1]; + const char* request_token_secret = argv[2]; + const char* verifier = argv[3]; + + flickcurl_set_oauth_request_token(fc, request_token); + flickcurl_set_oauth_request_token_secret(fc, request_token_secret); + rc = flickcurl_oauth_create_access_token(fc, verifier); + if(rc) { + fprintf(stderr, "%s: Failed to verify OAuth Request\n", + program); + return 1; + } + + fprintf(stderr, + "%s: Returned OAuth token '%s' and token secret '%s'\n", + program, + flickcurl_get_oauth_token(fc), + flickcurl_get_oauth_token_secret(fc)); + + rc = flickcurl_config_write_ini(fc, config_path, config_section); + if(!rc) + fprintf(stdout, + "%s: Updated configuration file %s with OAuth tokens\n", + program, config_path); + + return 0; +} + + +static int +command_oauth_upgrade(flickcurl* fc, int argc, char *argv[]) +{ + int rc; + + rc = flickcurl_auth_oauth_getAccessToken(fc); + if(rc) { + fprintf(stderr, "%s: Failed to upgrade to OAuth\n", program); + return 1; + } + + fprintf(stderr, + "%s: Upgraded to OAuth token '%s' and token secret '%s'\n", + program, + flickcurl_get_oauth_token(fc), + flickcurl_get_oauth_token_secret(fc)); + + rc = flickcurl_config_write_ini(fc, config_path, config_section); + if(!rc) + fprintf(stdout, + "%s: Updated configuration file %s with OAuth tokens\n", + program, config_path); + + return 0; +} + + typedef struct { @@ -5005,6 +5157,9 @@ {"contacts.getListRecentlyUploaded", "[DATE-LAST-UPLOAD [FILTER]]", "Get a list of recent uploading contacts since DATE-LAST-UPLOAD with optional FILTER", command_contacts_getListRecentlyUploaded, 0, 2}, + {"contacts.getPublicList", + "USER-NSID [PER-PAGE [PAGE]]", "Get the contact list for user USER-ID", + command_contacts_getPublicList, 1, 3}, {"favorites.add", "PHOTO-ID", "Adds PHOTO-ID to the current user's favorites.", @@ -5013,10 +5168,10 @@ "PHOTO-ID USER-NSID [NUM-PREV [NUM-NEXT [EXTRAS]]]", "Get context photos around USER-ID's favorite PHOTO-ID.", command_favorites_getContext, 2, 5}, {"favorites.getList", - "USER-NSID [[PER-PAGE] [PAGE [FORMAT]]]", "Get a list of USER-NSID's favorite photos.", + "USER-NSID [PER-PAGE [PAGE [FORMAT]]]", "Get a list of USER-NSID's favorite photos.", command_favorites_getList, 1, 4}, {"favorites.getPublicList", - "USER-NSID [[PER-PAGE] [PAGE [FORMAT]]]", "Get a list of USER-NSID's favorite public photos.", + "USER-NSID [PER-PAGE [PAGE [FORMAT]]]", "Get a list of USER-NSID's favorite public photos.", command_favorites_getPublicList, 1, 4}, {"favorites.remove", "PHOTO-ID", "Removes PHOTO-ID to the current user's favorites.", @@ -5071,10 +5226,10 @@ "PHOTO-ID GROUP-ID", "Get next and previous photos for PHOTO-ID in GROUP-ID pool.", command_groups_pools_getContext, 2, 2}, {"groups.pools.getGroups", - "[PAGE [PER-PAGE]]", "Get list of groups a user can add to.", + "[PER-PAGE [PAGE]]", "Get list of groups a user can add to.", command_groups_pools_getGroups, 0, 2}, {"groups.pools.getPhotos", - "GROUP-ID [PAGE [PER-PAGE [FORMAT]]]", "Get list of photos in GROUP-ID.", + "GROUP-ID [PER-PAGE [PAGE [FORMAT]]]", "Get list of photos in GROUP-ID.", command_groups_pools_getPhotos, 1, 4}, {"groups.pools.remove", "PHOTO-ID GROUP-ID", "Remove PHOTO-ID from group GROUP-ID.", @@ -5160,8 +5315,8 @@ "PHOTO-ID [PER-PAGE [PAGE]]", "Get favourites information about one photo with id PHOTO-ID", command_photos_getFavorites, 1, 3}, {"photos.getInfo", - "PHOTO-ID", "Get information about one photo with id PHOTO-ID", - command_photos_getInfo, 1, 1}, + "PHOTO-ID [SECRET]", "Get information about one photo PHOTO-ID with optional SECRET", + command_photos_getInfo, 1, 2}, {"photos.getNotInSet", "[PER-PAGE [PAGE [FORMAT]]]", "Get list of photos that are not in any set", command_photos_getNotInSet, 0, 3}, @@ -5514,6 +5669,18 @@ "IMAGE-URL", "Get the photo id from a raw flickr farm IMAGE-URL", command_source_uri_to_photoid, 1, 1}, + {"oauth.create", + "[CALLBACK]", "Create OAuth request token/secret pair and show the authentication URL", + command_oauth_create, 0, 1}, + + {"oauth.verify", + "REQUEST-TOKEN REQUEST-TOKEN-SECRET VERIFIER", "Verify an OAuth request from `oauth-create'", + command_oauth_verify, 3, 3}, + + {"oauth.upgrade", + "", "Upgrade legacy authentication to OAuth", + command_oauth_upgrade, 0, 0}, + {NULL, NULL, NULL, NULL, 0, 0} @@ -5523,8 +5690,6 @@ static const char *title_format_string = "Flickr API utility %s\n"; -static const char* config_filename = ".flickcurl.conf"; -static const char* config_section = "flickr"; static void @@ -5601,7 +5766,6 @@ int read_auth = 1; int i; const char* home; - char config_path[1024]; int request_delay= -1; char *command = NULL; @@ -5643,21 +5807,31 @@ } fprintf(stderr, "%s: Configuration file %s not found.\n\n" -"1. Visit http://www.flickr.com/services/api/keys/ and obtain a\n" -"mobile application , and .\n" +"1. Visit http://www.flickr.com/services/api/keys/ to get an \n" +" and .\n" "\n" "2. Create %s in this format:\n" "[flickr]\n" -"api_key=\n" -"secret=\n" +"oauth_client_key=\n" +"oauth_client_secret=\n" +"\n" +"3. Call this program with:\n" +" %s oauth-create\n" +" (or %s oauth-create if you understand and need that)\n" +"This gives a and \n" "\n" -"3. Visit the in a browser to get a \n" +"4. Visit the and approve the request to get a \n" "\n" -"4. Call this program with the frob:\n" -" %s -a \n" -"to update the configuration file with the authentication token.\n" +"5. Call this program with the , \n" +" and :\n" +" %s oauth-verify \n" +"\n" +"This will write the configuration file with the OAuth access tokens.\n" "See http://librdf.org/flickcurl/api/flickcurl-auth.html for full instructions.\n", - program, config_path, config_path, program); + program, config_path, + config_path, + program, program, + program); rc = 1; goto tidy; } @@ -5723,6 +5897,14 @@ rc = atoi(optarg); if(rc == 0) { + puts(".LP\n" + "In the following list of commands:\n" + ".br\n" + "\\fIPER-PAGE\\fR is photos per result page or '-' for default (10)\n" + ".br\n" + "\\fIPAGE\\fR is result page number or '-' for default (1 = first page)\n" + ); + qsort(commands, (sizeof(commands) / sizeof(flickcurl_cmd))-1, sizeof(flickcurl_cmd), flickcurl_cmd_compare); diff -Nru flickcurl-1.22/utils/flickrdf.c flickcurl-1.24/utils/flickrdf.c --- flickcurl-1.22/utils/flickrdf.c 2011-10-21 20:41:12.000000000 +0000 +++ flickcurl-1.24/utils/flickrdf.c 2013-04-11 04:56:09.000000000 +0000 @@ -2,7 +2,7 @@ * * flickrdf - Triples from Flickrs * - * Copyright (C) 2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2011-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version @@ -163,7 +163,7 @@ raptor_free_uri(predicate_ns_uri); if(object_type == FLICKCURL_TERM_TYPE_RESOURCE) - s.object = (void*)raptor_new_term_from_uri_string(rworld, (const unsigned char*)object); + s.object = raptor_new_term_from_uri_string(rworld, (const unsigned char*)object); else if(object_type == FLICKCURL_TERM_TYPE_BLANK) s.object = raptor_new_term_from_blank(rworld, (const unsigned char*)subject); else { diff -Nru flickcurl-1.22/utils/list-methods.c flickcurl-1.24/utils/list-methods.c --- flickcurl-1.22/utils/list-methods.c 2011-10-21 20:41:12.000000000 +0000 +++ flickcurl-1.24/utils/list-methods.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * list-methods utility - List all Flickr API methods via reflection * - * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2008-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version diff -Nru flickcurl-1.22/utils/oauth-test.c flickcurl-1.24/utils/oauth-test.c --- flickcurl-1.22/utils/oauth-test.c 2011-11-12 06:26:16.000000000 +0000 +++ flickcurl-1.24/utils/oauth-test.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,406 +0,0 @@ -/* -*- Mode: c; c-basic-offset: 2 -*- - * - * Flickr OAuth test utility - * - * Copyright (C) 2011, David Beckett http://www.dajobe.org/ - * - * This file is licensed under the following three licenses as alternatives: - * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version - * 2. GNU General Public License (GPL) V2 or any newer version - * 3. Apache License, V2.0 or any newer version - * - * You may not use this file except in compliance with at least one of - * the above three licenses. - * - * See LICENSE.html or LICENSE.txt at the top of this package for the - * complete terms and further detail along with the license texts for - * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. - * - * - * USAGE: oauth-test [OPTIONS] - * - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#include - -/* many places for getopt */ -#ifdef HAVE_GETOPT_H -#include -#else -#include -#endif - -#include -#include - - - -#ifdef NEED_OPTIND_DECLARATION -extern int optind; -extern char *optarg; -#endif - - -static const char* program; - -static const char* -my_basename(const char *name) -{ - char *p; - if((p = strrchr(name, '/'))) - name = p+1; - else if((p = strrchr(name, '\\'))) - name = p+1; - - return name; -} - - -static void -my_message_handler(void *user_data, const char *message) -{ - fprintf(stderr, "%s: ERROR: %s\n", program, message); -} - - -static int -oauth_prepare(flickcurl *fc, - const char* method, const char* parameters[][2], int count) -{ - if(!method) { - flickcurl_error(fc, "No method to prepare"); - return 1; - } - - return flickcurl_oauth_prepare_common(fc, - fc->service_uri, - method, - NULL, NULL, - parameters, count, - 1, 1); -} - - -static int -oauth_test_echo(flickcurl* fc, - const char* key, const char* value) -{ - const char * parameters[2 + FLICKCURL_MAX_OAUTH_PARAM_COUNT][2]; - int count = 0; - xmlDocPtr doc = NULL; - int rc = 0; - - parameters[count][0] = key; - parameters[count++][1]= value; - - parameters[count][0] = NULL; - - if(oauth_prepare(fc, "flickr.test.echo", parameters, count)) { - rc = 1; - goto tidy; - } - - doc = flickcurl_invoke(fc); - if(!doc) { - rc = 1; - goto tidy; - } - - fprintf(stderr, "Flickr echo returned %d bytes\n", fc->total_bytes); - - tidy: - - return rc; -} - - - - -#ifdef HAVE_GETOPT_LONG -#define HELP_TEXT(short, long, description) " -" short ", --" long " " description -#define HELP_TEXT_LONG(long, description) " --" long " " description -#define HELP_ARG(short, long) "--" #long -#define HELP_PAD "\n " -#else -#define HELP_TEXT(short, long, description) " -" short " " description -#define HELP_TEXT_LONG(long, description) -#define HELP_ARG(short, long) "-" #short -#define HELP_PAD "\n " -#endif - - -#define GETOPT_STRING "hv" - -#ifdef HAVE_GETOPT_LONG -static struct option long_options[] = -{ - /* name, has_arg, flag, val */ - {"help", 0, 0, 'h'}, - {"version", 0, 0, 'v'}, - {NULL, 0, 0, 0} -}; -#endif - - -static const char *title_format_string = "Flickr OAuth test utility %s\n"; - -static const char* config_filename = ".flickcurl.conf"; -static const char* config_section = "flickr"; - - -static void -print_help_string(void) -{ - printf(title_format_string, flickcurl_version_string); - puts("Flickr OAuth test utility."); - printf("Usage: %s [OPTIONS] COMMANDS\n\n", program); - - fputs(flickcurl_copyright_string, stdout); - fputs("\nLicense: ", stdout); - puts(flickcurl_license_string); - fputs("Flickcurl home page: ", stdout); - puts(flickcurl_home_url_string); - - fputs("\n", stdout); - - puts(HELP_TEXT("h", "help ", "Print this help, then exit")); - puts(HELP_TEXT("v", "version ", "Print the flickcurl version")); - - fputs("\nCOMMANDS\n", stdout); - - puts(" request_token\n Ask for an OAuth request token and show the authorize url.\n"); - puts(" access_token REQUEST_TOKEN REQUEST_TOKEN_SECRET VERIFIER\n Use a request token with verifier to get an access token.\n"); - puts(" echo\n Run the test.echo API call using OAuth.\n"); -} - - - -int -main(int argc, char *argv[]) -{ - flickcurl *fc = NULL; - int rc = 0; - int usage = 0; - int help = 0; - int cmd_index = -1; - int read_auth = 1; - const char* home; - char config_path[1024]; - char *command = NULL; - - flickcurl_init(); - - program = my_basename(argv[0]); - - home = getenv("HOME"); - if(home) - sprintf(config_path, "%s/%s", home, config_filename); - else - strcpy(config_path, config_filename); - - - /* Initialise the Flickcurl library */ - fc = flickcurl_new(); - if(!fc) { - rc = 1; - goto tidy; - } - - flickcurl_set_error_handler(fc, my_message_handler, NULL); - - if(read_auth && !access((const char*)config_path, R_OK)) { - if(flickcurl_config_read_ini(fc, config_path, config_section, fc, - flickcurl_config_var_handler)) { - rc = 1; - goto tidy; - } - } - - - while (!usage && !help) - { - int c; -#ifdef HAVE_GETOPT_LONG - int option_index = 0; - - c = getopt_long (argc, argv, GETOPT_STRING, long_options, &option_index); -#else - c = getopt (argc, argv, GETOPT_STRING); -#endif - if (c == -1) - break; - - switch (c) { - case 0: - case '?': /* getopt() - unknown option */ - usage = 1; - break; - - case 'h': - help = 1; - break; - - case 'v': - fputs(flickcurl_version_string, stdout); - fputc('\n', stdout); - - exit(0); - } - - } - - argv += optind; - argc -= optind; - - if(!help && !argc) { - usage = 2; /* Title and usage */ - goto usage; - } - - if(!help && !argc) { - usage = 2; /* Title and usage */ - goto usage; - } - - if(usage || help) - goto usage; - - - command = argv[0]; - - if(!strncmp(command, "flickr.", 7)) - command += 7; - - if(!strcmp(command, "request_token")) { - cmd_index = 0; - } else if(!strcmp(command, "access_token")) { - cmd_index = 1; - } else if(!strcmp(command, "echo")) { - cmd_index = 2; - } - - if(cmd_index < 0) { - fprintf(stderr, "%s: No such command `%s'\n", program, command); - usage = 1; - goto usage; - } - - - usage: - if(usage) { - if(usage>1) { - fprintf(stderr, title_format_string, flickcurl_version_string); - fputs("Flickcurl home page: ", stderr); - fputs(flickcurl_home_url_string, stderr); - fputc('\n', stderr); - fputs(flickcurl_copyright_string, stderr); - fputs("\nLicense: ", stderr); - fputs(flickcurl_license_string, stderr); - fputs("\n\n", stderr); - } - fprintf(stderr, "Try `%s " HELP_ARG(h, help) "' for more information.\n", - program); - rc = 1; - goto tidy; - } - - if(help) { - print_help_string(); - rc = 0; - goto tidy; - } - - - /* Request token */ - if(cmd_index == 0) { - flickcurl_oauth_data* od = &fc->od; - - memset(od, '\0', sizeof(od)); - - od->client_key = fc->api_key; - od->client_key_len = strlen(od->client_key); - od->client_secret = fc->secret; - od->client_secret_len = strlen(od->client_secret); - - rc = flickcurl_oauth_request_token(fc); - - if(!rc) { - char* uri; - - fprintf(stderr, - "OAuth request token returned token '%s' secret token '%s'\n", - od->request_token, od->request_token_secret); - - uri = flickcurl_oauth_get_authorize_uri(fc); - if(uri) { - fprintf(stderr, "%s: Authorize uri is %s\n", program, uri); - free(uri); - } - } - } - - - /* Access token */ - if(cmd_index == 1) { - flickcurl_oauth_data* od = &fc->od; - const char* request_token = argv[1]; - const char* request_token_secret = argv[2]; - const char* verifier = argv[3]; - - memset(od, '\0', sizeof(od)); - - od->client_key = fc->api_key; - od->client_key_len = strlen(od->client_key); - od->client_secret = fc->secret; - od->client_secret_len = strlen(od->client_secret); - od->request_token = (char*)request_token; - od->request_token_len = strlen(request_token); - od->request_token_secret = (char*)request_token_secret; - od->request_token_secret_len = strlen(request_token_secret); - - rc = flickcurl_oauth_access_token(fc, verifier); - - if(!rc) { - fprintf(stderr, - "OAuth access token returned token '%s' secret token '%s'\n", - od->token, od->token_secret); - } - - } - - - if(cmd_index == 2) { - flickcurl_oauth_data* od = &fc->od; - - memset(od, '\0', sizeof(od)); - - rc = oauth_test_echo(fc, "hello", "world"); - } - - - tidy: - - if(fc) - flickcurl_free(fc); - - flickcurl_finish(); - - return(rc); -} diff -Nru flickcurl-1.22/utils/raptor_fake.c flickcurl-1.24/utils/raptor_fake.c --- flickcurl-1.22/utils/raptor_fake.c 2011-03-26 17:43:10.000000000 +0000 +++ flickcurl-1.24/utils/raptor_fake.c 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * raptor_fake.c - Fake Raptor V2 - just enough for flickrdf.c * - * Copyright (C) 2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2011-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version diff -Nru flickcurl-1.22/utils/raptor_fake.h flickcurl-1.24/utils/raptor_fake.h --- flickcurl-1.22/utils/raptor_fake.h 2011-03-26 17:43:10.000000000 +0000 +++ flickcurl-1.24/utils/raptor_fake.h 2012-08-27 15:43:44.000000000 +0000 @@ -2,7 +2,7 @@ * * raptor_fake.h - Fake Raptor V2 API - just enough for flickrdf.c * - * Copyright (C) 2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2011-2012, David Beckett http://www.dajobe.org/ * * This file is licensed under the following three licenses as alternatives: * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
      photo ID

      secret :

      secret (or NULL)

      Returns :

      flickcurl_photo or NULL on failure