| 690 | */ |
| 691 | |
| 692 | mime_type_t * /* O - Matching file type definition */ |
| 693 | mimeType(mime_t *mime, /* I - MIME database */ |
| 694 | const char *super, /* I - Super-type name */ |
| 695 | const char *type) /* I - Type name */ |
| 696 | { |
| 697 | mime_type_t key, /* MIME type search key */ |
| 698 | *mt; /* Matching type */ |
| 699 | |
| 700 | |
| 701 | DEBUG_printf(("mimeType(mime=%p, super=\"%s\", type=\"%s\")", mime, super, |
| 702 | type)); |
| 703 | |
| 704 | /* |
| 705 | * Range check input... |
| 706 | */ |
| 707 | |
| 708 | if (!mime || !super || !type) |
| 709 | { |
| 710 | DEBUG_puts("1mimeType: Returning NULL."); |
| 711 | return (NULL); |
| 712 | } |
| 713 | |
| 714 | /* |
| 715 | * Lookup the type in the array... |
| 716 | */ |
| 717 | |
| 718 | strlcpy(key.super, super, sizeof(key.super)); |
| 719 | strlcpy(key.type, type, sizeof(key.type)); |
| 720 | |
| 721 | mt = (mime_type_t *)cupsArrayFind(mime->types, &key); |
| 722 | DEBUG_printf(("1mimeType: Returning %p.", mt)); |
| 723 | return (mt); |
| 724 | } |
| 725 | |
| 726 | |
| 727 | /* |