-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathEngine.h
More file actions
97 lines (76 loc) · 3.43 KB
/
Copy pathEngine.h
File metadata and controls
97 lines (76 loc) · 3.43 KB
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
90
91
92
93
94
95
96
97
/*################################################################################################
<Magic Cube transforma um arquivo em seis matrizes alocadas na memoria, tendo como principio
o cubo magico, executa rotaçoes de forma criptografar o arquivo, a saida e um arquivo encriptado
que possui como chave a sequencia de desembaralhamento reversa que foi executada.>>
Copyright (C) 2013 Willian.A.Mayan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
################################################################################################*/
/*####################################################################################
# engine.h -> old version -> Rubik.h
# Autor: Willian.A.Mayan
# Data: 02-03-2013
# Versao: 0.0.4
####################################################################################*/
#ifndef _ENGINE_H_
#define _ENGINE_H_
//My structs
/*##################################
Estrutura da matriz dinamica
Limite de numeros:
linhas:
colunas:
##################################*/
typedef struct Matrix{
char **matrix;
long long int rows;
long long int columns;
}Matrix;
/*##################################
Estrutura que contem seis(6) ponteiros
para matrizes dinamicas, cada ponteiro
representa um lado referenciando uma
matriz de bytes de um arquivo.
*##################################*/
typedef struct Cubic
{
Matrix *Side_A;
Matrix *Side_B;
Matrix *Side_C;
Matrix *Side_D;
Matrix *Side_E;
Matrix *Side_F;
}Cubic;
//My Functions
//##################################
/*Funç~ao que recebe os parametros passado pelo usuario e realiza testes*/
int treatment(int argc, char **argv);
/*Funç~ao que calcula o tamanho do arquivo em bytes, recebe o nome do arquivo como parametro*/
long file_size(char *argv); //============> mudar argv para n_arquivo
/*Funç~ao que recebe um valor como parametro e calcula a quantidade de bytes para uma matriz quadrada perfeita*/
int calculate_matrix(long valor); /*Revis~ao realizada em 23 fev 2013*/
/*Falta documentar - imprime matriz*/
void showMatrix(Matrix *matriz);
/*Imprime as faces do cubo*/
void showCubic(Cubic *cubicRF);
/*Criaçao da matriz dinamica*/
Matrix* init(const int row, const int column);
/*Limpa matrizes alocadas*/
void _delete(Matrix *matrix);
/*Limpa estrutura de cubo alocado na memoria*/
void _delete_cubic(Cubic *cubo);
/*Funç~ao para preenchimento da matriz - Rever conceitos - Criar preenchimento recursivo*/
void P_Matriz(long long int rows, long long int columns, Matrix *_matriz, char *argv); //============> mudar argv para n_arquivo
/*Funç~ao para alocaç~ao de memoria do cubo*/
Cubic* cubicX(long long int ordem, char *argv);
/*Funç~ao que preenche matrizes recebendo um ponteiro para o arquivo, retorna um ponteiro de arquivo*/
FILE* P_cubicX(FILE *pointer, Matrix *matriX, long long int ordem);
#endif /* _ENGINE_H_ */