yaffsfs.c: Fix NULL dereference in yaffs_unmount2_reldev()
[yaffs2.git] / direct / test-framework / stress_tests / stress_tester / message_buffer.h
1 /*
2  * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
3  *
4  * Copyright (C) 2002-2018 Aleph One Ltd.
5  *
6  * Created by Timothy Manning <timothy@yaffs.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License version 2.1 as
10  * published by the Free Software Foundation.
11  *
12  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
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
30 #define LOG_FILE "log.txt"
31 typedef struct buffer_template{
32         char message[BUFFER_SIZE][BUFFER_MESSAGE_LENGTH];
33         int head;
34         int tail;
35         char message_level[BUFFER_SIZE];
36 }buffer; 
37 #include "error_handler.h"              /*include this for the debug level*/
38
39
40 void print_buffer(buffer *p_Buffer,int number_of_messages_to_print);            /*print messages in the buffer*/ 
41 /*wrapper functions for add_to_buffer_root_function*/
42 void add_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
43 void append_to_buffer(buffer *p_Buffer, char *message,char message_level,char print);
44 void add_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
45 void append_int_to_buffer(buffer *p_Buffer, int num,char message_level,char print);
46
47 void add_to_buffer_root_function(buffer *p_Buffer, char *message,char message_level,char append,char print);
48 #endif