summaryrefslogtreecommitdiffstats
path: root/core/picture.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-10 09:42:14 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-10 10:53:03 -0700
commit3f3869ff650229e99262ee07b14e1d14ca973d10 (patch)
tree7508ff4e13d831855551d6737d0373e67e126470 /core/picture.c
parent34657f62ae5209b2f1c44efde053aba43e783e5e (diff)
downloadsubsurface-3f3869ff650229e99262ee07b14e1d14ca973d10.tar.gz
media: move picture function from dive.c to picture.c
Currently, move only those functions that do not access dive structures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/picture.c')
-rw-r--r--core/picture.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/picture.c b/core/picture.c
new file mode 100644
index 000000000..3f887efe8
--- /dev/null
+++ b/core/picture.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "picture.h"
+#include <stdlib.h>
+#include <string.h>
+
+struct picture *alloc_picture()
+{
+ struct picture *pic = malloc(sizeof(struct picture));
+ if (!pic)
+ exit(1);
+ memset(pic, 0, sizeof(struct picture));
+ return pic;
+}
+
+void free_picture(struct picture *picture)
+{
+ if (picture) {
+ free(picture->filename);
+ free(picture);
+ }
+}