/*
This file is part of GNUnet.
- (C) 2003, 2004, 2006, 2009 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2003, 2004, 2006, 2009 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* 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;
}
{
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