src/mess/osdmess.h
| r6069 | r6070 | |
| 1 | | /********************************************************************* |
| 2 | | |
| 3 | | osdmess.h |
| 4 | | |
| 5 | | OS dependent calls for MESS |
| 6 | | |
| 7 | | *********************************************************************/ |
| 8 | | |
| 9 | | #ifndef __OSDMESS_H__ |
| 10 | | #define __OSDMESS_H__ |
| 11 | | |
| 12 | | #include "osdcore.h" |
| 13 | | #include "mamecore.h" |
| 14 | | #include "options.h" |
| 15 | | #include "devintrf.h" |
| 16 | | |
| 17 | | struct _mame_file; |
| 18 | | |
| 19 | | |
| 20 | | |
| 21 | | /*************************************************************************** |
| 22 | | FILE I/O INTERFACES |
| 23 | | ***************************************************************************/ |
| 24 | | |
| 25 | | /*----------------------------------------------------------------------------- |
| 26 | | osd_copyfile: copies a file |
| 27 | | |
| 28 | | Parameters: |
| 29 | | |
| 30 | | destfile - path to destination |
| 31 | | |
| 32 | | srcfile - path to source file |
| 33 | | |
| 34 | | Return value: |
| 35 | | |
| 36 | | a file_error describing any error that occurred while copying |
| 37 | | the file, or FILERR_NONE if no error occurred |
| 38 | | -----------------------------------------------------------------------------*/ |
| 39 | | file_error osd_copyfile(const char *destfile, const char *srcfile); |
| 40 | | |
| 41 | | |
| 42 | | /*----------------------------------------------------------------------------- |
| 43 | | osd_get_temp_filename: given a filename, return a full path with that |
| 44 | | filename but in a temporary directory |
| 45 | | |
| 46 | | Parameters: |
| 47 | | |
| 48 | | buffer - pointer to buffer |
| 49 | | |
| 50 | | buffer_len - length of buffer |
| 51 | | |
| 52 | | basename - basename of file to create |
| 53 | | |
| 54 | | Return value: |
| 55 | | |
| 56 | | a file_error describing any error that occurred while copying |
| 57 | | the file, or FILERR_NONE if no error occurred |
| 58 | | -----------------------------------------------------------------------------*/ |
| 59 | | file_error osd_get_temp_filename(char *buffer, size_t buffer_len, const char *basename); |
| 60 | | |
| 61 | | |
| 62 | | /*************************************************************************** |
| 63 | | DIRECTORY INTERFACES |
| 64 | | ***************************************************************************/ |
| 65 | | |
| 66 | | /*----------------------------------------------------------------------------- |
| 67 | | osd_stat: return a directory entry for a path |
| 68 | | |
| 69 | | Parameters: |
| 70 | | |
| 71 | | path - path in question |
| 72 | | |
| 73 | | Return value: |
| 74 | | |
| 75 | | an allocated pointer to an osd_directory_entry representing |
| 76 | | info on the path; even if the file does not exist |
| 77 | | |
| 78 | | -----------------------------------------------------------------------------*/ |
| 79 | | osd_directory_entry *osd_stat(const char *path); |
| 80 | | |
| 81 | | |
| 82 | | /*----------------------------------------------------------------------------- |
| 83 | | osd_mkdir: creates a directory |
| 84 | | |
| 85 | | Parameters: |
| 86 | | |
| 87 | | dir - path to directory to create |
| 88 | | |
| 89 | | Return value: |
| 90 | | |
| 91 | | a file_error describing any error that occurred while creating |
| 92 | | the directory, or FILERR_NONE if no error occurred |
| 93 | | -----------------------------------------------------------------------------*/ |
| 94 | | file_error osd_mkdir(const char *dir); |
| 95 | | |
| 96 | | |
| 97 | | /*----------------------------------------------------------------------------- |
| 98 | | osd_rmdir: removes a directory |
| 99 | | |
| 100 | | Parameters: |
| 101 | | |
| 102 | | dir - path to directory to removes |
| 103 | | |
| 104 | | Return value: |
| 105 | | |
| 106 | | a file_error describing any error that occurred while deleting |
| 107 | | the directory, or FILERR_NONE if no error occurred |
| 108 | | -----------------------------------------------------------------------------*/ |
| 109 | | file_error osd_rmdir(const char *dir); |
| 110 | | |
| 111 | | |
| 112 | | /*----------------------------------------------------------------------------- |
| 113 | | osd_getcurdir: retrieves the current working directory |
| 114 | | |
| 115 | | Parameters: |
| 116 | | |
| 117 | | buffer - place to store current working directory |
| 118 | | |
| 119 | | buffer_len - length of buffer |
| 120 | | |
| 121 | | Return value: |
| 122 | | |
| 123 | | a file_error describing any error that occurred while deleting |
| 124 | | the directory, or FILERR_NONE if no error occurred |
| 125 | | -----------------------------------------------------------------------------*/ |
| 126 | | file_error osd_getcurdir(char *buffer, size_t buffer_len); |
| 127 | | |
| 128 | | |
| 129 | | /*----------------------------------------------------------------------------- |
| 130 | | osd_setcurdir: sets the current working directory |
| 131 | | |
| 132 | | Parameters: |
| 133 | | |
| 134 | | dir - path to directory to which to change |
| 135 | | |
| 136 | | Return value: |
| 137 | | |
| 138 | | a file_error describing any error that occurred while deleting |
| 139 | | the directory, or FILERR_NONE if no error occurred |
| 140 | | -----------------------------------------------------------------------------*/ |
| 141 | | file_error osd_setcurdir(const char *dir); |
| 142 | | |
| 143 | | |
| 144 | | /*************************************************************************** |
| 145 | | PATH INTERFACES |
| 146 | | ***************************************************************************/ |
| 147 | | |
| 148 | | /*----------------------------------------------------------------------------- |
| 149 | | osd_get_emulator_directory: returns the path containing the emulator |
| 150 | | |
| 151 | | Parameters: |
| 152 | | |
| 153 | | dir - space to output directory |
| 154 | | dir_size - size of path |
| 155 | | |
| 156 | | -----------------------------------------------------------------------------*/ |
| 157 | | |
| 158 | | void osd_get_emulator_directory(char *dir, size_t dir_size); |
| 159 | | |
| 160 | | /*----------------------------------------------------------------------------- |
| 161 | | osd_is_path_separator: returns whether a character is a path separator |
| 162 | | |
| 163 | | Parameters: |
| 164 | | |
| 165 | | c - the character in question |
| 166 | | |
| 167 | | Return value: |
| 168 | | |
| 169 | | non-zero if the character is a path separator, zero otherwise |
| 170 | | |
| 171 | | -----------------------------------------------------------------------------*/ |
| 172 | | int osd_is_path_separator(char c); |
| 173 | | |
| 174 | | |
| 175 | | /*----------------------------------------------------------------------------- |
| 176 | | osd_dirname: returns the base directory of a file path |
| 177 | | |
| 178 | | Parameters: |
| 179 | | |
| 180 | | filename - the path in question |
| 181 | | |
| 182 | | Return value: |
| 183 | | |
| 184 | | an allocated path to the directory containing this file |
| 185 | | |
| 186 | | -----------------------------------------------------------------------------*/ |
| 187 | | char *osd_dirname(const char *filename); |
| 188 | | |
| 189 | | |
| 190 | | /*----------------------------------------------------------------------------- |
| 191 | | osd_basename: returns the file or directory name from a full path |
| 192 | | |
| 193 | | Parameters: |
| 194 | | |
| 195 | | filename - the path in question |
| 196 | | |
| 197 | | Return value: |
| 198 | | |
| 199 | | a pointer to the base name of the file |
| 200 | | |
| 201 | | -----------------------------------------------------------------------------*/ |
| 202 | | char *osd_basename(char *filename); |
| 203 | | |
| 204 | | |
| 205 | | /*----------------------------------------------------------------------------- |
| 206 | | osd_get_full_path: retrieves the full path |
| 207 | | |
| 208 | | Parameters: |
| 209 | | |
| 210 | | path - the path in question |
| 211 | | dst - pointer to receive new path; the returned string needs to be free()-ed! |
| 212 | | |
| 213 | | Return value: |
| 214 | | |
| 215 | | file error |
| 216 | | |
| 217 | | -----------------------------------------------------------------------------*/ |
| 218 | | file_error osd_get_full_path(char **dst, const char *path); |
| 219 | | |
| 220 | | |
| 221 | | |
| 222 | | /*************************************************************************** |
| 223 | | UNCATEGORIZED INTERFACES |
| 224 | | ***************************************************************************/ |
| 225 | | |
| 226 | | |
| 227 | | /* reads text from the clipboard - the returned string needs to be free()-ed! */ |
| 228 | | char *osd_get_clipboard_text(void); |
| 229 | | |
| 230 | | |
| 231 | | |
| 232 | | /****************************************************************************** |
| 233 | | |
| 234 | | Device and file browsing |
| 235 | | |
| 236 | | ******************************************************************************/ |
| 237 | | |
| 238 | | int osd_num_devices(void); |
| 239 | | const char *osd_get_device_name(int idx); |
| 240 | | |
| 241 | | void osd_mess_options_init(core_options *opts); |
| 242 | | |
| 243 | | #endif /* __OSDMESS_H__ */ |
src/mess/osd/osdmess.h
| r0 | r6070 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | osdmess.h |
| 4 | |
| 5 | OS dependent calls for MESS |
| 6 | |
| 7 | *********************************************************************/ |
| 8 | |
| 9 | #ifndef __OSDMESS_H__ |
| 10 | #define __OSDMESS_H__ |
| 11 | |
| 12 | #include "osdcore.h" |
| 13 | #include "mamecore.h" |
| 14 | #include "options.h" |
| 15 | #include "devintrf.h" |
| 16 | |
| 17 | struct _mame_file; |
| 18 | |
| 19 | |
| 20 | |
| 21 | /*************************************************************************** |
| 22 | FILE I/O INTERFACES |
| 23 | ***************************************************************************/ |
| 24 | |
| 25 | /*----------------------------------------------------------------------------- |
| 26 | osd_copyfile: copies a file |
| 27 | |
| 28 | Parameters: |
| 29 | |
| 30 | destfile - path to destination |
| 31 | |
| 32 | srcfile - path to source file |
| 33 | |
| 34 | Return value: |
| 35 | |
| 36 | a file_error describing any error that occurred while copying |
| 37 | the file, or FILERR_NONE if no error occurred |
| 38 | -----------------------------------------------------------------------------*/ |
| 39 | file_error osd_copyfile(const char *destfile, const char *srcfile); |
| 40 | |
| 41 | |
| 42 | /*----------------------------------------------------------------------------- |
| 43 | osd_get_temp_filename: given a filename, return a full path with that |
| 44 | filename but in a temporary directory |
| 45 | |
| 46 | Parameters: |
| 47 | |
| 48 | buffer - pointer to buffer |
| 49 | |
| 50 | buffer_len - length of buffer |
| 51 | |
| 52 | basename - basename of file to create |
| 53 | |
| 54 | Return value: |
| 55 | |
| 56 | a file_error describing any error that occurred while copying |
| 57 | the file, or FILERR_NONE if no error occurred |
| 58 | -----------------------------------------------------------------------------*/ |
| 59 | file_error osd_get_temp_filename(char *buffer, size_t buffer_len, const char *basename); |
| 60 | |
| 61 | |
| 62 | /*************************************************************************** |
| 63 | DIRECTORY INTERFACES |
| 64 | ***************************************************************************/ |
| 65 | |
| 66 | /*----------------------------------------------------------------------------- |
| 67 | osd_stat: return a directory entry for a path |
| 68 | |
| 69 | Parameters: |
| 70 | |
| 71 | path - path in question |
| 72 | |
| 73 | Return value: |
| 74 | |
| 75 | an allocated pointer to an osd_directory_entry representing |
| 76 | info on the path; even if the file does not exist |
| 77 | |
| 78 | -----------------------------------------------------------------------------*/ |
| 79 | osd_directory_entry *osd_stat(const char *path); |
| 80 | |
| 81 | |
| 82 | /*----------------------------------------------------------------------------- |
| 83 | osd_mkdir: creates a directory |
| 84 | |
| 85 | Parameters: |
| 86 | |
| 87 | dir - path to directory to create |
| 88 | |
| 89 | Return value: |
| 90 | |
| 91 | a file_error describing any error that occurred while creating |
| 92 | the directory, or FILERR_NONE if no error occurred |
| 93 | -----------------------------------------------------------------------------*/ |
| 94 | file_error osd_mkdir(const char *dir); |
| 95 | |
| 96 | |
| 97 | /*----------------------------------------------------------------------------- |
| 98 | osd_rmdir: removes a directory |
| 99 | |
| 100 | Parameters: |
| 101 | |
| 102 | dir - path to directory to removes |
| 103 | |
| 104 | Return value: |
| 105 | |
| 106 | a file_error describing any error that occurred while deleting |
| 107 | the directory, or FILERR_NONE if no error occurred |
| 108 | -----------------------------------------------------------------------------*/ |
| 109 | file_error osd_rmdir(const char *dir); |
| 110 | |
| 111 | |
| 112 | /*----------------------------------------------------------------------------- |
| 113 | osd_getcurdir: retrieves the current working directory |
| 114 | |
| 115 | Parameters: |
| 116 | |
| 117 | buffer - place to store current working directory |
| 118 | |
| 119 | buffer_len - length of buffer |
| 120 | |
| 121 | Return value: |
| 122 | |
| 123 | a file_error describing any error that occurred while deleting |
| 124 | the directory, or FILERR_NONE if no error occurred |
| 125 | -----------------------------------------------------------------------------*/ |
| 126 | file_error osd_getcurdir(char *buffer, size_t buffer_len); |
| 127 | |
| 128 | |
| 129 | /*----------------------------------------------------------------------------- |
| 130 | osd_setcurdir: sets the current working directory |
| 131 | |
| 132 | Parameters: |
| 133 | |
| 134 | dir - path to directory to which to change |
| 135 | |
| 136 | Return value: |
| 137 | |
| 138 | a file_error describing any error that occurred while deleting |
| 139 | the directory, or FILERR_NONE if no error occurred |
| 140 | -----------------------------------------------------------------------------*/ |
| 141 | file_error osd_setcurdir(const char *dir); |
| 142 | |
| 143 | |
| 144 | /*************************************************************************** |
| 145 | PATH INTERFACES |
| 146 | ***************************************************************************/ |
| 147 | |
| 148 | /*----------------------------------------------------------------------------- |
| 149 | osd_get_emulator_directory: returns the path containing the emulator |
| 150 | |
| 151 | Parameters: |
| 152 | |
| 153 | dir - space to output directory |
| 154 | dir_size - size of path |
| 155 | |
| 156 | -----------------------------------------------------------------------------*/ |
| 157 | |
| 158 | void osd_get_emulator_directory(char *dir, size_t dir_size); |
| 159 | |
| 160 | /*----------------------------------------------------------------------------- |
| 161 | osd_is_path_separator: returns whether a character is a path separator |
| 162 | |
| 163 | Parameters: |
| 164 | |
| 165 | c - the character in question |
| 166 | |
| 167 | Return value: |
| 168 | |
| 169 | non-zero if the character is a path separator, zero otherwise |
| 170 | |
| 171 | -----------------------------------------------------------------------------*/ |
| 172 | int osd_is_path_separator(char c); |
| 173 | |
| 174 | |
| 175 | /*----------------------------------------------------------------------------- |
| 176 | osd_dirname: returns the base directory of a file path |
| 177 | |
| 178 | Parameters: |
| 179 | |
| 180 | filename - the path in question |
| 181 | |
| 182 | Return value: |
| 183 | |
| 184 | an allocated path to the directory containing this file |
| 185 | |
| 186 | -----------------------------------------------------------------------------*/ |
| 187 | char *osd_dirname(const char *filename); |
| 188 | |
| 189 | |
| 190 | /*----------------------------------------------------------------------------- |
| 191 | osd_basename: returns the file or directory name from a full path |
| 192 | |
| 193 | Parameters: |
| 194 | |
| 195 | filename - the path in question |
| 196 | |
| 197 | Return value: |
| 198 | |
| 199 | a pointer to the base name of the file |
| 200 | |
| 201 | -----------------------------------------------------------------------------*/ |
| 202 | char *osd_basename(char *filename); |
| 203 | |
| 204 | |
| 205 | /*----------------------------------------------------------------------------- |
| 206 | osd_get_full_path: retrieves the full path |
| 207 | |
| 208 | Parameters: |
| 209 | |
| 210 | path - the path in question |
| 211 | dst - pointer to receive new path; the returned string needs to be free()-ed! |
| 212 | |
| 213 | Return value: |
| 214 | |
| 215 | file error |
| 216 | |
| 217 | -----------------------------------------------------------------------------*/ |
| 218 | file_error osd_get_full_path(char **dst, const char *path); |
| 219 | |
| 220 | |
| 221 | |
| 222 | /*************************************************************************** |
| 223 | UNCATEGORIZED INTERFACES |
| 224 | ***************************************************************************/ |
| 225 | |
| 226 | |
| 227 | /* reads text from the clipboard - the returned string needs to be free()-ed! */ |
| 228 | char *osd_get_clipboard_text(void); |
| 229 | |
| 230 | |
| 231 | |
| 232 | /****************************************************************************** |
| 233 | |
| 234 | Device and file browsing |
| 235 | |
| 236 | ******************************************************************************/ |
| 237 | |
| 238 | int osd_num_devices(void); |
| 239 | const char *osd_get_device_name(int idx); |
| 240 | |
| 241 | void osd_mess_options_init(core_options *opts); |
| 242 | |
| 243 | #endif /* __OSDMESS_H__ */ |