Logo Search packages:      
Sourcecode: obexd version File versions  Download package

gboolean gw_obex_read_dir ( GwObex ctx,
const gchar *  dir,
gchar **  buf,
gint *  buf_size,
gint *  error 

Get folder listing for the specified directory.

ctx Pointer returned by gw_obex_setup()
dir Directory to list (null terminated UTF-8), NULL to list current directory
buf Place to store the folder-listing object
buf_size Place to store the size for the retrieved object
error Place to store error code on failure (NULL if not interested)
TRUE on success, FALSE on failure

Definition at line 193 of file gw-obex.c.

References gw_obex_get().

    gboolean ret;
    CHECK_DISCONNECT(FALSE, error, ctx);
    ret = gw_obex_get(ctx, NULL, dir ? dir : "", LST_TYPE, NULL, 0, buf, buf_size, -1, FALSE);
    if (ret == FALSE)
        gw_obex_get_error(ctx, error);
    else if (*buf_size > 0) {
        /* Hack for some OBEX implementations which send nul's
         * at the end of the listing */
        int i;

        for (i = *buf_size - 1; i > 0; i--) {
            if ((*buf)[i] == '\0')
    return ret;

Generated by  Doxygen 1.6.0   Back to index