|
Rockbox mail archiveSubject: Re:Dereferencing Coding HelpRe:Dereferencing Coding Help
From: Chris Muth <muthchris_at_muth.cc>
Date: Mon, 6 Jan 2003 19:10:18 -0600 Hey, What does mpeg_current_track(); return? Does it setup a storage location and then return a pointer to it? From the snippet I see, I don't see a storage location, just a pointer to a storage location. Also, the function must also populate the entire struct, or well, at least the id3->path field. Just some thoughts. Hope this helps. Take care, Chris Muth Original message from: Benjamin >Hi all, >I'm trying to implement a bookmark capability in RockBox, but I'm >running into a problem. Below is the code snippet. When I compile >with this, I recieve the error "dereferencing pointer to incomplete >type" at the write line. I'm not sure why. Any help is appreciated. > > >Thanks, >Ben > > >***Code*** > >void CreateBookmark(void) >{ > int f; > f = open ("/bookmark.txt", O_RDWR | O_CREAT | O_TRUNC); > if(f >= 0) > { > struct mp3entry *id3 = NULL; > id3 = mpeg_current_track(); > write (f, id3->path, MAX_PATH); // <--Error causing line > close (f); > } > else > { > bool done = false; > int key; > while(!done) > { > char buffer[40]; > snprintf(buffer, sizeof(buffer), " Failed: %2d", f); > int y=0; > lcd_clear_display(); > lcd_puts(0, y++, buffer); > lcd_update(); > > /* Wait for a key to be pushed */ > key = button_get_w_tmo(HZ*5); > switch(key) > { > case BUTTON_LEFT | BUTTON_REL: > case BUTTON_OFF | BUTTON_REL: > done = true; > break; > } > } > > } > >} > > > > > > > > Received on 2003-01-07 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |