X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fdev%2Fmessage_buffer.h;fp=direct%2Ftimothy_tests%2Fdev%2Fmessage_buffer.h;h=eadddb712a4c7f7ac477180fb09a8de884888138;hp=0000000000000000000000000000000000000000;hb=86231ed7a8ebecf2e4821f9b426262045f941591;hpb=a34826e701dd381a293bb90b25a48d2bd58e8de8;ds=sidebyside diff --git a/direct/timothy_tests/dev/message_buffer.h b/direct/timothy_tests/dev/message_buffer.h new file mode 100644 index 0000000..eadddb7 --- /dev/null +++ b/direct/timothy_tests/dev/message_buffer.h @@ -0,0 +1,45 @@ +/* + * YAFFS: Yet another Flash File System . A NAND-flash specific file system. + * + * Copyright (C) 2002-2010 Aleph One Ltd. + * for Toby Churchill Ltd and Brightstar Engineering + * + * Created by Timothy Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. + */ + +#ifndef __message_buffer__ +#define __message_buffer__ + +#include +#include +#define PRINT 1 +#define NPRINT 0 +#define APPEND_MESSAGE 1 +#define DO_NOT_APPEND_MESSAGE 0 +#define PRINT_ALL -1 /*this is used to print all of the messages in a buffer*/ +#define BUFFER_MESSAGE_LENGTH 60 /*number of char in message*/ +#define BUFFER_SIZE 50 /*number of messages in buffer*/ +#define MESSAGE_LEVEL_ERROR 0 +#define MESSAGE_LEVEL_BASIC_TASKS 1 +typedef struct buffer_template{ + char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH]; + int head; + int tail; + char message_level[BUFFER_SIZE]; +}buffer; +#include "error_handler.h" /*include this for the debug level*/ + + +void print_buffer(buffer *p_Buffer,int number_of_messages_to_print); /*print messages in the buffer*/ +/*wrapper functions for add_to_buffer_root_function*/ +void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print); +void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print); + +void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print); +#endif