summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/content.c14
-rw-r--r--content/content_protected.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c
index 548e08418..782e1a370 100644
--- a/content/content.c
+++ b/content/content.c
@@ -1038,6 +1038,20 @@ void content_add_error(struct content *c, const char *token,
{
}
+bool content__set_title(struct content *c, const char *title)
+{
+ char *new_title = talloc_strdup(c, title);
+ if (new_title == NULL)
+ return false;
+
+ if (c->title != NULL)
+ talloc_free(c->title);
+
+ c->title = new_title;
+
+ return true;
+}
+
/**
* Retrieve type of content
*
diff --git a/content/content_protected.h b/content/content_protected.h
index 261ee7bcb..013a9645f 100644
--- a/content/content_protected.h
+++ b/content/content_protected.h
@@ -204,6 +204,7 @@ void content_add_error(struct content *c, const char *token,
void content__reformat(struct content *c, int width, int height);
+bool content__set_title(struct content *c, const char *title);
content_type content__get_type(struct content *c);
const char *content__get_url(struct content *c);