Skip to content
Snippets Groups Projects
Commit 27545311 authored by Pelech, Ondřej's avatar Pelech, Ondřej
Browse files

Replace utils.h

parent 7d490e19
No related branches found
No related tags found
No related merge requests found
/*******************************************************************
Header for utils.c
File filled with utility methods
authors: Pelech Ondrej, Pham Thi Thien Trang
date: Mai 2023
*******************************************************************/
#ifndef __UTILS_H__
#define __UTILS_H__
#include <stdlib.h>
#include <stdbool.h>
#define INF 2147483647
#define INF 0Xffffffff
#define INF_SHORT 0xffff
// prints info messagse in format "INFO:'msg'"
// prints info messagse to stderr in format "INFO:'msg'"
void info(const char *str);
// prints error messagse in format "ERROR:'msg'"
// prints error messagse to stderr in format "ERROR:'msg'"
void error(const char *str);
// prints debug messagse in format "DEBUG:'msg'"
// prints debug messagse to stderr in format "DEBUG:'msg'"
void debug(const char *str);
// prints warning messagse in format "WARN:'msg'"
// prints warning messagse to stderr in format "WARN:'msg'"
void warn(const char *str);
// prints str with a new line to stdout
void println(const char *str);
//prints error quote and exits program is r is false
void my_assert(bool r, const char *fcname, const int line, const char *flname);
// allocates mem of the input size
// takes care of malloc failiure
// takes care of malloc failiure by exiting program
void* my_malloc(const size_t size);
// returns bigger value of inputed nunmbers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment