summaryrefslogtreecommitdiff
path: root/util/cairo-script/cairo-script-objects.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cairo-script/cairo-script-objects.c')
-rw-r--r--util/cairo-script/cairo-script-objects.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/util/cairo-script/cairo-script-objects.c b/util/cairo-script/cairo-script-objects.c
index 784376b2..9cc59c90 100644
--- a/util/cairo-script/cairo-script-objects.c
+++ b/util/cairo-script/cairo-script-objects.c
@@ -507,6 +507,7 @@ csi_string_new (csi_t *ctx,
string->string[len] = '\0';
}
string->len = len;
+ string->deflate = 0;
string->base.type = CSI_OBJECT_TYPE_STRING;
string->base.ref = 1;
@@ -518,6 +519,26 @@ csi_string_new (csi_t *ctx,
}
csi_status_t
+csi_string_deflate_new (csi_t *ctx,
+ csi_object_t *obj,
+ void *bytes,
+ int in_len,
+ int out_len)
+{
+ csi_status_t status;
+ csi_string_t *string;
+
+ status = csi_string_new (ctx, obj, bytes, in_len);
+ if (_csi_unlikely (status))
+ return status;
+
+ string = obj->datum.string;
+ string->deflate = out_len;
+
+ return CSI_STATUS_SUCCESS;
+}
+
+csi_status_t
csi_string_new_from_bytes (csi_t *ctx,
csi_object_t *obj,
char *bytes,
@@ -534,6 +555,7 @@ csi_string_new_from_bytes (csi_t *ctx,
string->string = bytes;
string->len = len;
+ string->deflate = 0;
string->base.type = CSI_OBJECT_TYPE_STRING;
string->base.ref = 1;