Miscellaneous

## Miscellaneous Miscellaneous — Miscellaneous functions. |

## Synopsis

                        flickcurl_location;
                        flickcurl_perms;
                        flickcurl_size;
    void                flickcurl_free_size                 (flickcurl_size *size);
    void                flickcurl_free_sizes                (flickcurl_size **sizes_object);
    void                flickcurl_free_location             (flickcurl_location *location);
    void                flickcurl_free_perms                (flickcurl_perms *perms);
    const char*         flickcurl_get_field_value_type_label
                                                            (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,
                                                             int per_page,
                                                             int page);
                        flickcurl_license;
    const char*         flickcurl_get_content_type_label    (int content_type);
    int                 flickcurl_get_content_type_from_string
                                                            (const char *content_type_string);
    const char*         flickcurl_get_safety_level_label    (int safety_level);
    int                 flickcurl_get_safety_level_from_string
                                                            (const char *safety_level_string);

## Description

Miscellaneous functions.

## Details

### flickcurl_location

    typedef struct {
      double latitude;
      double longitude;
      int accuracy;
    } flickcurl_location;

A Photo Location.

double `latitude`; | The latitude from -90 to 90
double `longitude`; | The longitude from -180 to 180
int `accuracy`; | Recorded accuracy level of the location. World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. Defaults to 16 if not specified. (<0 for none)

### flickcurl_perms

    typedef struct {
      int is_public;
      int is_contact;
      int is_friend;
      int is_family;
      int perm_comment;
      int perm_addmeta;
    } flickcurl_perms;

Permissions as used by `flickcurl_photos_getPerms()` and `flickcurl_photos_setPerms()` which use public, friend, family, perm_comment and perm-addmeta. flickr.photos.geo.`setPerms()` uses public, contact, friend and family.

A Photo permission.

int `is_public`; | non-0 to set the photo to public else private
int `is_contact`; | non-0 to make the photo visible to contacts when private
int `is_friend`; | non-0 to make the photo visible to friends when private
int `is_family`; | non-0 to make the photo visible to family when private
int `perm_comment`; | who can add comments to the photo and it's notes. one of: 0 nobody, 1 friends & family, 2 contacts, 3 everybody
int `perm_addmeta`; | who can add notes and tags to the photo. one of: 0 nobody / just the owner, 1 friends & family, 2 contacts, 3 everybody

### flickcurl_size

    typedef struct {
      char *label;
      int width;
      int height;
      char *source;
      char *url;
      char* media;
    } flickcurl_size;

A photo at a size.

char *`label`; | label
int `width`; | width in pixels
int `height`; | height in pixels
char *`source`; | raw image source URL
char *`url`; | url of photo page
char *`media`; | 'photo' or 'video'

### flickcurl_free_size ()

    void                flickcurl_free_size                 (flickcurl_size *size);

Destructor for size object

`size` : | size object

### flickcurl_free_sizes ()

    void                flickcurl_free_sizes                (flickcurl_size **sizes_object);

Destructor for array of size objects

`sizes_object` : | size object array

### flickcurl_free_location ()

    void                flickcurl_free_location             (flickcurl_location *location);

Destructor for location object

`location` : | location object

### flickcurl_free_perms ()

    void                flickcurl_free_perms                (flickcurl_perms *perms);

Destructor for perms object

`perms` : | perms object

### flickcurl_get_field_value_type_label ()

    const char*         flickcurl_get_field_value_type_label
                                                            (flickcurl_field_value_type datatype);

Get label for datatype

`datatype` : | datatype enum
Returns : | label string or NULL if none valid

### flickcurl_get_location_accuracy_label ()

    const char*         flickcurl_get_location_accuracy_label
                                                            (int accuracy);

Get label for an accuracy

`accuracy` : | accuracy
Returns : | label string or NULL if none valid

### 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

### flickcurl_interestingness_getList ()

    flickcurl_photo**   flickcurl_interestingness_getList   (flickcurl *fc,
                                                             const char *date,
                                                             const char *extras,
                                                             int per_page,
                                                             int page);

Returns the list of interesting photos for the most recent day or a user-specified date.

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

Implements flickr.interestingness.getList (0.13)

`fc` : | flickcurl context
`date` : | A specific date, formatted as YYYY-MM-DD, to return interesting photos for. (or NULL)
`extras` : | A comma-delimited list of extra information to fetch for each returned record. Currently supported fields are: `license`, `date_upload`, `date_taken`, `owner_name`, `icon_server`, `original_format`, `last_update`, `geo`, `tags`, `machine_tags`. (or NULL)
`per_page` : | Number of photos to return per page default 100, max 500
`page` : | The page of results to return, default 1
Returns : | non-0 on failure

### flickcurl_license

    typedef struct {
      /* license id */
      int id;
      /* license url or NULL if none */
      char *url;
      /* license name */
      char *name;
    } flickcurl_license;

A photo license.

int `id`; | license ID
char *`url`; | license URL
char *`name`; | license short name

### flickcurl_get_content_type_label ()

    const char*         flickcurl_get_content_type_label    (int content_type);

Get label for a content type.

`content_type` : | safety level index
Returns : | pointer to shared string label for content type or "unknown"

### flickcurl_get_content_type_from_string ()

    int                 flickcurl_get_content_type_from_string
                                                            (const char *content_type_string);

Get the enumeration value for a content type string.

Parses the string value into a content type either from an integer form like '1' or a label like 'photo'.

`content_type_string` : | string
Returns : | content type enumeration value or <0 on error

### flickcurl_get_safety_level_label ()

    const char*         flickcurl_get_safety_level_label    (int safety_level);

Get label for a safety level.

`safety_level` : | safety level index
Returns : | pointer to shared string label for safety level or "unknown"

### flickcurl_get_safety_level_from_string ()

    int                 flickcurl_get_safety_level_from_string
                                                            (const char *safety_level_string);

Get the enumeration value for a safety level string.

Parses the string value into a safety level either from an integer form like '1' or a label like 'safe'.

`safety_level_string` : | string
Returns : | safety level enumeration value or <0 on error