-
Notifications
You must be signed in to change notification settings - Fork 1
/
path.c
78 lines (64 loc) · 1.41 KB
/
path.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* Sarien - A Sierra AGI resource interpreter engine
* Copyright (C) 1999-2001 Stuart George and Claudio Matsuoka
*
* $Id: path.c,v 1.4 2001/11/29 07:21:41 cmatsuoka Exp $
*
* 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; see docs/COPYING for further details.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "sarien.h"
#include "agi.h"
int get_app_dir (char *app_dir, unsigned int size)
{
#if 0
char *x;
x = getenv (HOMEDIR);
_D ("HOMEDIR = %s", x);
if (x) {
strncpy (app_dir, x, size);
} else {
x = getenv ("SARIEN");
_D ("SARIEN = %s", x);
if (x)
strncpy (app_dir, x, size);
}
_D ("app_dir = %s", app_dir);
return x ? 0 : -1;
#else
return -1;
#endif
}
char* get_config_file(void)
{
static char ini_path[MAX_PATH];
#if 0
char *q;
if (getenv ("SARIEN") != NULL) {
sprintf(ini_path, "%s/%s", getenv("SARIEN"), "sarien.ini");
} else {
strcpy (ini_path, exec_name);
q = strchr(ini_path, 0x0);
q--;
while((*q!='\\' && *q!='/') && q>ini_path)
q--;
if(q!=ini_path)
*q=0x0;
strcat(ini_path, "/sarien.ini");
}
#else
strcat(ini_path,"sarien.ini");
#endif
return (char*)ini_path;
}
char *get_current_directory ()
{
#if 0
return ".";
#else
return "";
#endif
}