struct json_object* pakfire_json_parse_from_file(struct pakfire_ctx* ctx, const char* path);
int pakfire_json_add_string(struct json_object* json, const char* name, const char* value);
int pakfire_json_add_integer(struct json_object* json, const char* name, int64_t value);
+int pakfire_json_add_double(struct json_object* json, const char* name, double value);
int pakfire_json_add_string_array(struct json_object* json, const char* name, char** array);
// Resource Limits
return json_object_object_add(json, name, object);
}
+int pakfire_json_add_double(struct json_object* json, const char* name, double value) {
+ struct json_object* object = NULL;
+
+ // Convert the value to JSON
+ object = json_object_new_double(value);
+ if (!object)
+ return -errno;
+
+ // Add the object
+ return json_object_object_add(json, name, object);
+}
+
// Resource Limits
int pakfire_rlimit_set(struct pakfire* pakfire, int limit) {