-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
41 lines (27 loc) · 919 Bytes
/
common.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
/*
* common.h
* Funciones auxiliares compartidas
*/
#ifndef common_h
#define common_h
#include <stdio.h> // FILE, fprintf(), fgetc(), ungetc(), etc.
#include <ctype.h> // isalpha(), isdigit(), isspace(), toupper(), tolower()
#include <string.h> // strcmp(), strcpy(), strlen()
#include <stdlib.h> // exit(), EXIT_SUCCESS
#include <signal.h> // signal()
#include <stdbool.h> // bool, true, false
extern FILE * fin, * fout, * ferr;
// Modos de compilación
enum {SCAN, PARSE, ASSEMBLE};
extern int compiler_mode;
typedef const char * string;
typedef enum {lowercase, uppercase} case_type;
void change_string_case(char * const, case_type);
bool strings_are_equal(string, string);
int find_string_in_array(string, string[]);
int find_char_in_string(char, string);
string string_from_int(int);
int int_from_string(string);
string wide_char_at(int, string);
bool file_exists(string);
#endif /* common_h */