view src/dir.c @ 35:d9e7b35430de

Updated copyright lines
author jcid
date Mon, 05 Nov 2007 21:25:14 +0100
parents 6ee11bf9e3ea
children 5e0f4260c4f5
line wrap: on
line source
/*
 * File: dir.c
 *
 * Copyright 2006-2007 Jorge Arellano Cid <jcid@dillo.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 */

#include <unistd.h>

#include "../dlib/dlib.h"


/*
 * Local data
 */
/* Dillo works from an unmounted directory (/tmp). */
static char *OldWorkingDirectory = NULL;

/*
 * Change current working directory to "/tmp".
 */
void a_Dir_init(void)
{
   dFree(OldWorkingDirectory);
   OldWorkingDirectory = dGetcwd();
   chdir("/tmp");
}

/*
 * Return the initial current working directory in a string.
 */
char *a_Dir_get_owd(void)
{
   return OldWorkingDirectory;
}

/*
 * Free memory
 */
void a_Dir_free(void)
{
   dFree(OldWorkingDirectory);
}