fix parameters for open
This commit is contained in:
parent
5d27ad0243
commit
5f7101a9e3
12
os/pl-file.c
12
os/pl-file.c
@ -3413,16 +3413,16 @@ openStream(term_t file, term_t mode, term_t options)
|
|||||||
int reposition = TRUE;
|
int reposition = TRUE;
|
||||||
atom_t alias = NULL_ATOM;
|
atom_t alias = NULL_ATOM;
|
||||||
atom_t eof_action = ATOM_eof_code;
|
atom_t eof_action = ATOM_eof_code;
|
||||||
|
int close_on_abort = TRUE;
|
||||||
atom_t buffer = ATOM_full;
|
atom_t buffer = ATOM_full;
|
||||||
atom_t lock = ATOM_none;
|
atom_t lock = ATOM_none;
|
||||||
int wait = TRUE;
|
int wait = TRUE;
|
||||||
atom_t encoding = NULL_ATOM;
|
atom_t encoding = NULL_ATOM;
|
||||||
#ifdef O_LOCALE
|
|
||||||
PL_locale *locale = NULL;
|
|
||||||
#endif
|
|
||||||
int close_on_abort = TRUE;
|
|
||||||
int bom = -1;
|
int bom = -1;
|
||||||
int scripting = FALSE;
|
int scripting = FALSE;
|
||||||
|
#ifdef O_LOCALE
|
||||||
|
PL_locale *locale = NULL;
|
||||||
|
#endif
|
||||||
char how[10];
|
char how[10];
|
||||||
char *h = how;
|
char *h = how;
|
||||||
char *path;
|
char *path;
|
||||||
@ -3468,13 +3468,13 @@ openStream(term_t file, term_t mode, term_t options)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ( type == ATOM_binary && enc != ENC_OCTET )
|
if ( type == ATOM_binary && enc != ENC_OCTET )
|
||||||
{ bad_encoding("type(binary) implies encoding(octet)", encoding);
|
{ bad_encoding("type(binary) implies encoding(octet)", encoding);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
switch(enc) /* explicitely specified: do not */
|
switch(enc) /* explicitely specified: do not */
|
||||||
{ case ENC_OCTET: /* switch to Unicode. For implicit */
|
{ case ENC_OCTET: /* switch to Unicode. For implicit */
|
||||||
case ENC_ASCII: /* and unicode types we must detect */
|
case ENC_ASCII: /* and unicode types we must detect */
|
||||||
case ENC_ISO_LATIN_1: /* and skip the BOM */
|
case ENC_ISO_LATIN_1: /* and skip the BOM */
|
||||||
case ENC_WCHAR:
|
case ENC_WCHAR:
|
||||||
bom = FALSE;
|
bom = FALSE;
|
||||||
break;
|
break;
|
||||||
|
@ -35,7 +35,7 @@ Variable argument list:
|
|||||||
#define MAXOPTIONS 32
|
#define MAXOPTIONS 32
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
{ bool *b; /* boolean value */
|
{ int *b; /* boolean value */
|
||||||
long *l; /* long value */
|
long *l; /* long value */
|
||||||
int *i; /* integer value */
|
int *i; /* integer value */
|
||||||
uintptr_t *sz; /* size_t value */
|
uintptr_t *sz; /* size_t value */
|
||||||
|
Reference in New Issue
Block a user