suballocator plus path fixes

git-svn-id: svn://kolibrios.org@7520 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl
2018-11-01 17:24:22 +00:00
parent da1718dca4
commit 2650f5831f
24 changed files with 514 additions and 2191 deletions

View File

@@ -73,21 +73,30 @@ void con_lib_link(struct import *exp, char** imports){
int con_init_console_dll(void)
{
return con_init_console_dll_param(-1, -1, -1, -1, con_caption);
}
int con_init_console_dll_param(dword wnd_width, dword wnd_height,
dword scr_width, dword scr_height, const char* title)
/* work as con_init_console_dll, but call con_init with params
*/
{
struct import * hDll;
if (__console_initdll_status == 1) return 0;
if((hDll = (struct import *)_ksys_cofflib_load(con_dllname)) == 0){
if((hDll = (struct import *)_ksys_cofflib_load(con_dllname)) == 0){
debug_out_str("can't load lib\n");
return 1;
}
con_lib_link(hDll, con_imports);
}
con_lib_link(hDll, con_imports);
con_init(-1, -1, -1, -1, con_caption); //__argv[0] && __path dont work
con_init(wnd_width, wnd_height, scr_width, scr_height, title);
__console_initdll_status = 1;
__console_initdll_status = 1;
return(0);
return 0;
}

View File

@@ -2,21 +2,28 @@
#include <string.h>
#include <stdlib.h>
int errno = 0;
/*
// removed by Seiemargl 26-oct-2018
// use get_current_folder() from kos32sys.h instead
extern char __argv;
extern char __path;
int errno = 0;
// convert relative to program path ./file.txt to absolute
const char* getfullpath(const char *path){
int relpath_pos, localpath_size;
char *programpath;
char *newpath;
char *prgname;
if (path[0] == '/') /* root */
if (path[0] == '/') //
{
return(strdup(path)); /* dup need as free in fclose() */
return(strdup(path)); // dup need as free in fclose()
}
relpath_pos = 0;
@@ -49,7 +56,7 @@ const char* getfullpath(const char *path){
return(newpath);
}
*/
FILE* fopen(const char* filename, const char *mode)
@@ -92,7 +99,8 @@ FILE* fopen(const char* filename, const char *mode)
if (*mode!=0)
return NULL;
fullname = (char*)getfullpath(filename);
// fullname = (char*)getfullpath(filename);
fullname = strdup(filename);
if ((imode & 3) == FILE_OPEN_READ && fullname) /* check existense */
{
sz = _ksys_get_filesize(fullname);