summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorleo <leo@azuminha.com>2024-04-03 15:16:39 -0300
committerleo <leo@azuminha.com>2024-04-03 15:16:39 -0300
commit6a564da0f9c510c0222b05ba5da18c6ef73e8030 (patch)
treeba76677e1ce186cc31b31d3a04749b2c9889f625 /main.c
map implementado
Diffstat (limited to 'main.c')
-rw-r--r--main.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..0f0d650
--- /dev/null
+++ b/main.c
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "include/map.h"
+
+#define EXT_ERR_PARAMS 1
+int main(int argc, char *argv[]){
+ string_map special_char = init_map(1024);
+
+ insert_map("aa", "aa", special_char);
+ insert_map("d", "d", special_char);
+
+ char *test = get_value("aa", special_char);
+ printf("%s\n", test);
+ test = get_value("d", special_char);
+ printf("%s\n", test);
+ test = get_value("d", special_char);
+ printf("%s\n", test);
+ test = get_value("aa", special_char);
+ printf("%s\n", test);
+ /*
+ if(argc != 2){
+ fprintf(stderr, "passe o nome do arquivo\n");
+ exit(EXT_ERR_PARAMS);
+ }
+
+ char *file_path = argv[1];
+ FILE *fp = fopen(file_path, "r");
+
+ char tmp;
+ while(fscanf(fp, "%c", &tmp) != EOF){
+ printf("%c", tmp);
+ }
+
+ fclose(fp);
+ */
+ return 0;
+}