return NULL;
}
-GList *get_entries_from_file(gchar *file_name)
+static GList *get_entries_from_file(gchar *file_name)
{
gchar *text, *pat;
GMappedFile *mf;
if ((mf = g_mapped_file_new(file_name, FALSE, NULL)) == NULL) {
g_critical(_("couldn't map temp file"));
- exit(1);
}
len = g_mapped_file_get_length(mf);
text = g_mapped_file_get_contents(mf);
}
-gchar *download_url(gchar *uri)
+static gchar *download_url(gchar *uri)
{
FILE *tmp_file;
int tmp_fd;
if ((tmp_fd = g_file_open_tmp ("vikgsearch.XXXXXX", &tmpname, NULL)) == -1) {
g_critical(_("couldn't open temp file"));
- exit(1);
+ return NULL;
}
tmp_file = fdopen(tmp_fd, "r+");
- // TODO: curl may not be available
- if (curl_download_uri(uri, tmp_file, NULL, 0, NULL)) { // error
+ if (curl_download_uri(uri, tmp_file, NULL, 0, NULL)) {
+ // error
fclose(tmp_file);
tmp_file = NULL;
g_remove(tmpname);
if ((mf = g_mapped_file_new(file_name, FALSE, NULL)) == NULL) {
g_critical(_("couldn't map temp file"));
- exit(1);
+ return FALSE;
}
len = g_mapped_file_get_length(mf);
text = g_mapped_file_get_contents(mf);
g_hash_table_foreach ( vtl->waypoints, (GHFunc) waypoint_search_closest_tp, ¶ms);
if ( vtl->current_wp == params.closest_wp && vtl->current_wp != NULL )
{
- /* how do we get here? I'm putting in the abort until we can figure it out. -alex */
+ // how do we get here?
marker_begin_move(t, event->x, event->y);
g_critical("shouldn't be here");
- exit(1);
+ return FALSE;
}
else if ( params.closest_wp )
{
vt->n_tools = 0;
vt->active_tool = -1;
vt->vw = vw;
- if (!vw->viking_vvp) {
- g_critical("no viewport found.");
- exit(1);
- }
return vt;
}
if (tool == vt->n_tools) {
g_critical("trying to activate a non-existent tool...");
- exit(1);
+ return;
}
/* is the tool already active? */
if (vt->active_tool == tool) {