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);