Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
blog:x68_launcher_2 [2020/08/23 17:21] – [data.c / data.h] johnblog:x68_launcher_2 [2020/08/23 19:20] (current) – [Control Flow (a simple main.c)] john
Line 347: Line 347:
 **Output** **Output**
  
-   * gamedata_t * +   * gamedata_t *gamedata
  
 **Description** **Description**
Line 419: Line 419:
  
 **Description** **Description**
 +
 +Works much the same as the getLastGamedata() function in that it traverses the image list from the current position until it finds the end (determined by the //next// value being NULL).
  
 **Example** **Example**
 +
 +This function is only called within getImageList() within data.c, and is used to build the list of image/artwork/screenshot files as set within a metadata file:
 +
 +<code "C">
 +imagefile = getLastImage(imagefile);
 +imagefile->next = (imagefile_t *) malloc(sizeof(imagefile_t));
 +strcpy(imagefile->next->filename, p);
 +imagefile->next->next = NULL;
 +</code>
  
 ---- ----
Line 435: Line 446:
  
 **Description** **Description**
 +
 +Behaves the same as //getLastGanedata()// and //getLastImage()// but for the game search directories as defined in the application config file. However, the list of game search directories is only parsed once, at startup, so this function remains unused.
  
 **Example** **Example**
 +
 +__Not currently used.__
  
 ---- ----
  
-=== int removeGamedata() ===+=== removeGamedata() ===
  
 **Input**  **Input** 
Line 674: Line 689:
 gamedata_t *gamedata_head = NULL;   // Constant pointer to the start of the gamedata list gamedata_t *gamedata_head = NULL;   // Constant pointer to the start of the gamedata list
  
-// Create a new empty gamedata entry+// Create a new empty gamedata entry which will hold all of 
 +// the games that we find
 gamedata = (gamedata_t *) malloc(sizeof(gamedata_t)); gamedata = (gamedata_t *) malloc(sizeof(gamedata_t));
 gamedata->next = NULL; gamedata->next = NULL;
   
-// Parse the gamedirs that are set+// Create a new gamedir list to hold the game search directories  
 +// which are extracted from the application config file
 gamedir = (gamedir_t *) malloc(sizeof(gamedir_t)); gamedir = (gamedir_t *) malloc(sizeof(gamedir_t));
 gamedir->next = NULL; gamedir->next = NULL;
  
-// Create an instance of a config data+// Create an instance of a config data, which will be filled 
 +// by parsing the application config ini file
 config = (config_t *) malloc(sizeof(config_t)); config = (config_t *) malloc(sizeof(config_t));
 config->dir = NULL; config->dir = NULL;
  • blog/x68_launcher_2.1598199678.txt.gz
  • Last modified: 2020/08/23 17:21
  • by john