-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprints.h
44 lines (36 loc) · 1.28 KB
/
prints.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef PRINTS_H
#define PRINTS_H
#define __STDC_WANT_LIB_EXT2__ 1 //Define you want TR 24731-2:2010 extensions
#include <math.h>
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
//#include "/home/pmorvalho/cbmc/src/ansi-c/library/stdlib.c"
//#include "/home/pmorvalho/cbmc/src/ansi-c/library/string.c"
#include <stdlib.h>
#include <string.h>
//#include "/home/pmorvalho/cbmc/src/ansi-c/library/stdio.c"
// Reverses a string 'str' of length 'len' starting at 'begin'
void reverse(char* str, int len, int starting_point);
// Converts a given integer x to string str[].
// d is the number of digits required in the output.
// If d is more than the number of digits in x,
// then 0s are added at the beginning.
int itoa(int x, char str[], int d);
// Converts a floating-point/double number to a string.
int ftoa(float n, char* res, int afterpoint);
// prints one char
int printChar(char* str, int offset, char c);
// prints a string
int printChars(char* str, int offset, const char* format);
// prints an integer
int printInt(char* str, int offset, int i);
// prints a float
int printFloat(char* str, int offset, float f);
// functions that introduce nondeterministic values in CBMC
int nondet_int();
char nondet_char();
float nondet_float();
bool nondet_bool();
#endif