X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=scheduler%2Fmime.c;h=5d2c19824505b4f924acef56d14831e79f4ed3b7;hb=503b54c9302c8de6207e079a80a89a787eb612ea;hp=a4b77aee52ceda6b09b231a576182ab710620907;hpb=81441dd34a8a0be7aa4f20c86a6013b006d5614a;p=thirdparty%2Fcups.git diff --git a/scheduler/mime.c b/scheduler/mime.c index a4b77aee5..5d2c19824 100644 --- a/scheduler/mime.c +++ b/scheduler/mime.c @@ -1,40 +1,14 @@ /* - * "$Id$" + * MIME database file routines for CUPS. * - * MIME database file routines for CUPS. + * Copyright 2007-2014 by Apple Inc. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * - * Copyright 2007-2013 by Apple Inc. - * Copyright 1997-2006 by Easy Software Products, all rights reserved. - * - * These coded instructions, statements, and computer programs are the - * property of Apple Inc. and are protected by Federal copyright - * law. Distribution and use rights are outlined in the file "LICENSE.txt" - * which should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". - * - * Contents: - * - * mimeDelete() - Delete (free) a MIME database. - * mimeDeleteFilter() - Delete a filter from the MIME database. - * mimeDeleteType() - Delete a type from the MIME database. - * _mimeError() - Show an error message. - * mimeFirstFilter() - Get the first filter in the MIME database. - * mimeFirstType() - Get the first type in the MIME database. - * mimeLoad() - Create a new MIME database from disk. - * mimeLoadFilters() - Load filter definitions from disk. - * mimeLoadTypes() - Load type definitions from disk. - * mimeNew() - Create a new, empty MIME database. - * mimeNextFilter() - Get the next filter in the MIME database. - * mimeNextType() - Get the next type in the MIME database. - * mimeNumFilters() - Get the number of filters in a MIME database. - * mimeNumTypes() - Get the number of types in a MIME database. - * mimeSetErrorCallback() - Set the callback for error messages. - * mime_add_fcache() - Add a filter to the filter cache. - * mime_compare_fcache() - Compare two filter cache entries. - * mime_delete_fcache() - Free all memory used by the filter cache. - * mime_delete_rules() - Free all memory for the given rule tree. - * mime_load_convs() - Load a xyz.convs file. - * mime_load_types() - Load a xyz.types file. + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". */ /* @@ -659,8 +633,8 @@ mime_delete_rules(mime_magic_t *rules) /* I - Rules to free */ if (rules->child != NULL) mime_delete_rules(rules->child); - if (rules->op == MIME_MAGIC_REGEX && rules->value.rev) - regfree(&(rules.value.rev)); + if (rules->op == MIME_MAGIC_REGEX) + regfree(&(rules->value.rev)); free(rules); rules = next; @@ -744,7 +718,7 @@ mime_load_convs( while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' && (temp - super + 1) < MIME_MAX_SUPER) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -756,7 +730,7 @@ mime_load_convs( while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' && *lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -817,7 +791,7 @@ mime_load_convs( while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' && (temp - super + 1) < MIME_MAX_SUPER) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -829,7 +803,7 @@ mime_load_convs( while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' && *lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -868,7 +842,7 @@ mime_load_types(mime_t *mime, /* I - MIME database */ const char *filename) /* I - Types file to load */ { cups_file_t *fp; /* Types file */ - int linelen; /* Length of line */ + size_t linelen; /* Length of line */ char line[32768], /* Input line from file */ *lineptr, /* Current position in line */ super[MIME_MAX_SUPER], /* Super-type name */ @@ -930,7 +904,7 @@ mime_load_types(mime_t *mime, /* I - MIME database */ while (*lineptr != '/' && *lineptr != '\n' && *lineptr != '\0' && (temp - super + 1) < MIME_MAX_SUPER) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -942,7 +916,7 @@ mime_load_types(mime_t *mime, /* I - MIME database */ while (*lineptr != ' ' && *lineptr != '\t' && *lineptr != '\n' && *lineptr != '\0' && (temp - type + 1) < MIME_MAX_TYPE) - *temp++ = tolower(*lineptr++ & 255); + *temp++ = (char)tolower(*lineptr++ & 255); *temp = '\0'; @@ -956,8 +930,3 @@ mime_load_types(mime_t *mime, /* I - MIME database */ cupsFileClose(fp); } - - -/* - * End of "$Id$". - */