X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Ffs_directory.c;h=29747c2f1249cf282c3cc3319e0c5b97c4b532c8;hb=ed51bc86aad5044b88ce4fc3641cc920c8186863;hp=f43fe14a713fb6b60db5c1351a7cabe63258e537;hpb=cddbdf5b928c68ab71b40c950b9f01ea68a9fbdb;p=oweals%2Fgnunet.git diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index f43fe14a7..29747c2f1 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2003, 2004, 2006, 2009 Christian Grothoff (and other contributing authors) + Copyright (C) 2003, 2004, 2006, 2009 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -34,7 +34,7 @@ */ #include "platform.h" #include "gnunet_fs_service.h" -#include "fs.h" +#include "fs_api.h" /** * String that is used to indicate that a file @@ -47,23 +47,21 @@ * Does the meta-data claim that this is a directory? * Checks if the mime-type is that of a GNUnet directory. * - * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if - * we have no mime-type information (treat as 'GNUNET_NO') + * @return #GNUNET_YES if it is, #GNUNET_NO if it is not, #GNUNET_SYSERR if + * we have no mime-type information (treat as #GNUNET_NO) */ int -GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData - *md) +GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData *md) { char *mime; int ret; if (NULL == md) return GNUNET_SYSERR; - mime = - GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_MIMETYPE); - if (mime == NULL) + mime = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_MIMETYPE); + if (NULL == mime) return GNUNET_SYSERR; - ret = (0 == strcmp (mime, GNUNET_FS_DIRECTORY_MIME)) ? GNUNET_YES : GNUNET_NO; + ret = (0 == strcasecmp (mime, GNUNET_FS_DIRECTORY_MIME)) ? GNUNET_YES : GNUNET_NO; GNUNET_free (mime); return ret; } @@ -197,11 +195,7 @@ GNUNET_FS_directory_list_contents (size_t size, const void *data, if ((offset == 0) && ((size < 8 + sizeof (uint32_t)) || (0 != memcmp (cdata, GNUNET_FS_DIRECTORY_MAGIC, 8)))) - { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - _("MAGIC mismatch. This is not a GNUnet directory.\n")); return GNUNET_SYSERR; - } pos = offset; if (offset == 0) { @@ -350,7 +344,7 @@ GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData { struct GNUNET_FS_DirectoryBuilder *ret; - ret = GNUNET_malloc (sizeof (struct GNUNET_FS_DirectoryBuilder)); + ret = GNUNET_new (struct GNUNET_FS_DirectoryBuilder); if (mdir != NULL) ret->meta = GNUNET_CONTAINER_meta_data_duplicate (mdir); else