summaryrefslogtreecommitdiff
path: root/navit/bookmarks.c
diff options
context:
space:
mode:
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-02-15 15:29:07 +0000
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-02-15 15:29:07 +0000
commitbb6aa85be15aecf58f707282926e4beedda13829 (patch)
tree725a224ce488320b7ac4b675f73402022bf0b5c8 /navit/bookmarks.c
parentf92146b8336abfe2a5cb9347f73ab77d956caddd (diff)
downloadnavit-bb6aa85be15aecf58f707282926e4beedda13829.tar.gz
Fix:core:Revert rev 4169 (also: please fix proper) and fixed building with autotools
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4170 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/bookmarks.c')
-rw-r--r--navit/bookmarks.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index 90db0aaf1..96de4b816 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -395,8 +395,6 @@ bookmarks_get_center_file(gboolean create)
return g_strjoin(NULL, navit_get_user_data_directory(create), "/center.txt", NULL);
}
-
-
void
bookmarks_set_center_from_file(struct bookmarks *this_, char *file)
{
@@ -421,88 +419,6 @@ bookmarks_set_center_from_file(struct bookmarks *this_, char *file)
return;
}
-int
-getline (char **lineptr, size_t *n, FILE *stream)
-{
- return getdelim (lineptr, n, '\n', stream);
-}
-
-int
-getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
-{
- int result;
- size_t cur_len = 0;
-
- if (lineptr == NULL || n == NULL || fp == NULL)
- {
- return -1;
- }
-
- flockfile (fp);
-
- if (*lineptr == NULL || *n == 0)
- {
- *n = 120;
- *lineptr = (char *) realloc (*lineptr, *n);
- if (*lineptr == NULL)
- {
- result = -1;
- goto unlock_return;
- }
- }
-
- for (;;)
- {
- int i;
-
- i = getc (fp);
- if (i == EOF)
- {
- result = -1;
- break;
- }
-
- /* Make enough space for len+1 (for final NUL) bytes. */
- if (cur_len + 1 >= *n)
- {
- size_t needed_max=SIZE_MAX;
- size_t needed = 2 * *n + 1; /* Be generous. */
- char *new_lineptr;
- if (needed_max < needed)
- needed = needed_max;
- if (cur_len + 1 >= needed)
- {
- result = -1;
- goto unlock_return;
- }
-
- new_lineptr = (char *) realloc (*lineptr, needed);
- if (new_lineptr == NULL)
- {
- result = -1;
- goto unlock_return;
- }
-
- *lineptr = new_lineptr;
- *n = needed;
- }
-
- (*lineptr)[cur_len] = i;
- cur_len++;
-
- if (i == delimiter)
- break;
- }
- (*lineptr)[cur_len] = '\0';
- result = cur_len ? cur_len : result;
-
- unlock_return:
- funlockfile (fp); /* doesn't set errno */
-
- return result;
-}
-
-
void
bookmarks_write_center_to_file(struct bookmarks *this_, char *file)
{