3
3
* photos-notes-api.c - Flickr flickr.photos.notes.* API calls
5
* Copyright (C) 2007-2008, David Beckett http://www.dajobe.org/
5
* Copyright (C) 2007-2012, David Beckett http://www.dajobe.org/
7
7
* This file is licensed under the following three licenses as alternatives:
8
8
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
66
66
int note_x, int note_y, int note_w, int note_h,
67
67
const char* note_text)
69
const char* parameters[13][2];
71
69
xmlDocPtr doc = NULL;
72
70
xmlXPathContextPtr xpathCtx = NULL;
77
flickcurl_init_params(fc);
79
79
if(!photo_id || !note_text)
82
parameters[count][0] = "photo_id";
83
parameters[count++][1]= photo_id;
84
parameters[count][0] = "note_x";
82
flickcurl_add_param(fc, "photo_id", photo_id);
85
83
sprintf(note_x_s, "%d", note_x);
86
parameters[count++][1]= note_x_s;
87
parameters[count][0] = "note_y";
84
flickcurl_add_param(fc, "note_x", note_x_s);
88
85
sprintf(note_y_s, "%d", note_y);
89
parameters[count++][1]= note_y_s;
90
parameters[count][0] = "note_w";
86
flickcurl_add_param(fc, "note_y", note_y_s);
91
87
sprintf(note_w_s, "%d", note_w);
92
parameters[count++][1]= note_w_s;
93
parameters[count][0] = "note_h";
88
flickcurl_add_param(fc, "note_w", note_w_s);
94
89
sprintf(note_h_s, "%d", note_h);
95
parameters[count++][1]= note_h_s;
96
parameters[count][0] = "note_text";
97
parameters[count++][1]= note_text;
99
parameters[count][0] = NULL;
101
if(flickcurl_prepare(fc, "flickr.photos.notes.add", parameters, count))
90
flickcurl_add_param(fc, "note_h", note_h_s);
91
flickcurl_add_param(fc, "note_text", note_text);
93
flickcurl_end_params(fc);
95
if(flickcurl_prepare(fc, "flickr.photos.notes.add"))
104
98
flickcurl_set_write(fc, 1);
144
138
flickcurl_photos_notes_delete(flickcurl* fc, const char* note_id)
146
const char* parameters[8][2];
148
140
xmlDocPtr doc = NULL;
143
flickcurl_init_params(fc);
154
parameters[count][0] = "note_id";
155
parameters[count++][1]= note_id;
157
parameters[count][0] = NULL;
159
if(flickcurl_prepare(fc, "flickr.photos.notes.delete", parameters, count))
148
flickcurl_add_param(fc, "note_id", note_id);
150
flickcurl_end_params(fc);
152
if(flickcurl_prepare(fc, "flickr.photos.notes.delete"))
162
155
flickcurl_set_write(fc, 1);
208
199
char note_w_s[10];
209
200
char note_h_s[10];
202
flickcurl_init_params(fc);
211
204
if(!note_id || !note_text)
214
parameters[count][0] = "note_id";
215
parameters[count++][1]= note_id;
216
parameters[count][0] = "note_x";
207
flickcurl_add_param(fc, "note_id", note_id);
217
208
sprintf(note_x_s, "%d", note_x);
218
parameters[count++][1]= note_x_s;
219
parameters[count][0] = "note_y";
209
flickcurl_add_param(fc, "note_x", note_x_s);
220
210
sprintf(note_y_s, "%d", note_y);
221
parameters[count++][1]= note_y_s;
222
parameters[count][0] = "note_w";
211
flickcurl_add_param(fc, "note_y", note_y_s);
223
212
sprintf(note_w_s, "%d", note_w);
224
parameters[count++][1]= note_w_s;
225
parameters[count][0] = "note_h";
213
flickcurl_add_param(fc, "note_w", note_w_s);
226
214
sprintf(note_h_s, "%d", note_h);
227
parameters[count++][1]= note_h_s;
228
parameters[count][0] = "note_text";
229
parameters[count++][1]= note_text;
231
parameters[count][0] = NULL;
233
if(flickcurl_prepare(fc, "flickr.photos.notes.edit", parameters, count))
215
flickcurl_add_param(fc, "note_h", note_h_s);
216
flickcurl_add_param(fc, "note_text", note_text);
218
flickcurl_end_params(fc);
220
if(flickcurl_prepare(fc, "flickr.photos.notes.edit"))
236
223
flickcurl_set_write(fc, 1);