-static int size_compare(const struct osl_object *obj1, const struct osl_object *obj2)
-{
- uint64_t d1 = *(uint64_t *)obj1->data;
- uint64_t d2 = *(uint64_t *)obj2->data;
- int ret = NUM_COMPARE(d2, d1);
-
- if (ret)
- return ret;
- //INFO_LOG("addresses: %p, %p\n", obj1->data, obj2->data);
- return NUM_COMPARE(obj2->data, obj1->data);
-}
-
-/**
- * Compare two osl objects of string type.
- *
- * \param obj1 Pointer to the first object.
- * \param obj2 Pointer to the second object.
- *
- * In any case, only \p MIN(obj1->size, obj2->size) characters of each string
- * are taken into account.
- *
- * \return It returns an integer less than, equal to, or greater than zero if
- * \a obj1 is found, respectively, to be less than, to match, or be greater
- * than obj2.
- *
- * \sa strcmp(3), strncmp(3), osl_compare_func.
- */
-static int string_compare(const struct osl_object *obj1,
- const struct osl_object *obj2)
-{
- const char *str1 = (const char *)obj1->data;
- const char *str2 = (const char *)obj2->data;
- return strncmp(str1, str2, MIN(obj1->size, obj2->size));
-}
-
-/**
- * Compare two osl objects pointing to unsigned integers of 64 bit size.
- *
- * \param obj1 Pointer to the first integer.
- * \param obj2 Pointer to the second integer.
- *
- * \return The values required for an osl compare function.
- *
- * \sa osl_compare_func, osl_hash_compare().
- */
-static int uint64_compare(const struct osl_object *obj1,
- const struct osl_object *obj2)
-{
- uint64_t d1 = read_u64((const char *)obj1->data);
- uint64_t d2 = read_u64((const char *)obj2->data);
-
- if (d1 < d2)
- return 1;
- if (d1 > d2)
- return -1;
- return 0;
-}
-
-/** The columns of the directory table. */
-enum dir_table_columns {
- /** The name of the directory. */
- DT_NAME,
- /** The dir count number. */
- DT_NUM,
- /** The number of bytes of all regular files. */
- DT_BYTES,
- /** The number of all regular files. */
- DT_FILES,
- /** Number of columns in this table. */
- NUM_DT_COLUMNS
-};