BigEd / atalan

Automatically exported from code.google.com/p/atalan
MIT License
1 stars 0 forks source link

Implement UNIX version of GetApplicationDir #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It is new function in common.c returning path, where the atalan executable file 
is located.
Windows have special version, default is path taken from argv[0].

It this path is guaranteed to be absolute on unix, no other modifications 
should be necessary (maybe some testing).
On windows, the path is absolute only if some relative path was not specified.

Jakub, can you please, test and possibly implement this?
Thank You

Original issue reported on code.google.com by rudla.ku...@gmail.com on 1 Sep 2010 at 9:29

GoogleCodeExporter commented 9 years ago
Because I don'd know, what has to be achieved, I want to know more details.

The main question is: what is absolute path needed for on unices?

On unices things work in a way that there are some default locations defined in 
environment variables.

Things work either absolute or relative, it depends how you use them, but you 
are not obligued to choose one. It is transparent.

when I invoke atalan, no matter where the binary is (but it must be somewhere 
in path defined of ourse), it gives to the process current dir (as "."), so 
makefiles and compiles do work. And now atalan works all fine for me, except 
SYSTEM_DIR, which we have added.

It would be better to get the SYSTEM_DIR from environment variable rather than 
use absolute path, if user did not added it in command line.

Original comment by jakub.hu...@gmail.com on 3 Sep 2010 at 12:49

GoogleCodeExporter commented 9 years ago
I would like the default location of atalan system files be where the atalan 
binary is.
The structure of directories is now:

bin/
    atalan
processor/
    6502/
        6502.atl

platform/
    atari/
        atari.atl
module/

Of course, it is possible to use environment variable too.
But I would like to keep Atalan installation simple (just unzip archive).
Therefor I would like to use the location of Atalan binary (not the current 
dir, where typically source code of developed application will be).

User may still decide to organize the files in some other way (although I fail 
to see, why he would do that), then he may use command line switch you 
implemented or even system variable (ATALAN_SYSTEM_DIR ?)

Original comment by rudla.ku...@gmail.com on 3 Sep 2010 at 5:22