## Photoset

Photoset — Set of Photos.

## Synopsis

                        flickcurl_photoset;
    void                flickcurl_free_photoset             (flickcurl_photoset *photoset);
    void                flickcurl_free_photosets            (flickcurl_photoset **photosets_object);
    int                 flickcurl_photosets_addPhoto        (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *photo_id);
    char *              flickcurl_photosets_comments_addComment
                                                            (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *comment_text);
    int                 flickcurl_photosets_comments_deleteComment
                                                            (flickcurl *fc,
                                                             const char *comment_id);
    int                 flickcurl_photosets_comments_editComment
                                                            (flickcurl *fc,
                                                             const char *comment_id,
                                                             const char *comment_text);
    flickcurl_comment ** flickcurl_photosets_comments_getList
                                                            (flickcurl *fc,
                                                             const char *photoset_id);
    char *              flickcurl_photosets_create          (flickcurl *fc,
                                                             const char *title,
                                                             const char *description,
                                                             const char *primary_photo_id,
                                                             char **photoset_url_p);
    int                 flickcurl_photosets_delete          (flickcurl *fc,
                                                             const char *photoset_id);
    int                 flickcurl_photosets_editMeta        (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *title,
                                                             const char *description);
    int                 flickcurl_photosets_editPhotos      (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *primary_photo_id,
                                                             const char **photo_ids_array);
    flickcurl_context ** flickcurl_photosets_getContext     (flickcurl *fc,
                                                             const char *photo_id,
                                                             const char *photoset_id);
    flickcurl_photoset * flickcurl_photosets_getInfo        (flickcurl *fc,
                                                             const char *photoset_id);
    flickcurl_photoset ** flickcurl_photosets_getList       (flickcurl *fc,
                                                             const char *user_id);
    flickcurl_photo **  flickcurl_photosets_getPhotos       (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *extras,
                                                             int privacy_filter,
                                                             int per_page,
                                                             int page);
    flickcurl_photos_list * flickcurl_photosets_getPhotos_params
                                                            (flickcurl *fc,
                                                             const char *photoset_id,
                                                             int privacy_filter,
                                                             flickcurl_photos_list_params *list_params);
    int                 flickcurl_photosets_orderSets       (flickcurl *fc,
                                                             const char **photoset_ids_array);
    int                 flickcurl_photosets_removePhoto     (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *photo_id);
    int                 flickcurl_photosets_removePhotos    (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char **photo_ids_array);
    int                 flickcurl_photosets_reorderPhotos   (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char **photo_ids_array);
    int                 flickcurl_photosets_setPrimaryPhoto (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *photo_id);

## Description

Set of Photos.

## Details

### flickcurl_photoset

    typedef struct {
      char *id;
      char *primary;
      char *secret;
      int server;
      int farm;
      int photos_count;
      char* title;
      char *description;
      struct flickcurl_photo_s** photos;
      char *owner;
    } flickcurl_photoset;

A photoset.

char *`id`; | photoset ID
char *`primary`; | primary photo ID
char *`secret`; | secret
int `server`; | server
int `farm`; | farm
int `photos_count`; | count of photos in set
char *`title`; | title of photoset
char *`description`; | description of photoset (may be NULL)
struct flickcurl_photo_s **`photos`; | photos in a photoset (may be NULL)
char *`owner`; | owner NSID

### flickcurl_free_photoset ()

    void                flickcurl_free_photoset             (flickcurl_photoset *photoset);

Destructor for photoset object

`photoset` : | photoset object

### flickcurl_free_photosets ()

    void                flickcurl_free_photosets            (flickcurl_photoset **photosets_object);

Destructor for array of photoset object

`photosets_object` : | photoset object array

### flickcurl_photosets_addPhoto ()

    int                 flickcurl_photosets_addPhoto        (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *photo_id);

Add a photo to the end of an existing photoset.

Implements flickr.photosets.addPhoto (0.13)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to add a photo to.
`photo_id` : | The id of the photo to add to the set.
Returns : | non-0 on failure

### flickcurl_photosets_comments_addComment ()

    char *              flickcurl_photosets_comments_addComment
                                                            (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *comment_text);

Add a comment to a photoset.

