ROX-CLib: basedir.h File Reference

- Main Page
- Data Structures
- Files
- Related Pages

- File List
- Globals

# basedir.h File Reference

XDG base directory functions for ROX-CLib. More...

## Functions
gchar * | rox_basedir_save_config_path (const char *resource, const char *leaf)
gchar * | rox_basedir_save_data_path (const char *resource, const char *leaf)
gchar * | rox_basedir_load_config_path (const char *resource, const char *leaf)
gchar * | rox_basedir_load_data_path (const char *resource, const char *leaf)
GList * | rox_basedir_load_config_paths (const char *resource, const char *leaf)
GList * | rox_basedir_load_data_paths (const char *resource, const char *leaf)
void | rox_basedir_free_paths (GList *paths)
const gchar * | rox_basedir_get_config_home (void)
GList * | rox_basedir_get_config_paths (void)
gchar * | basedir_save_config_path (const char *resource, const char *leaf)
gchar * | basedir_save_data_path (const char *resource, const char *leaf)
gchar * | basedir_load_config_path (const char *resource, const char *leaf)
gchar * | basedir_load_data_path (const char *resource, const char *leaf)
GList * | basedir_load_config_paths (const char *resource, const char *leaf)
GList * | basedir_load_data_paths (const char *resource, const char *leaf)
const gchar * | basedir_get_config_home (void)
GList * | basedir_get_config_paths (void)

## Detailed Description

XDG base directory functions for ROX-CLib.

Author:
  Stephen Watson

Version:
  Id
    basedir.h,v 1.6 2006/08/12 17:04:56 stephen Exp

## Function Documentation

const gchar* basedir_get_config_home | ( | void |  | ) |

Returns:
  The directory where the user may write configuration files.

Deprecated:
  use rox_basedir_get_config_home()

GList* basedir_get_config_paths | ( | void |  | ) |

Returns:
  A list of directories to be searched for configuration files. Free the list but not the directories.

Deprecated:
  use rox_basedir_get_config_home()

gchar* basedir_load_config_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file from which configuration may be loaded.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if no such file found.

Deprecated:
  use rox_basedir_load_config_path().

GList* basedir_load_config_paths | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return a list of full paths to a file from which configuration may be loaded in each diretory where it exists. Useful for merging the conents of multiple files..

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  List of full path to files, pass to rox_basedir_free_paths() when done, or `NULL` if no such file found.

Deprecated:
  use rox_basedir_load_config_paths().

gchar* basedir_load_data_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file from which data may be loaded.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if no such file found.

GList* basedir_load_data_paths | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return a list of full paths to a file from which data may be loaded in each diretory where it exists. Useful for merging the conents of multiple files..

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  List of full path to files, pass to rox_basedir_free_paths() when done, or `NULL` if no such file found.

Deprecated:
  use rox_basedir_load_data_paths().

gchar* basedir_save_config_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file where configuration may be saved.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if saving has been disabled.

Deprecated:
  use rox_basedir_save_config_path().

gchar* basedir_save_data_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file where data may be saved. Normally this is not required.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if saving has been disabled.

Deprecated:
  use rox_basedir_save_data_path().

void rox_basedir_free_paths | ( | GList * | paths | ) |

Free a list returned by basedir_load_config_paths() or basedir_load_data_paths().

Parameters:

  `[in,out]` | paths | list of paths.

const gchar* rox_basedir_get_config_home | ( | void |  | ) |

Returns:
  The directory where the user may write configuration files.

GList* rox_basedir_get_config_paths | ( | void |  | ) |

Returns:
  A list of directories to be searched for configuration files. Free the list but not the directories.

gchar* rox_basedir_load_config_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file from which configuration may be loaded.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if no such file found.

GList* rox_basedir_load_config_paths | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return a list of full paths to a file from which configuration may be loaded in each diretory where it exists. Useful for merging the conents of multiple files..

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  List of full path to files, pass to rox_basedir_free_paths() when done, or `NULL` if no such file found.

gchar* rox_basedir_load_data_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file from which data may be loaded.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if no such file found.

GList* rox_basedir_load_data_paths | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return a list of full paths to a file from which data may be loaded in each diretory where it exists. Useful for merging the conents of multiple files..

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  List of full path to files, pass to rox_basedir_free_paths() when done, or `NULL` if no such file found.

gchar* rox_basedir_save_config_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file where configuration may be saved.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if saving has been disabled

gchar* rox_basedir_save_data_path | ( | const char * | resource,
|  | const char * | leaf |
| ) |  |  |

Return the full path to a file where data may be saved. Normally this is not required.

Parameters:

  `[in]` | resource | Either the name of the program ("Clock") or the programmers domain and the name of the program as "kerofin.demon.co.uk/Clock"
  `[in]` | leaf | Last part of file name, such as "alarms.xml".

Returns:
  Full path to the file, pass to g_free() when done, or `NULL` if saving has been disabled