fm-utils

fm-utils

Synopsis

const char *        (*FmAppCommandParseCallback)        (char opt,
                                                         gpointer user_data);
struct              FmAppCommandParseOption;
int                 fm_app_command_parse                (const char *cmd,
                                                         const FmAppCommandParseOption *opts,
                                                         char **ret,
                                                         gpointer user_data);
char *              fm_canonicalize_filename            (const char *filename,
                                                         const char *cwd);
char *              fm_file_size_to_str                 (char *buf,
                                                         size_t buf_size,
                                                         goffset size,
                                                         gboolean si_prefix);
gboolean            fm_key_file_get_bool                (GKeyFile *kf,
                                                         const char *grp,
                                                         const char *key,
                                                         gboolean *val);
gboolean            fm_key_file_get_int                 (GKeyFile *kf,
                                                         const char *grp,
                                                         const char *key,
                                                         int *val);
char *              fm_strdup_replace                   (char *str,
                                                         char *old_str,
                                                         char *new_str);

Description

Details

FmAppCommandParseCallback ()

const char *        (*FmAppCommandParseCallback)        (char opt,
                                                         gpointer user_data);

struct FmAppCommandParseOption

struct FmAppCommandParseOption {
    char opt;
    FmAppCommandParseCallback callback;
};

fm_app_command_parse ()

int                 fm_app_command_parse                (const char *cmd,
                                                         const FmAppCommandParseOption *opts,
                                                         char **ret,
                                                         gpointer user_data);

This function parses line that contains some %<char> commands and does substitutions on them using callbacks provided by caller.

cmd :

line to parse

opts :

plain list of possible options

ret :

pointer for resulting string, string should be freed by caller

user_data :

caller data to pass to callback

Returns :

number of valid options found in cmd

fm_canonicalize_filename ()

char *              fm_canonicalize_filename            (const char *filename,
                                                         const char *cwd);

fm_file_size_to_str ()

char *              fm_file_size_to_str                 (char *buf,
                                                         size_t buf_size,
                                                         goffset size,
                                                         gboolean si_prefix);

fm_key_file_get_bool ()

gboolean            fm_key_file_get_bool                (GKeyFile *kf,
                                                         const char *grp,
                                                         const char *key,
                                                         gboolean *val);

fm_key_file_get_int ()

gboolean            fm_key_file_get_int                 (GKeyFile *kf,
                                                         const char *grp,
                                                         const char *key,
                                                         int *val);

fm_strdup_replace ()

char *              fm_strdup_replace                   (char *str,
                                                         char *old_str,
                                                         char *new_str);