OSDN Git Service

[SCHEMATIC] Modify SW/MW/LW Preamp, insert galbanic-isolator replace of common-mode...
[openi2cradio/OpenI2CRadio.git] / shell_strutl.h
1 /*
2  * OpenI2CRADIO
3  * String utls header.
4  * Copyright (C) 2013-11-07 K.Ohta <whatisthis.sowhat ai gmail.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2,
9  *  or (at your option) any later version.
10  *  This library / program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *  See the GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this library; see the file COPYING. If not, write to the
17  *  Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
18  *  MA 02110-1301, USA.
19  *
20  *  As a special exception, if you link this(includeed from sdcc) library
21  *  with other files, some of which are compiled with SDCC,
22  *  to produce an executable, this library does not by itself cause
23  *  the resulting executable to be covered by the GNU General Public License.
24  *  This exception does not however invalidate any other reasons why
25  *  the executable file might be covered by the GNU General Public License.
26  */
27
28 #ifndef SHELL_STRUTL_H
29 #define SHELL_STRUTL_H
30
31 #ifdef  __cplusplus
32 extern "C" {
33 #endif
34
35 #define TERM_OK 0
36 #define TERM_NONSREC -1
37 #define TERM_STRERR -2
38 #define TERM_SUMERR -3
39 #define TERM_SRECERR -4
40 #define TERM_UNDSREC -5
41 #define TERM_SRECEND -15
42 #define TERM_NULL -16
43 #define TERM_NONHDR -17
44
45 extern void bin2hex(char *s, unsigned char v);
46
47 extern unsigned char hex2byte(unsigned char *p);
48 extern unsigned char check_eol(unsigned char *p);
49 extern unsigned char c2h(unsigned char c);
50 extern unsigned char migrate_hex(unsigned char *p);
51 extern int search_head_s(unsigned char *s);
52 extern int str_shexheader(unsigned char *s, unsigned char *file);
53 extern int str_shex2bin(unsigned char *s, unsigned char *p, unsigned long *addr, unsigned char *len);
54
55 extern unsigned char str_put_shexheader(unsigned char *s, char *filename);
56 extern unsigned char str_bin2hex(unsigned char *s, unsigned char *p, unsigned long addr, unsigned char len);
57 extern unsigned char str_put_shexfooter(unsigned char *s);
58
59 extern unsigned char shell_strlen(char *s);
60 extern unsigned char shell_gettok(char *dst, char *src);
61 extern int shell_strcmp(char *from, char *to);
62
63 extern long term_getuint(char *pool);
64 extern void term_printnum(char *pool, unsigned int num);
65
66
67 #ifdef  __cplusplus
68 }
69 #endif
70
71 #endif  /* SHELL_STRUTL_H */
72