# protocol

## Name

protocol --

## Synopsis

    struct      LJRequest;
    LJRequest*  lj_request_new                  (LJUser *user,
                                                 const char *mode);
    LJRequest*  lj_request_new_without_auth     (LJUser *user,
                                                 const char *mode);
    void        lj_request_free                 (LJRequest *request);
    void        lj_request_add                  (LJRequest *request,
                                                 const char *key,
                                                 const char *val);
    void        lj_request_add_int              (LJRequest *request,
                                                 const char *key,
                                                 int val);
    GString*    lj_request_to_string            (LJRequest *request);
    LJUser*     lj_request_get_user             (LJRequest *request);
    void        lj_request_dump                 (LJRequest *request);
    void        lj_request_use_challenge        (LJRequest *request,
                                                 LJChallenge challenge);
    struct      LJResult;
    LJResult*   lj_result_new_from_response     (const char *res);
    void        lj_result_free                  (LJResult *result);
    gboolean    lj_result_succeeded             (LJResult *result);
    char*       lj_result_get                   (LJResult *result,
                                                 const char *key);
    int         lj_result_get_int               (LJResult *result,
                                                 const char *key);
    char*       lj_result_getf                  (LJResult *result,
                                                 const char *key,
                                                 ...);
    int         lj_result_getf_int              (LJResult *result,
                                                 const char *key,
                                                 ...);
    char*       lj_urlencode                    (unsigned char *string);
    unsigned char* lj_urldecode                 (char *string);

## Description

## Details

### struct LJRequest

    struct LJRequest;

### lj_request_new ()

    LJRequest*  lj_request_new                  (LJUser *user,
                                                 const char *mode);

user : |
mode : |
Returns : |

### lj_request_new_without_auth ()

    LJRequest*  lj_request_new_without_auth     (LJUser *user,
                                                 const char *mode);

user : |
mode : |
Returns : |

### lj_request_free ()

    void        lj_request_free                 (LJRequest *request);

request : |

### lj_request_add ()

    void        lj_request_add                  (LJRequest *request,
                                                 const char *key,
                                                 const char *val);

request : |
key : |
val : |

### lj_request_add_int ()

    void        lj_request_add_int              (LJRequest *request,
                                                 const char *key,
                                                 int val);

request : |
key : |
val : |

### lj_request_to_string ()

    GString*    lj_request_to_string            (LJRequest *request);

request : |
Returns : |

### lj_request_get_user ()

    LJUser*     lj_request_get_user             (LJRequest *request);

request : |
Returns : |

### lj_request_dump ()

    void        lj_request_dump                 (LJRequest *request);

request : |

### lj_request_use_challenge ()

    void        lj_request_use_challenge        (LJRequest *request,
                                                 LJChallenge challenge);

request : |
challenge : |

### struct LJResult

    struct LJResult;

### lj_result_new_from_response ()

    LJResult*   lj_result_new_from_response     (const char *res);

res : |
Returns : |

### lj_result_free ()

    void        lj_result_free                  (LJResult *result);

result : |

### lj_result_succeeded ()

    gboolean    lj_result_succeeded             (LJResult *result);

result : |
Returns : |

### lj_result_get ()

    char*       lj_result_get                   (LJResult *result,
                                                 const char *key);

result : |
key : |
Returns : |

### lj_result_get_int ()

    int         lj_result_get_int               (LJResult *result,
                                                 const char *key);

result : |
key : |
Returns : |

### lj_result_getf ()

    char*       lj_result_getf                  (LJResult *result,
                                                 const char *key,
                                                 ...);

result : |
key : |
... : |
Returns : |

### lj_result_getf_int ()

    int         lj_result_getf_int              (LJResult *result,
                                                 const char *key,
                                                 ...);

result : |
key : |
... : |
Returns : |

### lj_urlencode ()

    char*       lj_urlencode                    (unsigned char *string);

string : |
Returns : |

### lj_urldecode ()

    unsigned char* lj_urldecode                 (char *string);

string : |
Returns : |