This repository has been archived by the owner on Feb 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buffer.h
89 lines (73 loc) · 3.1 KB
/
buffer.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef BUFFER_H
#define BUFFER_H
#include "producao.h"
#include "docente.h"
typedef struct _character{
//The actual text whitin
char data;
//Flag to tell if the char is int
int isNumber;
//Character next to cur
struct _character* next;
//Character previous to cur
struct _character* prev;
//Last character of this buffer
struct _character* last;
}character;
//A dictionary to see faster if a issn already happened
typedef struct _dictionary{
char* word; //it's issn
int value; //Value for its qualis
//next node
struct _dictionary* next;
//previous node
struct _dictionary* prev;
struct _dictionary* last;
}dictionary;
int baker(docente** docentes, producao** producoes, int* rules, character** orientacoes, character* congressos, character* periodicos, char* curso, const char* regrasNomeArquivo, int anoEntrada ,int anoSaida);
int qualisCodePeriodicosToInt(char* qualisCode ,int* rules);
int qualisCodeCongressosToInt(char* qualisCode ,int* rules);
int getPosQualisPeriodico(char* qualisCode);
int getPosQualisCongresso(char* qualisCode);
dictionary* memoization(dictionary* dictionaryToSearch, char* word);
void addDictionaryWord(dictionary** dictionaryToAdd, char* word, int value);
dictionary* createDictionary(char* word, int value);
void destroyDictionary(dictionary** dictionary);
void purgeDictionary(dictionary* dictionary);
character* copyBufferFile(character* bufferFile);
character* createChar(char data);
void destroyChar(character* charToDestroy);
void addChar(character** string, char data);
/*
* A file buffer is a entire file loaded on
* memory using the structure "character"
* witch is a double linked list of char.
*/
character* createBufferFile(const char* fileName);
void destroyBufferFile(character** bufferFile);
void printBufferFile(character* bufferFile);
character* removeFirstBufferLine(character** bufferFile);
character* find(character* bufferFile, char* string);
character* findNth(character* bufferFile, char* string, int nth);
character* concatenate(character** destination, character** stringToConcatenate);
int numberOfLinesBufferFile(character* congressosCSV);
char* bufferStringToString(character* string);
character* intToBufferString(int integer);
//Function to use whith .csv files
char* getNthColumnData(character* bufferFile, int position);
char* getNthColumnDataFromCur(character* bufferFile, int position);
char* getNthColumnDataCongresso(character* bufferFile, int position);
char* getNthColumnLocal(character* bufferFile);
char* getNthColumnLocalOrientacao(character* bufferFile, int collumn);
char* loadAreaAvaliacao(const char* filePath);
int* loadAllRules(const char* filePath,int rulesNum);
//Function to use with the "rules files"
int getRuleValue(character* bufferFile,char* qualis);
void convertToUpperCase(char** string);
long stringToLong(char* numberToConvert);
int stringToInt(char* numberToConvert);
char* convertToUpper(char* str);
char* clean(char* string);
char* clean2(char* string);
char* clean3(char* string);
#endif