/* -*- Mode: c; c-basic-offset: 2 -*- * * test-api.c - Flickr flickr.test.* API calls * * Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ * * 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 HAVE_STDLIB_H #include #undef HAVE_STDLIB_H #endif #ifdef HAVE_UNISTD_H #include #endif #include #include /** * flickcurl_test_echo: * @fc: flickcurl context * @key: test key * @value: test value * * A testing method which echo's all parameters back in the response. * * Actually prints the returned byte count to stderr. * * Implements flickr.test.echo (0.5) * * Return value: non-0 on failure **/ 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; parameters[count][0] = NULL; if(flickcurl_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; } /** * flickcurl_test_login: * * flickr.test.login */ /** * flickcurl_test_null: * * flickr.test.null */