1 |
2 |
csantifort |
/*----------------------------------------------------------------
|
2 |
|
|
// //
|
3 |
|
|
// stdio.h //
|
4 |
|
|
// //
|
5 |
|
|
// This file is part of the Amber project //
|
6 |
|
|
// http://www.opencores.org/project,amber //
|
7 |
|
|
// //
|
8 |
|
|
// Description //
|
9 |
|
|
// Contains defines and function prototypes for the //
|
10 |
|
|
// mini-libc library. //
|
11 |
|
|
// //
|
12 |
|
|
// Author(s): //
|
13 |
|
|
// - Conor Santifort, csantifort.amber@gmail.com //
|
14 |
|
|
// //
|
15 |
|
|
//////////////////////////////////////////////////////////////////
|
16 |
|
|
// //
|
17 |
|
|
// Copyright (C) 2010 Authors and OPENCORES.ORG //
|
18 |
|
|
// //
|
19 |
|
|
// This source file may be used and distributed without //
|
20 |
|
|
// restriction provided that this copyright statement is not //
|
21 |
|
|
// removed from the file and that any derivative work contains //
|
22 |
|
|
// the original copyright notice and the associated disclaimer. //
|
23 |
|
|
// //
|
24 |
|
|
// This source file is free software; you can redistribute it //
|
25 |
|
|
// and/or modify it under the terms of the GNU Lesser General //
|
26 |
|
|
// Public License as published by the Free Software Foundation; //
|
27 |
|
|
// either version 2.1 of the License, or (at your option) any //
|
28 |
|
|
// later version. //
|
29 |
|
|
// //
|
30 |
|
|
// This source is distributed in the hope that it will be //
|
31 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied //
|
32 |
|
|
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
|
33 |
|
|
// PURPOSE. See the GNU Lesser General Public License for more //
|
34 |
|
|
// details. //
|
35 |
|
|
// //
|
36 |
|
|
// You should have received a copy of the GNU Lesser General //
|
37 |
|
|
// Public License along with this source; if not, download it //
|
38 |
|
|
// from http://www.opencores.org/lgpl.shtml //
|
39 |
|
|
// //
|
40 |
|
|
----------------------------------------------------------------*/
|
41 |
|
|
|
42 |
|
|
/* ===== Type Definitions ============================= */
|
43 |
|
|
typedef unsigned int size_t;
|
44 |
|
|
|
45 |
|
|
|
46 |
|
|
/* ===== Printf Function Prototypes =================== */
|
47 |
|
|
int printf (const char *format, ...);
|
48 |
|
|
int sprintf (char* dst, const char *format, ...);
|
49 |
|
|
int print (char** dst, const char *format, unsigned long *varg);
|
50 |
|
|
int prints (char** dst, const char *string, int width, int pad);
|
51 |
33 |
csantifort |
int printi (char** dst, int i, int b, int sg, int width, int pad, int letbase);
|
52 |
2 |
csantifort |
|
53 |
|
|
|
54 |
|
|
/* ===== Memory Function Prototypes =================== */
|
55 |
|
|
void* memcpy (void *dest, const void *src, size_t count);
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
/* ===== String Function Prototypes =================== */
|
59 |
|
|
int _outbyte ( int );
|
60 |
|
|
int _inbyte ( int );
|
61 |
|
|
void strcpy (char*, char* );
|
62 |
|
|
void strncpy (char*, char*, int );
|
63 |
|
|
int strncmp (char*, char*, int );
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
/* ===== Maths Function Prototypes =================== */
|
67 |
|
|
int _div ( int, int );
|