/usr/include/spctag.h is in libspctag-dev 0.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | /*
spctag.h : interface of the spctag library
v0.2 - 2011-09-18
Copyright (C) 2011 Jérôme SONRIER <jsid@emor3j.fr.eu.org>
This file is part of libspctag.
libspctag is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
libspctag is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with libspctag. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SPCTAG_H
#define SPCTAG_H 1
/* Library version */
#define LIBSPCTAG_MAJOR 0 /* Major number of library version */
#define LIBSPCTAG_MINOR 2 /* Minor number of library version */
/* Library version (string) */
#define LIBSPCTAG_VERSION_STR "0.2"
// Field length
#define SPCTAG_SONGTITLE_LENGTH 32
#define SPCTAG_GAMETITLE_LENGTH 32
#define SPCTAG_DUMPERNAME_LENGTH 16
#define SPCTAG_COMMENTS_LENGTH 32
#define SPCTAG_DUMPDATE_TXT_LENGTH 11
#define SPCTAG_DUMPYEAR_BIN_LENGTH 2
#define SPCTAG_LENGTH_LENGTH 3
#define SPCTAG_FADELENGTH_TXT_LENGTH 5
#define SPCTAG_FADELENGTH_BIN_LENGTH 4
#define SPCTAG_ARTIST_LENGTH 32
// Return codes
#define SPCTAG_SUCCESS 0
#define SPCTAG_E_NOT_SPC -1
#define SPCTAG_E_NO_TAGS -2
#define SPCTAG_EXPORT __attribute__ ((visibility ("default")))
/* Represents ASCII tags */
struct TAGS_TXT {
char song_title[SPCTAG_SONGTITLE_LENGTH]; // Song title
char game_title[SPCTAG_GAMETITLE_LENGTH]; // Game title
char dumper_name[SPCTAG_DUMPERNAME_LENGTH]; // Name of dumper
char comments[SPCTAG_COMMENTS_LENGTH]; // Comments
char dump_date[SPCTAG_DUMPDATE_TXT_LENGTH]; // Date SPC was dumped (MM/DD/YYYY)
char length[SPCTAG_LENGTH_LENGTH]; // Number of seconds to play song before fading out
char fade_length[SPCTAG_FADELENGTH_TXT_LENGTH]; // Length of fade in milliseconds
char artist[SPCTAG_ARTIST_LENGTH]; // Artist of song
char default_channels; // Default channel disables (0 = enable, 1 = disable)
char emulator; // Emulator used to dump SPC
char reserved[45];
} __attribute__((packed)) *spctag_tags_txt;
/* Represents binary tags */
struct TAGS_BIN {
char song_title[SPCTAG_SONGTITLE_LENGTH]; // Song title
char game_title[SPCTAG_GAMETITLE_LENGTH]; // Game title
char dumper_name[SPCTAG_DUMPERNAME_LENGTH]; // Name of dumper
char comments[SPCTAG_COMMENTS_LENGTH]; // Comments
char dump_day; // Day SPC was dumped
char dump_month; // Month SPC was dumped
char dump_year[SPCTAG_DUMPYEAR_BIN_LENGTH]; // Year SPC was dumped
char unused[7];
char length[SPCTAG_LENGTH_LENGTH]; // Number of seconds to play song before fading out
char fade_length[SPCTAG_FADELENGTH_BIN_LENGTH]; // Length of fade in milliseconds
char artist[SPCTAG_ARTIST_LENGTH]; // Artist of song
char default_channels; // Default channel disables (0 = enable, 1 = disable)
char emulator; // Emulator used to dump SPC
char reserved[46];
} __attribute__((packed)) *spctag_tags_bin;
// Globale variables
SPCTAG_EXPORT int spctag_is_init = 0; // 1 when spctag is initialized and can be used
SPCTAG_EXPORT int spctag_txt_tag = 0; // 1 if tags are in ASCII format, 0 if tags are in binary format
/*
* spctag_init
* Read tags from file.
* param:
* file: SPC file descriptor
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_init( FILE *file );
/*
* spctag_get_songtitle
* Return the song title.
* return:
* song title
*/
SPCTAG_EXPORT char* spctag_get_songtitle();
/*
* spctag_get_gametitle
* Return the game title.
* return:
* game title
*/
SPCTAG_EXPORT char* spctag_get_gametitle();
/*
* spctag_get_dumpername
* Return the dumper name.
* return:
* dumper name
*/
SPCTAG_EXPORT char* spctag_get_dumpername();
/*
* spctag_get_comments
* Return comments.
* return:
* comments
*/
SPCTAG_EXPORT char* spctag_get_comments();
/*
* spctag_get_dumpdate
* Return the dump date.
* return:
* dump date
*/
SPCTAG_EXPORT char* spctag_get_dumpdate();
/*
* spctag_get_length
* Return the number of seconds to play song before fading out.
* return:
* song length
*/
SPCTAG_EXPORT char* spctag_get_length();
/*
* spctag_get_fadelength
* Return the length of fade in milliseconds.
* return:
* fade length
*/
SPCTAG_EXPORT char* spctag_get_fadelength();
/*
* spctag_get_artist
* Return the artist name.
* return:
* artist name
*/
SPCTAG_EXPORT char* spctag_get_artist();
/*
* spctag_get_defaultchannels
* Return channel states.
* return:
* channel states
*/
SPCTAG_EXPORT char* spctag_get_defaultchannels();
/*
* spctag_get_emulator
* Return the name of the emulator used to dump.
* return:
* emulator
*/
SPCTAG_EXPORT char* spctag_get_emulator();
/*
* spctag_set_songtitle
* Set the song title into tags structure.
* param:
* new_songtitle: new song title
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_songtitle( char* new_songtitle );
/*
* spctag_set_gametitle
* Set the game title.
* param:
* new_gametitle: new game title
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_gametitle( char* new_gametitle );
/*
* spctag_set_dumpername
* Set the dumper name.
* param:
* new_dumpername: new dumper name
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_dumpername( char* new_dumpername );
/*
* spctag_set_comments
* Set comments.
* param:
* new_comments: new comments
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_comments( char* new_comments );
/*
* spctag_set_dumpdate
* Set the dump date.
* param:
* new_comments: new comments
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_dumpdate( char* new_dumdate );
/*
* spctag_set_length
* Set the number of seconds to play song before fading out.
* param:
* new_length: new song length
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_length( char* new_length );
/*
* spctag_set_fadelength
* Set the length of fade in milliseconds.
* param:
* new_fadelength: new fade length
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_fadelength( char* new_fadelength );
/*
* spctag_set_artist
* Set the artist name.
* param:
* new_artist: new artist name
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_artist( char* new_artist );
/*
* spctag_set_defaultchannels
* Set channels states.
* param:
* new_defaultchannels: new default channel states
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_defaultchannels( char* new_defaultchannels );
/*
* spctag_set_emulator
* Set the name of the emulator used to dump.
* param:
* new_emulator: new emulator
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_set_emulator( char* new_emulator );
/*
* spctag_save
* Write structures into file.
* return:
* 0: succes
* <0: error
*/
SPCTAG_EXPORT int spctag_save( FILE* file );
/*
* spctag_free
* Free memory used by libspctag.
*/
SPCTAG_EXPORT void spctag_free();
#endif
|