spiv: Add -h help option, yay!
[gfxprim.git] / include / loaders / GP_TmpFile.h
blobfe1f8d1d9e97df9f49b94d837cb056f849cc4038
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
20 * *
21 *****************************************************************************/
25 This is interface for saving GP_Context into non-portable uncompressed file,
26 which is usefull for caching GP_Context to disk.
30 #ifndef LOADERS_GP_TMP_FILE_H
31 #define LOADERS_GP_TMP_FILE_H
33 #include "core/GP_Context.h"
34 #include "core/GP_ProgressCallback.h"
37 * The possible errno values:
39 * - Anything FILE operation may return (fopen(), fclose(), fseek(), ...).
40 * - EIO for fread()/fwrite() failure
41 * - ENOMEM from malloc()
42 * - ECANCELED when call was aborted from callback
46 * Opens up and loads file.
48 * On failure NULL is returned and errno is set.
50 GP_Context *GP_LoadTmpFile(const char *src_path, GP_ProgressCallback *callback);
53 * Saves context into a file. On failure non-zero is returned and errno is set.
55 int GP_SaveTmpFile(const GP_Context *src, const char *dst_path,
56 GP_ProgressCallback *callback);
58 #endif /* LOADERS_GP_TMP_FILE_H */