Implements flickr.photosets.comments.addComment (0.10)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to add a comment to.
`comment_text` : | Text of the comment
Returns : | new comment ID or non-NULL on failure

### flickcurl_photosets_comments_deleteComment ()

    int                 flickcurl_photosets_comments_deleteComment
                                                            (flickcurl *fc,
                                                             const char *comment_id);

Delete a photoset comment as the currently authenticated user.

Implements flickr.photosets.comments.deleteComment (0.10)

`fc` : | flickcurl context
`comment_id` : | The id of the comment to delete from a photoset.
Returns : | non-0 on failure

### flickcurl_photosets_comments_editComment ()

    int                 flickcurl_photosets_comments_editComment
                                                            (flickcurl *fc,
                                                             const char *comment_id,
                                                             const char *comment_text);

Edit the text of a comment as the currently authenticated user.

Implements flickr.photosets.comments.editComment (0.10)

`fc` : | flickcurl context
`comment_id` : | The id of the comment to edit.
`comment_text` : | Update the comment to this text.
Returns : | non-0 on failure

### flickcurl_photosets_comments_getList ()

    flickcurl_comment ** flickcurl_photosets_comments_getList
                                                            (flickcurl *fc,
                                                             const char *photoset_id);

Returns the comments for a photoset.

Implements flickr.photosets.comments.getList (0.10)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to fetch comments for.
Returns : | array of comments or NULL on failure

### flickcurl_photosets_create ()

    char *              flickcurl_photosets_create          (flickcurl *fc,
                                                             const char *title,
                                                             const char *description,
                                                             const char *primary_photo_id,
                                                             char **photoset_url_p);

Create a new photoset for the calling user.

Implements flickr.photosets.create (0.13)

`fc` : | flickcurl context
`title` : | A title for the photoset.
`description` : | A description of the photoset which may contain limited html (or NULL)
`primary_photo_id` : | The id of the photo to represent this set. The photo must belong to the calling user.
`photoset_url_p` : | pointer to variable to store new photoset URL (or NULL)
Returns : | photoset ID or NULL on failure

### flickcurl_photosets_delete ()

    int                 flickcurl_photosets_delete          (flickcurl *fc,
                                                             const char *photoset_id);

Delete a photoset.

Implements flickr.photosets.delete (0.13)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to delete. Must be owned by the calling user.
Returns : | non-0 on failure

### flickcurl_photosets_editMeta ()

    int                 flickcurl_photosets_editMeta        (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *title,
                                                             const char *description);

Modify the meta-data for a photoset.

Implements flickr.photosets.editMeta (0.13)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to modify.
`title` : | The new title for the photoset.
`description` : | A description of the photoset which may contain limited html (or NULL)
Returns : | non-0 on failure

### flickcurl_photosets_editPhotos ()

    int                 flickcurl_photosets_editPhotos      (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *primary_photo_id,
                                                             const char **photo_ids_array);

Modify the photos in a photoset.

Use this method to add, remove and re-order photos.

Implements flickr.photosets.editPhotos (0.13)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to modify. Must belong to the calling user.
`primary_photo_id` : | The id of the photo to use as the 'primary' photo for the set. This id must also be passed along in photo_ids list argument.
`photo_ids_array` : | Array of photo ids to include in the set. They will appear in the set in the order sent. This list MUST contain the primary photo id. All photos must belong to the owner of the set. This list of photos replaces the existing list. Call flickr.photosets.addPhoto to append a photo to a set.
Returns : | non-0 on failure

### flickcurl_photosets_getContext ()

    flickcurl_context ** flickcurl_photosets_getContext     (flickcurl *fc,
                                                             const char *photo_id,
                                                             const char *photoset_id);

Get next and previous photos for a photo in a set.

Implements flickr.photosets.getContext (0.7)

`fc` : | flickcurl context
`photo_id` : | photo ID
`photoset_id` : | photoset ID
Returns : | an array of size 3 [prev, next, NULL] flickcurl_context* or NULL on error

### flickcurl_photosets_getInfo ()

    flickcurl_photoset * flickcurl_photosets_getInfo        (flickcurl *fc,
                                                             const char *photoset_id);

Gets information about a photoset.

