25 #include <glib/gstdio.h>
30 #include <sys/types.h>
68 if (!filename || filename[0] ==
'\0')
return 0;
73 if (!fullname)
return 0;
76 fd = g_open( fullname, O_RDONLY, 0 );
84 PERR (
"file %s: (%d) %s \n", filename, norr, strerror(norr));
89 size = lseek( fd, 0, SEEK_END );
90 lseek( fd, 0, SEEK_SET );
93 buf = g_new(
char, size + 1);
96 if ( read(fd, buf, size) == -1 )
132 g_return_val_if_fail(line, -1);
134 g_return_val_if_fail(file, -1);
136 gs = g_string_new(
"");
138 while (fgets(str,
sizeof(str), file) != NULL)
140 g_string_append(gs, str);
143 if (str[len-1] ==
'\n')
149 g_string_free(gs, FALSE);
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
GKeyFile helper routines.
#define PERR(format, args...)
gint64 gnc_getline(gchar **line, FILE *file)
All type declarations for the whole Gnucash engine.
Utility functions for file access.
gchar * gnc_path_find_localized_html_file(const gchar *file_name)
Find an absolute path to a localized version of a given relative path to a html or html related file...
Utility functions for convert uri in separate components and back.
File path resolution utility functions.
int gncReadFile(const char *filename, char **data)
const gchar * QofLogModule