yaffs commiting changes to timothy_tests
[yaffs2.git] / direct / timothy_tests / message_buffer.h
1 /*
2  * YAFFS: Yet another FFS. A NAND-flash specific file system.
3  *
4  * Copyright (C) 2002-2010 Aleph One Ltd.
5  *   for Toby Churchill Ltd and Brightstar Engineering
6  *
7  * Created by Timothy Manning <timothy@yaffs.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  */
14
15 #ifndef __message_buffer__
16 #define __message_buffer__
17
18 #include <stdio.h>
19 #include <string.h>
20 #define PRINT 1
21 #define NPRINT 0
22 #define APPEND_MESSAGE 1
23 #define DO_NOT_APPEND_MESSAGE 0         
24 #define PRINT_ALL -1                    /*this is used to print all of the messages in a buffer*/
25 #define BUFFER_MESSAGE_LENGTH 60                /*number of char in message*/
26 #define BUFFER_SIZE 50                  /*number of messages in buffer*/
27 #define MESSAGE_LEVEL_ERROR 0
28 #define MESSAGE_LEVEL_BASIC_TASKS 1
29 typedef struct buffer_template{
30         char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
31         int head;
32         int tail;
33         char message_level[BUFFER_SIZE];
34 }buffer; 
35 #include "error_handler.h"              /*include this for the debug level*/
36
37
38 void print_buffer(buffer *p_Buffer,int number_of_messages_to_print);            /*print messages in the buffer*/ 
39 /*wrapper functions for add_to_buffer_root_function*/
40 void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
41 void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
42
43 void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
44 #endif