checkwps: harden filename extension checking.
[maemo-rb.git] / lib / unwarminder / safe_read.h
blob0ad23e648d4d39e18eeb017bcc512aa8d41f6ec6
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2012 by Amaury Pouly
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __SAFE_READ__
22 #define __SAFE_READ__
24 #include "system.h"
26 /* Try to read an X-bit unsigned integer. If the address is not readable,
27 * returns false. Otherwise returns true and store the result in *value
28 * if value is not NULL */
29 bool safe_read8(uint8_t *addr, uint8_t *value);
30 bool safe_read16(uint16_t *addr, uint16_t *value);
31 bool safe_read32(uint32_t *addr, uint32_t *value);
33 #endif /* __SAFE_READ__ */