Changeset b363d83 for global.c


Ignore:
Timestamp:
Jul 8, 2007, 3:37:43 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
be98ba5
Parents:
93f65b6
Message:
Adding a -s switch to change the location of the config dir (~/.owl)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    rf1fc47f rb363d83  
    8686  g->homedir=owl_strdup(getenv("HOME"));
    8787
     88  g->confdir = NULL;
     89  g->startupfile = NULL;
     90  char * cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR);
     91  owl_global_set_confdir(g, cd);
     92  owl_free(cd);
     93
    8894  owl_messagelist_create(&(g->msglist));
    8995  owl_mainwin_init(&(g->mw));
     
    319325}
    320326
     327char *owl_global_get_confdir(owl_global *g) {
     328  if (g->confdir) return(g->confdir);
     329  return("/");
     330}
     331
     332/*
     333 * Setting this also sets startupfile to confdir/startup
     334 */
     335void owl_global_set_confdir(owl_global *g, char *cd) {
     336  free(g->confdir);
     337  g->confdir = owl_strdup(cd);
     338  free(g->startupfile);
     339  g->startupfile = owl_sprintf("%s/startup", cd);
     340}
     341
     342char *owl_global_get_startupfile(owl_global *g) {
     343  if(g->startupfile) return(g->startupfile);
     344  return("/");
     345}
     346
    321347int owl_global_get_direction(owl_global *g) {
    322348  return(g->direction);
Note: See TracChangeset for help on using the changeset viewer.