* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
-
+#define _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE
-#include <time.h>
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int architecture_specific;
const char *date_created;
struct bpph *bpph;
+ const char *status;
binary_package_name = json_object_get_string
(json_object_object_get(o, "binary_package_name"));
date_created = json_object_get_string
(json_object_object_get(o, "date_created"));
- if (date_created) {
- bpph->date_created.tm_isdst = -1;
+ if (date_created)
strptime(date_created, "%FT%T%z", &bpph->date_created);
- }
+
+ status = json_object_get_string(json_object_object_get(o, "status"));
+ if (status)
+ bpph->status = strdup(status);
return bpph;
}
"architecture_specific",
json_object_new_boolean(bpph->architecture_specific));
+ json_object_object_add
+ (json, "status", json_object_new_string(bpph->status));
+
date = malloc(strlen("YY-MM-DDThh:mm:ss+xxx") + 1);
strftime(date,
strlen("YY-MM-DDThh:mm:ss+xxx") + 1,
&bpph->date_created);
json_object_object_add
- (json,
- "date_created",
- json_object_new_string(date));
-
+ (json, "date_created", json_object_new_string(date));
free(date);
return json;
displayname = json_object_get_string
(json_object_object_get(o, "displayname"));
- title = json_object_get_string
- (json_object_object_get(o, "title"));
+ title = json_object_get_string(json_object_object_get(o, "title"));
- version = json_object_get_string
- (json_object_object_get(o, "version"));
+ version = json_object_get_string(json_object_object_get(o, "version"));
- name = json_object_get_string
- (json_object_object_get(o, "name"));
+ name = json_object_get_string(json_object_object_get(o, "name"));
return distro_series_new(name,
version,