Implements flickr.photosets.getInfo (0.13)

`fc` : | flickcurl context
`photoset_id` : | The ID of the photoset to fetch information for.
Returns : | non-0 on failure

### flickcurl_photosets_getList ()

    flickcurl_photoset ** flickcurl_photosets_getList       (flickcurl *fc,
                                                             const char *user_id);

Returns the photosets belonging to the specified user.

Implements flickr.photosets.getList (0.13)

`fc` : | flickcurl context
`user_id` : | The NSID of the user to get a photoset list for. If none is specified, the calling user is assumed (or NULL)
Returns : | array of photoset IDs or NULL on failure

### flickcurl_photosets_getPhotos ()

    flickcurl_photo **  flickcurl_photosets_getPhotos       (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *extras,
                                                             int privacy_filter,
                                                             int per_page,
                                                             int page);

Get the list of photos in a set.

See `flickcurl_photosets_getPhotos_params()` for details of parameters.

Implements flickr.photosets.getPhotos (0.13)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to return the photos for.
`extras` : | A comma-delimited list of extra information to fetch for each returned record (or NULL)
`privacy_filter` : | Return photos only matching a certain privacy level 1-5 (or <0)
`per_page` : | Number of photos to return per page. If this argument is omitted, it defaults to 500. The maximum allowed value is 500. (or <0)
`page` : | The page of results to return. If this argument is omitted, it defaults to 1. (or <0)
Returns : | list of photos or NULL on failure

### flickcurl_photosets_getPhotos_params ()

    flickcurl_photos_list * flickcurl_photosets_getPhotos_params
                                                            (flickcurl *fc,
                                                             const char *photoset_id,
                                                             int privacy_filter,
                                                             flickcurl_photos_list_params *list_params);

Get the list of photos in a set.

Currently supported extra fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update.

Optional extra type 'media' that will return an extra media = VALUE for VALUE "photo" or "video". API addition 2008-04-07.

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to return the photos for.
`privacy_filter` : | Return photos only matching a certain privacy level 1-5 (or <0)
`list_params` : | flickcurl_photos_list_params result parameters (or NULL)
Returns : | list of photos or NULL on failure

### flickcurl_photosets_orderSets ()

    int                 flickcurl_photosets_orderSets       (flickcurl *fc,
                                                             const char **photoset_ids_array);

Set the order of photosets for the calling user.

Implements flickr.photosets.orderSets (0.13)

`fc` : | flickcurl context
`photoset_ids_array` : | Array of photoset IDs, ordered with the set to show first, first in the list. Any set IDs not given in the list will be set to appear at the end of the list, ordered by their IDs.
Returns : | non-0 on failure

### flickcurl_photosets_removePhoto ()

    int                 flickcurl_photosets_removePhoto     (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *photo_id);

Remove a photo from a photoset.

Implements flickr.photosets.removePhoto (0.13)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to remove a photo from.
`photo_id` : | The id of the photo to remove from the set.
Returns : | non-0 on failure

### flickcurl_photosets_removePhotos ()

    int                 flickcurl_photosets_removePhotos    (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char **photo_ids_array);

Remove multiple photos from a photoset.

Implements flickr.photosets.removePhotos (1.19)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to remove photos from.
`photo_ids_array` : | Array of photo ids to remove from the photoset.
Returns : | non-0 on failure

### flickcurl_photosets_reorderPhotos ()

    int                 flickcurl_photosets_reorderPhotos   (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char **photo_ids_array);

(null)

Implements flickr.photosets.reorderPhotos (1.19)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to reorder. The photoset must belong to the calling user.
`photo_ids_array` : | Array of Ordered list of photo ids. Photos that are not in the list will keep their original order
Returns : | non-0 on failure

### flickcurl_photosets_setPrimaryPhoto ()

    int                 flickcurl_photosets_setPrimaryPhoto (flickcurl *fc,
                                                             const char *photoset_id,
                                                             const char *photo_id);

Set photoset primary photo

Implements flickr.photosets.setPrimaryPhoto (1.19)

`fc` : | flickcurl context
`photoset_id` : | The id of the photoset to set primary photo to.
`photo_id` : | The id of the photo to set as primary.
Returns : | non-0 on failure