- struct json_object *j;
-
- j = json_object_new_object();
- json_object_object_add(j, "op", json_object_new_string(op));
-
- if (session_id && strcmp(op, "login"))
- json_object_object_add(j,
- "sid",
- json_object_new_string(session_id));
-
- return j;
-}
-
-void ttrss_login(const char *url, const char *user, const char *password)
-{
- struct json_object *content, *rp, *error, *sid, *rq;
- char *tmp;
-
- if (session_url)
- free(session_url);
-
- tmp = url_normalize(url);
- session_url = malloc(strlen(tmp) + strlen("/api/") + 1);
- strcpy(session_url, tmp);
- strcat(session_url, "/api/");
- free(tmp);