Move kfile to kern/ directory; remove duplicate file.h.
[bertos.git] / mware / prog.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/)
5  * All Rights Reserved.
6  * -->
7  *
8  * \brief Generic program read/write routines interface
9  * 
10  * This module implements an interface function for programming
11  * a CPU flash memory. To guarantee correct memory writing, we
12  * use a rotating hash algorithm.
13  * 
14  * 
15  * \version $Id$
16  * \author Francesco Sacchi <batt@develer.com>
17  * \author Daniele Basile <asterix@develer.com>
18  */
19
20 #ifndef PROG_H
21 #define PROG_H
22
23 #include <cfg/compiler.h>
24 #include <kern/kfile.h>
25 #include <algos/rotating_hash.h>
26
27 /**
28  * Generic interface of progress status function.
29  * \param value is current progress value
30  * \param max is max progress value
31  * \return True if programming should continue
32  * \return False to stop programming
33  */
34 typedef bool (*progress_func_t) (int value, int max);
35
36 /**
37  * Generic interface for programming a CPU flash memory.
38  * \param *file is the Kfile pointer to write
39  * \param progress is progress fuction pointer, can be NULL if not used
40  * \return rotating hash of file written
41  */
42 rotating_t prog_write(struct _KFile *file, progress_func_t progress);
43
44 #endif /* PROG_H */