First steps towards removing glib dependencies

- remove the build flags and libraries from the Makefile / Configure.mk
- remove the glib types (gboolean, gchar, gint64, gint)
- comment out / hack around gettext
- replace the glib file helper functions
- replace g_ascii_strtod
- replace g_build_filename
- use environment variables instead of g_get_home_dir() & g_get_user_name()
- comment out GPS string parsing (uses glib utf8 macros)

This needs massive cleanup, but it's a snapshot of what I have right now, in
case people want to look at it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-10-05 00:29:09 -07:00
parent 3e0ecb5ff6
commit 4b12f28ca4
29 changed files with 382 additions and 159 deletions

12
macos.c
View file

@ -169,8 +169,8 @@ const char *system_default_filename(void)
char *buffer;
int len;
home = g_get_home_dir();
user = g_get_user_name();
home = getenv("HOME");
user = getenv("LOGNAME");
len = strlen(home) + strlen(user) + 45;
buffer = malloc(len);
snprintf(buffer, len, "%s/Library/Application Support/Subsurface/%s.xml", home, user);
@ -242,22 +242,22 @@ void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar,
}
#endif /* UES_GTK_UI */
void subsurface_command_line_init(gint *argc, gchar ***argv)
void subsurface_command_line_init(int *argc, char ***argv)
{
/* this is a no-op */
}
void subsurface_command_line_exit(gint *argc, gchar ***argv)
void subsurface_command_line_exit(int *argc, char ***argv)
{
/* this is a no-op */
}
gboolean subsurface_os_feature_available(os_feature_t f)
int subsurface_os_feature_available(os_feature_t f)
{
return TRUE;
}
gboolean subsurface_launch_for_uri(const char* uri)
int subsurface_launch_for_uri(const char* uri)
{
CFURLRef urlref = CFURLCreateWithBytes(NULL, uri, strlen(uri), kCFStringEncodingMacRoman, NULL);
OSStatus status = LSOpenCFURLRef(urlref, NULL);