+/* Adds a member named MEMBER_NAME whose contents is the null-terminated string
+ CONTENT. */
+void
+zip_writer_add_string (struct zip_writer *zw, const char *member_name,
+ const char *content)
+{
+ zip_writer_add_memory (zw, member_name, content, strlen (content));
+}
+
+/* Adds a member named MEMBER_NAME whose contents is the SIZE bytes of
+ CONTENT. */
+void
+zip_writer_add_memory (struct zip_writer *zw, const char *member_name,
+ const void *content, size_t size)
+{
+ FILE *fp = create_temp_file ();
+ if (fp == NULL)
+ {
+ msg_error (errno, _("error creating temporary file"));
+ zw->ok = false;
+ return;
+ }
+ fwrite (content, size, 1, fp);
+ zip_writer_add (zw, fp, member_name);
+ close_temp_file (fp);
+}
+