Re: [anjuta-devel] Port to Windows



Hi Arnel,


Le 11/04/2013 08:31, Arnel A. Borja a écrit :
1. Getting the paths in Windows. Programs in Windows needs to be
relocatable, so paths should be calculated at runtime. This could be
fixed this way:

- Provide some functions that create the paths at runtime. This is what
GTK+ uses, though the functions are private since it's used only inside
the GTK+ libraries. They are in gtk/gtkwin32.c in the sources. These
functions create the paths then store them into static variables so that
they could return "const gchar *". Seems like those paths are not freed
at all. Glade also do something like this in gladeui/glade-app.c, though
GladeApp is a singleton and free the variable when it is freed.

We already have some function in libanjuta to do something similar. The difference is that the return value is a gchar * and should be free by the caller.

GFile* anjuta_util_get_user_data_file (const gchar* path, ...);
GFile* anjuta_util_get_user_cache_file (const gchar* path, ...);
GFile* anjuta_util_get_user_config_file (const gchar* path, ...);
gchar* anjuta_util_get_user_data_file_path (const gchar* path, ...);
gchar* anjuta_util_get_user_cache_file_path (const gchar* path, ...);
gchar* anjuta_util_get_user_config_file_path (const gchar* path, ...);


Moreover by using different profiles for Anjuta, I will end with a quite different applications which shouldn't share session directories by example. The profile is set on the command line, at run time, so such directories are known at run time only.

2. forkpty and AnjutaLauncher. I tried porting them to Windows to use
g_spawn_async_with_pipes but the following problems arose:

I think that if we use g_spawn_async_with_pipes we don't need forkpty and fcntl, no?


- Signals are not available in Windows. We could emulate SIGKILL and
SIGTERM by forcibly killing a process using TerminateProcess, which will
not kill it's child processes. Is this the expected result?

I don't know how it's handle with other programs, is it possible to enumerate all child process. Anyway, I don't think it's too important.


Are there any differences between SIGKILL and SIGTERM, anyway?

Yes, SIGTERM ask the process to stop and the process will stop as soon as possible, while SIGKILL destroy the process potentially keeping some files half written.


Regards,

Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]