SDL Library

Dependents:   H261_decoder

Committer:
miruga27
Date:
Thu Sep 22 00:03:09 2016 +0000
Revision:
0:7fb6877b5d7c
SDL

Who changed what in which revision?

UserRevisionLine numberNew contents of line
miruga27 0:7fb6877b5d7c 1 /*
miruga27 0:7fb6877b5d7c 2 Simple DirectMedia Layer
miruga27 0:7fb6877b5d7c 3 Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
miruga27 0:7fb6877b5d7c 4
miruga27 0:7fb6877b5d7c 5 This software is provided 'as-is', without any express or implied
miruga27 0:7fb6877b5d7c 6 warranty. In no event will the authors be held liable for any damages
miruga27 0:7fb6877b5d7c 7 arising from the use of this software.
miruga27 0:7fb6877b5d7c 8
miruga27 0:7fb6877b5d7c 9 Permission is granted to anyone to use this software for any purpose,
miruga27 0:7fb6877b5d7c 10 including commercial applications, and to alter it and redistribute it
miruga27 0:7fb6877b5d7c 11 freely, subject to the following restrictions:
miruga27 0:7fb6877b5d7c 12
miruga27 0:7fb6877b5d7c 13 1. The origin of this software must not be misrepresented; you must not
miruga27 0:7fb6877b5d7c 14 claim that you wrote the original software. If you use this software
miruga27 0:7fb6877b5d7c 15 in a product, an acknowledgment in the product documentation would be
miruga27 0:7fb6877b5d7c 16 appreciated but is not required.
miruga27 0:7fb6877b5d7c 17 2. Altered source versions must be plainly marked as such, and must not be
miruga27 0:7fb6877b5d7c 18 misrepresented as being the original software.
miruga27 0:7fb6877b5d7c 19 3. This notice may not be removed or altered from any source distribution.
miruga27 0:7fb6877b5d7c 20 */
miruga27 0:7fb6877b5d7c 21
miruga27 0:7fb6877b5d7c 22 /**
miruga27 0:7fb6877b5d7c 23 * \file SDL_filesystem.h
miruga27 0:7fb6877b5d7c 24 *
miruga27 0:7fb6877b5d7c 25 * \brief Include file for filesystem SDL API functions
miruga27 0:7fb6877b5d7c 26 */
miruga27 0:7fb6877b5d7c 27
miruga27 0:7fb6877b5d7c 28 #ifndef _SDL_filesystem_h
miruga27 0:7fb6877b5d7c 29 #define _SDL_filesystem_h
miruga27 0:7fb6877b5d7c 30
miruga27 0:7fb6877b5d7c 31 #include "SDL_stdinc.h"
miruga27 0:7fb6877b5d7c 32
miruga27 0:7fb6877b5d7c 33 #include "begin_code.h"
miruga27 0:7fb6877b5d7c 34
miruga27 0:7fb6877b5d7c 35 /* Set up for C function definitions, even when using C++ */
miruga27 0:7fb6877b5d7c 36 #ifdef __cplusplus
miruga27 0:7fb6877b5d7c 37 extern "C" {
miruga27 0:7fb6877b5d7c 38 #endif
miruga27 0:7fb6877b5d7c 39
miruga27 0:7fb6877b5d7c 40 /**
miruga27 0:7fb6877b5d7c 41 * \brief Get the path where the application resides.
miruga27 0:7fb6877b5d7c 42 *
miruga27 0:7fb6877b5d7c 43 * Get the "base path". This is the directory where the application was run
miruga27 0:7fb6877b5d7c 44 * from, which is probably the installation directory, and may or may not
miruga27 0:7fb6877b5d7c 45 * be the process's current working directory.
miruga27 0:7fb6877b5d7c 46 *
miruga27 0:7fb6877b5d7c 47 * This returns an absolute path in UTF-8 encoding, and is guaranteed to
miruga27 0:7fb6877b5d7c 48 * end with a path separator ('\\' on Windows, '/' most other places).
miruga27 0:7fb6877b5d7c 49 *
miruga27 0:7fb6877b5d7c 50 * The pointer returned by this function is owned by you. Please call
miruga27 0:7fb6877b5d7c 51 * SDL_free() on the pointer when you are done with it, or it will be a
miruga27 0:7fb6877b5d7c 52 * memory leak. This is not necessarily a fast call, though, so you should
miruga27 0:7fb6877b5d7c 53 * call this once near startup and save the string if you need it.
miruga27 0:7fb6877b5d7c 54 *
miruga27 0:7fb6877b5d7c 55 * Some platforms can't determine the application's path, and on other
miruga27 0:7fb6877b5d7c 56 * platforms, this might be meaningless. In such cases, this function will
miruga27 0:7fb6877b5d7c 57 * return NULL.
miruga27 0:7fb6877b5d7c 58 *
miruga27 0:7fb6877b5d7c 59 * \return String of base dir in UTF-8 encoding, or NULL on error.
miruga27 0:7fb6877b5d7c 60 *
miruga27 0:7fb6877b5d7c 61 * \sa SDL_GetPrefPath
miruga27 0:7fb6877b5d7c 62 */
miruga27 0:7fb6877b5d7c 63 extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
miruga27 0:7fb6877b5d7c 64
miruga27 0:7fb6877b5d7c 65 /**
miruga27 0:7fb6877b5d7c 66 * \brief Get the user-and-app-specific path where files can be written.
miruga27 0:7fb6877b5d7c 67 *
miruga27 0:7fb6877b5d7c 68 * Get the "pref dir". This is meant to be where users can write personal
miruga27 0:7fb6877b5d7c 69 * files (preferences and save games, etc) that are specific to your
miruga27 0:7fb6877b5d7c 70 * application. This directory is unique per user, per application.
miruga27 0:7fb6877b5d7c 71 *
miruga27 0:7fb6877b5d7c 72 * This function will decide the appropriate location in the native filesystem,
miruga27 0:7fb6877b5d7c 73 * create the directory if necessary, and return a string of the absolute
miruga27 0:7fb6877b5d7c 74 * path to the directory in UTF-8 encoding.
miruga27 0:7fb6877b5d7c 75 *
miruga27 0:7fb6877b5d7c 76 * On Windows, the string might look like:
miruga27 0:7fb6877b5d7c 77 * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
miruga27 0:7fb6877b5d7c 78 *
miruga27 0:7fb6877b5d7c 79 * On Linux, the string might look like:
miruga27 0:7fb6877b5d7c 80 * "/home/bob/.local/share/My Program Name/"
miruga27 0:7fb6877b5d7c 81 *
miruga27 0:7fb6877b5d7c 82 * On Mac OS X, the string might look like:
miruga27 0:7fb6877b5d7c 83 * "/Users/bob/Library/Application Support/My Program Name/"
miruga27 0:7fb6877b5d7c 84 *
miruga27 0:7fb6877b5d7c 85 * (etc.)
miruga27 0:7fb6877b5d7c 86 *
miruga27 0:7fb6877b5d7c 87 * You specify the name of your organization (if it's not a real organization,
miruga27 0:7fb6877b5d7c 88 * your name or an Internet domain you own might do) and the name of your
miruga27 0:7fb6877b5d7c 89 * application. These should be untranslated proper names.
miruga27 0:7fb6877b5d7c 90 *
miruga27 0:7fb6877b5d7c 91 * Both the org and app strings may become part of a directory name, so
miruga27 0:7fb6877b5d7c 92 * please follow these rules:
miruga27 0:7fb6877b5d7c 93 *
miruga27 0:7fb6877b5d7c 94 * - Try to use the same org string (including case-sensitivity) for
miruga27 0:7fb6877b5d7c 95 * all your applications that use this function.
miruga27 0:7fb6877b5d7c 96 * - Always use a unique app string for each one, and make sure it never
miruga27 0:7fb6877b5d7c 97 * changes for an app once you've decided on it.
miruga27 0:7fb6877b5d7c 98 * - Unicode characters are legal, as long as it's UTF-8 encoded, but...
miruga27 0:7fb6877b5d7c 99 * - ...only use letters, numbers, and spaces. Avoid punctuation like
miruga27 0:7fb6877b5d7c 100 * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
miruga27 0:7fb6877b5d7c 101 *
miruga27 0:7fb6877b5d7c 102 * This returns an absolute path in UTF-8 encoding, and is guaranteed to
miruga27 0:7fb6877b5d7c 103 * end with a path separator ('\\' on Windows, '/' most other places).
miruga27 0:7fb6877b5d7c 104 *
miruga27 0:7fb6877b5d7c 105 * The pointer returned by this function is owned by you. Please call
miruga27 0:7fb6877b5d7c 106 * SDL_free() on the pointer when you are done with it, or it will be a
miruga27 0:7fb6877b5d7c 107 * memory leak. This is not necessarily a fast call, though, so you should
miruga27 0:7fb6877b5d7c 108 * call this once near startup and save the string if you need it.
miruga27 0:7fb6877b5d7c 109 *
miruga27 0:7fb6877b5d7c 110 * You should assume the path returned by this function is the only safe
miruga27 0:7fb6877b5d7c 111 * place to write files (and that SDL_GetBasePath(), while it might be
miruga27 0:7fb6877b5d7c 112 * writable, or even the parent of the returned path, aren't where you
miruga27 0:7fb6877b5d7c 113 * should be writing things).
miruga27 0:7fb6877b5d7c 114 *
miruga27 0:7fb6877b5d7c 115 * Some platforms can't determine the pref path, and on other
miruga27 0:7fb6877b5d7c 116 * platforms, this might be meaningless. In such cases, this function will
miruga27 0:7fb6877b5d7c 117 * return NULL.
miruga27 0:7fb6877b5d7c 118 *
miruga27 0:7fb6877b5d7c 119 * \param org The name of your organization.
miruga27 0:7fb6877b5d7c 120 * \param app The name of your application.
miruga27 0:7fb6877b5d7c 121 * \return UTF-8 string of user dir in platform-dependent notation. NULL
miruga27 0:7fb6877b5d7c 122 * if there's a problem (creating directory failed, etc).
miruga27 0:7fb6877b5d7c 123 *
miruga27 0:7fb6877b5d7c 124 * \sa SDL_GetBasePath
miruga27 0:7fb6877b5d7c 125 */
miruga27 0:7fb6877b5d7c 126 extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
miruga27 0:7fb6877b5d7c 127
miruga27 0:7fb6877b5d7c 128 /* Ends C function definitions when using C++ */
miruga27 0:7fb6877b5d7c 129 #ifdef __cplusplus
miruga27 0:7fb6877b5d7c 130 }
miruga27 0:7fb6877b5d7c 131 #endif
miruga27 0:7fb6877b5d7c 132 #include "close_code.h"
miruga27 0:7fb6877b5d7c 133
miruga27 0:7fb6877b5d7c 134 #endif /* _SDL_system_h */
miruga27 0:7fb6877b5d7c 135
miruga27 0:7fb6877b5d7c 136 /* vi: set ts=4 sw=4 expandtab: */