X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=aft.c;h=c6ca289f18229b28ecf0ee45fba49d06fc1791fc;hb=ea689d919fd6fdbfaba2de9d1cd207e033c319fd;hp=431bedb63c1c1bb58a632aa055eeaf8a98198ce7;hpb=c31f2422a6f4dd8e3041788990bd138b29b85c3a;p=paraslash.git diff --git a/aft.c b/aft.c index 431bedb6..c6ca289f 100644 --- a/aft.c +++ b/aft.c @@ -298,12 +298,19 @@ bad_path: return -E_BAD_PATH; } +/** The on-disk layout of a afhi struct. */ enum afhi_offsets { + /** Where the number of seconds is stored. */ AFHI_SECONDS_TOTAL_OFFSET = 0, + /** Position of the bitrate. */ AFHI_BITRATE_OFFSET = 4, + /** Position of the frequency. */ AFHI_FREQUENCY_OFFSET = 8, + /** Number of channels is stored here. */ AFHI_CHANNELS_OFFSET = 12, + /** The tag info position. */ AFHI_INFO_STRING_OFFSET = 13, + /** Minimal on-disk size of a valid afhi struct. */ MIN_AFHI_SIZE = 14 }; @@ -670,6 +677,7 @@ static int get_local_time(uint64_t *seconds, char *buf, size_t size, return 1; } +/** Compute the number of (decimal) digits of a number. */ #define GET_NUM_DIGITS(x, num) { \ typeof((x)) _tmp = PARA_ABS(x); \ *num = 1; \ @@ -1363,13 +1371,17 @@ afhi <=> force or no HS */ - -#define ADD_FLAG_LAZY 1 -#define ADD_FLAG_FORCE 2 -#define ADD_FLAG_VERBOSE 4 -#define ADD_FLAG_ALL 8 - -/* TODO: change log messages so that they get written to the result buffer */ +/** Flags passed to the add command. */ +enum com_add_flags { + /** Skip paths that exist already. */ + ADD_FLAG_LAZY = 1, + /** Force adding. */ + ADD_FLAG_FORCE = 2, + /** Print what is being done. */ + ADD_FLAG_VERBOSE = 4, + /** Try to add files with unknown suffixes. */ + ADD_FLAG_ALL = 8, +}; static int com_add_callback(const struct osl_object *query, struct osl_object *result) @@ -1683,8 +1695,15 @@ int com_add(int fd, int argc, char * const * const argv) } +/** + * Flags used by the touch command. + * + * \sa com_touch(). + */ enum touch_flags { + /** Whether the \p FNM_PATHNAME flag should be passed to fnmatch(). */ TOUCH_FLAG_FNM_PATHNAME = 1, + /** Activates verbose mode. */ TOUCH_FLAG_VERBOSE = 2 }; @@ -1947,12 +1966,23 @@ int com_afs_rm(int fd, int argc, char * const * const argv) return ret; } +/** + * Flags used by the cpsi command. + * + * \sa com_cpsi(). + */ enum cpsi_flags { + /** Whether the lyrics id should be copied. */ CPSI_FLAG_COPY_LYRICS_ID = 1, + /** Whether the image id should be copied. */ CPSI_FLAG_COPY_IMAGE_ID = 2, + /** Whether the lastplayed time should be copied. */ CPSI_FLAG_COPY_LASTPLAYED = 4, + /** Whether the numplayed count should be copied. */ CPSI_FLAG_COPY_NUMPLAYED = 8, + /** Whether the attributes should be copied. */ CPSI_FLAG_COPY_ATTRIBUTES = 16, + /** Activates verbose mode. */ CPSI_FLAG_VERBOSE = 32, }; @@ -2123,6 +2153,16 @@ static int check_audio_file(struct osl_row *row, void *data) return 1; } +/** + * Check the audio file table for inconsistencies. + * + * \param query Unused. + * \param result Contains message string upon return. + * + * This function always succeeds. + * + * \sa com_check(). + */ int aft_check_callback(__a_unused const struct osl_object *query, struct osl_object *result) { struct para_buffer pb = {.buf = NULL}; @@ -2135,8 +2175,6 @@ int aft_check_callback(__a_unused const struct osl_object *query, struct osl_obj } - - /** * Close the audio file table. *