magic.c (275698) | magic.c (276577) |
---|---|
1/* 2 * Copyright (c) Christos Zoulas 2003. 3 * All Rights Reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28#ifdef WIN32 29#include <windows.h> 30#include <shlwapi.h> 31#endif 32 33#include "file.h" 34 35#ifndef lint | 1/* 2 * Copyright (c) Christos Zoulas 2003. 3 * All Rights Reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28#ifdef WIN32 29#include <windows.h> 30#include <shlwapi.h> 31#endif 32 33#include "file.h" 34 35#ifndef lint |
36FILE_RCSID("@(#)$File: magic.c,v 1.90 2014/12/04 15:56:46 christos Exp $") | 36FILE_RCSID("@(#)$File: magic.c,v 1.91 2014/12/16 23:18:40 christos Exp $") |
37#endif /* lint */ 38 39#include "magic.h" 40 41#include <stdlib.h> 42#include <unistd.h> 43#include <string.h> 44#ifdef QUICK --- 504 unchanged lines hidden (view full) --- 549 ms->name_max = *(const size_t *)val; 550 return 0; 551 case MAGIC_PARAM_ELF_PHNUM_MAX: 552 ms->elf_phnum_max = *(const size_t *)val; 553 return 0; 554 case MAGIC_PARAM_ELF_SHNUM_MAX: 555 ms->elf_shnum_max = *(const size_t *)val; 556 return 0; | 37#endif /* lint */ 38 39#include "magic.h" 40 41#include <stdlib.h> 42#include <unistd.h> 43#include <string.h> 44#ifdef QUICK --- 504 unchanged lines hidden (view full) --- 549 ms->name_max = *(const size_t *)val; 550 return 0; 551 case MAGIC_PARAM_ELF_PHNUM_MAX: 552 ms->elf_phnum_max = *(const size_t *)val; 553 return 0; 554 case MAGIC_PARAM_ELF_SHNUM_MAX: 555 ms->elf_shnum_max = *(const size_t *)val; 556 return 0; |
557 case MAGIC_PARAM_ELF_NOTES_MAX: 558 ms->elf_notes_max = *(const size_t *)val; 559 return 0; |
|
557 default: 558 errno = EINVAL; 559 return -1; 560 } 561} 562 563public int 564magic_getparam(struct magic_set *ms, int param, void *val) --- 6 unchanged lines hidden (view full) --- 571 *(size_t *)val = ms->name_max; 572 return 0; 573 case MAGIC_PARAM_ELF_PHNUM_MAX: 574 *(size_t *)val = ms->elf_phnum_max; 575 return 0; 576 case MAGIC_PARAM_ELF_SHNUM_MAX: 577 *(size_t *)val = ms->elf_shnum_max; 578 return 0; | 560 default: 561 errno = EINVAL; 562 return -1; 563 } 564} 565 566public int 567magic_getparam(struct magic_set *ms, int param, void *val) --- 6 unchanged lines hidden (view full) --- 574 *(size_t *)val = ms->name_max; 575 return 0; 576 case MAGIC_PARAM_ELF_PHNUM_MAX: 577 *(size_t *)val = ms->elf_phnum_max; 578 return 0; 579 case MAGIC_PARAM_ELF_SHNUM_MAX: 580 *(size_t *)val = ms->elf_shnum_max; 581 return 0; |
582 case MAGIC_PARAM_ELF_NOTES_MAX: 583 *(size_t *)val = ms->elf_notes_max; 584 return 0; |
|
579 default: 580 errno = EINVAL; 581 return -1; 582 } 583} | 585 default: 586 errno = EINVAL; 587 return -1; 588 } 589} |