projects
/
rodin
/
chimara.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Defined a base style
[rodin/chimara.git]
/
libchimara
/
glkunix.c
diff --git
a/libchimara/glkunix.c
b/libchimara/glkunix.c
index ee1194357682a1b8ae619006663a136c013989b0..83d89896e1a4179518d7f04691fcd80c9cecbc22 100644
(file)
--- a/
libchimara/glkunix.c
+++ b/
libchimara/glkunix.c
@@
-7,12
+7,12
@@
#include "fileref.h"
#include "stream.h"
#include "fileref.h"
#include "stream.h"
-extern
ChimaraGlkPrivate *glk_data
;
+extern
GPrivate *glk_data_key
;
/**
* glkunix_stream_open_pathname:
* @pathname: A path to a file, in the system filename encoding.
/**
* glkunix_stream_open_pathname:
* @pathname: A path to a file, in the system filename encoding.
- * @
usag
e: Bitfield with one or more of the <code>fileusage_</code> constants.
+ * @
textmod
e: Bitfield with one or more of the <code>fileusage_</code> constants.
* @rock: The new stream's rock value.
*
* Opens an arbitrary file, in read-only mode. Note that this function is
* @rock: The new stream's rock value.
*
* Opens an arbitrary file, in read-only mode. Note that this function is
@@
-23,8
+23,10
@@
extern ChimaraGlkPrivate *glk_data;
* Returns: A new stream, or %NULL if the file operation failed.
*/
strid_t
* Returns: A new stream, or %NULL if the file operation failed.
*/
strid_t
-glkunix_stream_open_pathname(char *pathname, glui32
usag
e, glui32 rock)
+glkunix_stream_open_pathname(char *pathname, glui32
textmod
e, glui32 rock)
{
{
+ ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+
if(!glk_data->in_startup)
ILLEGAL("glkunix_stream_open_pathname() may only be called from "
"glkunix_startup_code().");
if(!glk_data->in_startup)
ILLEGAL("glkunix_stream_open_pathname() may only be called from "
"glkunix_startup_code().");
@@
-32,7
+34,7
@@
glkunix_stream_open_pathname(char *pathname, glui32 usage, glui32 rock)
g_return_val_if_fail(pathname, NULL);
g_return_val_if_fail(strlen(pathname) > 0, NULL);
g_return_val_if_fail(pathname, NULL);
g_return_val_if_fail(strlen(pathname) > 0, NULL);
- frefid_t fileref = fileref_new(pathname, rock,
usag
e, filemode_Read);
+ frefid_t fileref = fileref_new(pathname, rock,
textmod
e, filemode_Read);
return file_stream_new(fileref, filemode_Read, rock, FALSE);
}
return file_stream_new(fileref, filemode_Read, rock, FALSE);
}
@@
-53,6
+55,8
@@
glkunix_set_base_file(char *filename)
{
g_return_if_fail(filename);
g_return_if_fail(strlen(filename) > 0);
{
g_return_if_fail(filename);
g_return_if_fail(strlen(filename) > 0);
+
+ ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
gchar *dirname = g_path_get_dirname(filename);
if(!g_file_test(dirname, G_FILE_TEST_IS_DIR))
gchar *dirname = g_path_get_dirname(filename);
if(!g_file_test(dirname, G_FILE_TEST_IS_DIR))