mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
34657f62ae
commit
3f3869ff65
19 changed files with 58 additions and 29 deletions
21
core/picture.c
Normal file
21
core/picture.c
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue