X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.h;fp=afs.h;h=81012ff888a95e2a9b7232671b0577d0b6ffd19d;hp=fb704046caafe3ae09008ab53c0437ba73137bc6;hb=59a4f545566f77a22a8c27ece5155ecd154d4145;hpb=e469622d99718d49158d5da649eb02180269b4c8 diff --git a/afs.h b/afs.h index fb704046..81012ff8 100644 --- a/afs.h +++ b/afs.h @@ -157,6 +157,13 @@ struct pattern_match_data { int (*action)(struct osl_table *table, struct osl_row *row, const char *name, void *data); }; +/** Arguments passed to each afs callback. */ +struct afs_callback_arg { + /** The local socket connecting afs and the command handler. */ + int fd; + /** Callback-specific data. */ + struct osl_object query; +}; /** * Afs command handlers run as a process which is not related to the afs @@ -166,7 +173,7 @@ struct pattern_match_data { * * \sa send_callback_request(). */ -typedef int afs_callback(int fd, const struct osl_object *); +typedef int afs_callback(struct afs_callback_arg *aca); /** * Callbacks send chunks to data back to the command handler. Pointers to @@ -242,7 +249,7 @@ void attribute_init(struct afs_table *t); void get_attribute_bitmap(const uint64_t *atts, char *buf); /* needed by com_ls() */ int get_attribute_bitnum_by_name(const char *att_name, unsigned char *bitnum); int get_attribute_text(uint64_t *atts, const char *delim, char **text); -int attribute_check_callback(int fd, __a_unused const struct osl_object *query); +int attribute_check_callback(struct afs_callback_arg *aca); /* aft */ void aft_init(struct afs_table *t); @@ -254,12 +261,12 @@ int get_afsi_of_row(const struct osl_row *row, struct afs_info *afsi); int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi); int get_audio_file_path_of_row(const struct osl_row *row, char **path); int audio_file_loop(void *private_data, osl_rbtree_loop_func *func); -int aft_check_callback(int fd, __a_unused const struct osl_object *query); +int aft_check_callback(struct afs_callback_arg *aca); /* playlist */ int playlist_open(char *name); void playlist_close(void); -int playlist_check_callback(int fd, __a_unused const struct osl_object *query); +int playlist_check_callback(struct afs_callback_arg *aca); /** evaluates to 1 if x < y, to -1 if x > y and to 0 if x == y */ #define NUM_COMPARE(x, y) ((int)((x) < (y)) - (int)((x) > (y)))