comparison packages/cygmon/current/misc/bsp/hex-utils.h @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children e0c0827131d1
comparison
equal deleted inserted replaced
75:41bf073c0c32 76:435cced73e2f
1 #ifndef __BSP_HEX_UTILS_H__
2 #define __BSP_HEX_UTILS_H__
3 //==========================================================================
4 //
5 // hex-utils.h
6 //
7 // Utilities for decoding hexadecimal encoded integers.
8 //
9 //==========================================================================
10 //####COPYRIGHTBEGIN####
11 //
12 // -------------------------------------------
13 // The contents of this file are subject to the Red Hat eCos Public License
14 // Version 1.1 (the "License"); you may not use this file except in
15 // compliance with the License. You may obtain a copy of the License at
16 // http://www.redhat.com/
17 //
18 // Software distributed under the License is distributed on an "AS IS"
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
20 // License for the specific language governing rights and limitations under
21 // the License.
22 //
23 // The Original Code is eCos - Embedded Configurable Operating System,
24 // released September 30, 1998.
25 //
26 // The Initial Developer of the Original Code is Red Hat.
27 // Portions created by Red Hat are
28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
29 // All Rights Reserved.
30 // -------------------------------------------
31 //
32 //####COPYRIGHTEND####
33 //==========================================================================
34 //#####DESCRIPTIONBEGIN####
35 //
36 // Author(s):
37 // Contributors: gthomas
38 // Date: 1999-10-20
39 // Purpose: Utilities for decoding hexadecimal encoded integers.
40 // Description:
41 //
42 //
43 //####DESCRIPTIONEND####
44 //
45 //=========================================================================
46
47
48 #ifndef __ASSEMBLER__
49
50 /*
51 * Convert a single hex character to its binary value.
52 * Returns -1 if given character is not a value hex character.
53 */
54 extern int __hex(char ch);
55
56 /*
57 * Convert the hex data in 'buf' into 'count' bytes to be placed in 'mem'.
58 * Returns a pointer to the character in mem AFTER the last byte written.
59 */
60 extern char *__unpack_bytes_to_mem(char *buf, char *mem, int count);
61
62 /*
63 * While finding valid hex chars, build an unsigned long int.
64 * Return number of hex chars processed.
65 */
66 extern int __unpack_ulong(char **ptr, unsigned long *val);
67
68 /*
69 * Unpack 'count' hex characters, forming them into a binary value.
70 * Return that value as an int. Adjust the source pointer accordingly.
71 */
72 extern int __unpack_nibbles(char **ptr, int count);
73
74 #endif
75
76 #endif // __BSP_HEX_UTILS_H__