summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/linux/platform.c21
-rw-r--r--src/platform.h1
-rw-r--r--src/string_utils.h1
-rw-r--r--src/windows/platform.c12
4 files changed, 31 insertions, 4 deletions
diff --git a/src/linux/platform.c b/src/linux/platform.c
index 0f2320d..5f48ea1 100644
--- a/src/linux/platform.c
+++ b/src/linux/platform.c
@@ -258,6 +258,19 @@ bool platform_directory_exists(char *path)
}
}
+
+s32 platform_get_file_size(char *path)
+{
+ FILE *file = fopen(path, "r");
+ if (!file) return -1;
+
+ fseek(file, 0 , SEEK_END);
+ int length = ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ return length;
+}
+
file_content platform_read_file_content(char *path, const char *mode)
{
file_content result;
@@ -596,7 +609,7 @@ static void create_key_tables(platform_window window)
XkbFreeKeyboard(desc, 0, True);
}
-CURL *curl;
+//CURL *curl;
inline void platform_init(int argc, char **argv)
{
#if 0
@@ -618,7 +631,7 @@ inline void platform_init(int argc, char **argv)
get_directory_from_path(buf, binary_path);
string_copyn(binary_path, buf, MAX_INPUT_LENGTH);
- curl = curl_easy_init();
+ //curl = curl_easy_init();
assets_create();
}
@@ -626,8 +639,8 @@ inline void platform_init(int argc, char **argv)
inline void platform_destroy()
{
assets_destroy();
- curl_easy_cleanup(curl);
- curl_global_cleanup();
+ //curl_easy_cleanup(curl);
+ //curl_global_cleanup();
#if defined(MODE_DEVELOPER)
memory_print_leaks();
diff --git a/src/platform.h b/src/platform.h
index 35ec81b..6a32212 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -175,6 +175,7 @@ void platform_window_swap_buffers(platform_window *window);
void platform_set_cursor(platform_window *window, cursor_type type);
void platform_window_set_title(platform_window *window, char *name);
file_content platform_read_file_content(char *path, const char *mode);
+s32 platform_get_file_size(char *path);
bool platform_write_file_content(char *path, const char *mode, char *buffer, s32 len);
void platform_destroy_file_content(file_content *content);
bool get_active_directory(char *buffer);
diff --git a/src/string_utils.h b/src/string_utils.h
index 32cdaf4..1c397f1 100644
--- a/src/string_utils.h
+++ b/src/string_utils.h
@@ -65,6 +65,7 @@ bool string_contains_ex(char *big, char *small, array *text_matches, bool *cance
void string_trim(char *string);
bool string_equals(char *first, char *second);
void string_append(char *buffer, char *text);
+bool string_is_asteriks(char *text);
void string_copyn(char *buffer, char *text, s32 bufferlen);
void string_appendn(char *buffer, char *text, s32 bufferlen);
void string_appendf(char *buffer, char *text);
diff --git a/src/windows/platform.c b/src/windows/platform.c
index 8c3abe7..3d6c7dd 100644
--- a/src/windows/platform.c
+++ b/src/windows/platform.c
@@ -780,6 +780,18 @@ void platform_window_swap_buffers(platform_window *window)
SwapBuffers(window->hdc);
}
+s32 platform_get_file_size(char *path)
+{
+ FILE *file = fopen(path, "r");
+ if (!file) return -1;
+
+ fseek(file, 0 , SEEK_END);
+ int length = ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ return length;
+}
+
file_content platform_read_file_content(char *path, const char *mode)
{
file_content result;