![]() |
![]() |
![]() |
Camel Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define O_BINARYgint camel_file_util_encode_fixed_int32 (,
FILE *out);
gint32 valuegint camel_file_util_decode_fixed_int32 (,
FILE *in);
gint32 *destgint camel_file_util_encode_uint32 (,
FILE *out);
guint32 valuegint camel_file_util_decode_uint32 (,
FILE *in);
guint32 *destgint camel_file_util_encode_time_t (,
FILE *out);
time_t valuegint camel_file_util_decode_time_t (,
FILE *in);
time_t *destgint camel_file_util_encode_off_t (,
FILE *out);
off_t valuegint camel_file_util_decode_off_t (,
FILE *in);
off_t *destgint camel_file_util_encode_gsize (,
FILE *out);
gsize valuegint camel_file_util_decode_gsize (,
FILE *in);
gsize *destgint camel_file_util_encode_string (,
FILE *outconst
);gchar *strgint camel_file_util_decode_string (,
FILE *in);
gchar **strgint camel_file_util_encode_fixed_string (,
FILE *outconst
,gchar *str);
gsize lengint camel_file_util_decode_fixed_string (,
FILE *in,
gchar **str);
gsize lengchar * camel_file_util_safe_filename (const
);gchar *namegssize camel_read (,
gint fd,
gchar *buf,
gsize n,
GCancellable *cancellable);
GError **errorgssize camel_write (,
gint fdconst
,gchar *buf,
gsize n,
GCancellable *cancellable);
GError **errorgssize camel_read_socket (,
gint fd,
gchar *buf,
gsize n,
GCancellable *cancellable);
GError **errorgssize camel_write_socket (,
gint fdconst
,gchar *buf,
gsize n,
GCancellable *cancellable);
GError **errorgchar * camel_file_util_savename (const
);gchar *filename
gint camel_file_util_encode_fixed_int32 (,
FILE *out);
gint32 value
Encode a gint32, performing no compression, but converting to network order.
|
file to output to |
|
value to output |
Returns : |
0 -1 |
gint camel_file_util_decode_fixed_int32 (,
FILE *in);
gint32 *dest
Retrieve a gint32.
|
file to read from |
|
pointer to a variable to store the value in |
Returns : |
0 -1 |
gint camel_file_util_encode_uint32 (,
FILE *out);
guint32 value
Utility function to save an uint32 to a file.
|
file to output to |
|
value to output |
Returns : |
0 -1 |
gint camel_file_util_decode_uint32 (,
FILE *in);
guint32 *dest
Retrieve an encoded uint32 from a file.
|
file to read from |
|
pointer to a variable to store the value in |
Returns : |
0 -1 |
gint camel_file_util_encode_time_t (,
FILE *out);
time_t value
Encode a time_t value to the file.
|
file to output to |
|
value to output |
Returns : |
0 -1 |
gint camel_file_util_decode_time_t (,
FILE *in);
time_t *dest
Decode a time_t value.
|
file to read from |
|
pointer to a variable to store the value in |
Returns : |
0 -1 |
gint camel_file_util_encode_off_t (,
FILE *out);
off_t value
Encode an off_t type.
|
file to output to |
|
value to output |
Returns : |
0 -1 |
gint camel_file_util_decode_off_t (,
FILE *in);
off_t *dest
Decode an off_t type.
|
file to read from |
|
pointer to a variable to put the value in |
Returns : |
0 -1 |
gint camel_file_util_encode_gsize (,
FILE *out);
gsize value
Encode an gsize type.
|
file to output to |
|
value to output |
Returns : |
0 -1 |
gint camel_file_util_decode_gsize (,
FILE *in);
gsize *dest
Decode an gsize type.
|
file to read from |
|
pointer to a variable to put the value in |
Returns : |
0 -1 |
gint camel_file_util_encode_string (,
FILE *outconst
);gchar *str
Encode a normal string and save it in the output file.
|
file to output to |
|
value to output |
Returns : |
0 -1 |
gint camel_file_util_decode_string (,
FILE *in);
gchar **str
Decode a normal string from the input file.
|
file to read from |
|
pointer to a variable to store the value in |
Returns : |
0 -1 |
gint camel_file_util_encode_fixed_string (,
FILE *outconst
,gchar *str);
gsize len
Encode a normal string and save it in the output file.
Unlike camel_file_util_encode_string
, it pads the
str
with "NULL" bytes, if len
is > strlen(str)
|
file to output to |
|
value to output |
|
total-len of str to store |
Returns : |
0 -1 |
gint camel_file_util_decode_fixed_string (,
FILE *in,
gchar **str);
gsize len
Decode a normal string from the input file.
|
file to read from |
|
pointer to a variable to store the value in |
|
total-len to decode. |
Returns : |
0 -1 |
gchar * camel_file_util_safe_filename (const
);gchar *name
'Flattens' name
into a safe filename string by hex encoding any
chars that may cause problems on the filesystem.
|
string to 'flattened' into a safe filename |
Returns : |
a safe filename string. |
gssize camel_read (,
gint fd,
gchar *buf,
gsize n,
GCancellable *cancellable);
GError **error
Cancellable libc read()
Code that intends to be portable to Win32 should call this function
only on file descriptors returned from open()
|
file descriptor |
|
buffer to fill |
|
number of bytes to read into buf
|
|
optional NULL |
|
return location for a NULL |
Returns : |
number of bytes read or -1 on fail. On failure, errno will be set appropriately. |
gssize camel_write (,
gint fdconst
,gchar *buf,
gsize n,
GCancellable *cancellable);
GError **error
Cancellable libc write()
Code that intends to be portable to Win32 should call this function
only on file descriptors returned from open()
|
file descriptor |
|
buffer to write |
|
number of bytes of buf to write |
|
optional NULL |
|
return location for a NULL |
Returns : |
number of bytes written or -1 on fail. On failure, errno will be set appropriately. |
gssize camel_read_socket (,
gint fd,
gchar *buf,
gsize n,
GCancellable *cancellable);
GError **error
Cancellable read()
socket()
accept()
|
a socket |
|
buffer to fill |
|
number of bytes to read into buf
|
|
optional NULL |
|
return location for a NULL |
Returns : |
number of bytes read or -1 on fail. On failure, errno will
be set appropriately. If the socket is nonblocking
camel_read_socket() will retry the read until it gets something. |
gssize camel_write_socket (,
gint fdconst
,gchar *buf,
gsize n,
GCancellable *cancellable);
GError **error
Cancellable write()
socket()
accept()
|
file descriptor |
|
buffer to write |
|
number of bytes of buf to write |
|
return location for a NULL |
Returns : |
number of bytes written or -1 on fail. On failure, errno will be set appropriately. |
gchar * camel_file_util_savename (const
);gchar *filename
Builds a pathname where the basename is of the form ".#" + the
basename of filename
, for instance used in a two-stage commit file
write.
|
a pathname |
Returns : |
The new pathname. It must be free'd with g_free() |