Made mp3entry a struct, not a type

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1182 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-06-25 11:39:22 +00:00
parent f224f0b8e8
commit ef15d9983a
4 changed files with 9 additions and 11 deletions

View file

@ -42,7 +42,7 @@
void playtune(char *filename) void playtune(char *filename)
{ {
static char mfile[256]; static char mfile[256];
mp3entry mp3; struct mp3entry mp3;
bool good=1; bool good=1;
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
char buffer[256]; char buffer[256];

View file

@ -40,7 +40,7 @@
/* demonstrates showing different formats from playtune */ /* demonstrates showing different formats from playtune */
void wps_show_play(char* filename) void wps_show_play(char* filename)
{ {
mp3entry mp3; struct mp3entry mp3;
mp3info(&mp3,filename); mp3info(&mp3,filename);
switch ( global_settings.wps_display ) { switch ( global_settings.wps_display ) {

View file

@ -110,7 +110,7 @@ stripspaces(char *buffer)
* Returns: true if a title was found and created, else false * Returns: true if a title was found and created, else false
*/ */
static bool static bool
setid3v1title(int fd, mp3entry *entry) setid3v1title(int fd, struct mp3entry *entry)
{ {
char buffer[31]; char buffer[31];
int offsets[3] = {-95,-65,-125}; int offsets[3] = {-95,-65,-125};
@ -155,7 +155,7 @@ setid3v1title(int fd, mp3entry *entry)
* Returns: true if a title was found and created, else false * Returns: true if a title was found and created, else false
*/ */
static void static void
setid3v2title(int fd, mp3entry *entry) setid3v2title(int fd, struct mp3entry *entry)
{ {
unsigned int minframesize; unsigned int minframesize;
int size; int size;
@ -345,7 +345,7 @@ getid3v1len(int fd)
* -1 means that it couldn't be calculated * -1 means that it couldn't be calculated
*/ */
static int static int
getsonglength(int fd, mp3entry *entry) getsonglength(int fd, struct mp3entry *entry)
{ {
unsigned long header=0; unsigned long header=0;
unsigned char tmp; unsigned char tmp;
@ -480,14 +480,14 @@ getsonglength(int fd, mp3entry *entry)
* Returns: void * Returns: void
*/ */
bool bool
mp3info(mp3entry *entry, char *filename) mp3info(struct mp3entry *entry, char *filename)
{ {
int fd; int fd;
fd = open(filename, O_RDONLY); fd = open(filename, O_RDONLY);
if(-1 == fd) if(-1 == fd)
return true; return true;
memset(entry, 0, sizeof(mp3entry)); memset(entry, 0, sizeof(struct mp3entry));
entry->path = filename; entry->path = filename;
@ -524,7 +524,7 @@ int main(int argc, char **argv)
{ {
int i; int i;
for(i=1; i<argc; i++) { for(i=1; i<argc; i++) {
mp3entry mp3; struct mp3entry mp3;
if(mp3info(&mp3, argv[i])) { if(mp3info(&mp3, argv[i])) {
printf("Failed to get %s\n", argv[i]); printf("Failed to get %s\n", argv[i]);
return 0; return 0;

View file

@ -38,8 +38,6 @@ struct mp3entry {
char id3v1buf[3][32]; char id3v1buf[3][32];
}; };
typedef struct mp3entry mp3entry; bool mp3info(struct mp3entry *entry, char *filename);
bool mp3info(mp3entry *entry, char *filename);
#endif #endif