forked from KolibriOS/kolibrios
start work, but buggy
git-svn-id: svn://kolibrios.org@6727 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
ba50660e2b
commit
42c234aecf
@ -273,7 +273,7 @@ UNZIP_H = unzip.h unzpriv.h globals.h
|
|||||||
all: unzip$(EXE)
|
all: unzip$(EXE)
|
||||||
|
|
||||||
unzip$(EXE): $(OBJU) $(LIBBZIP2)
|
unzip$(EXE): $(OBJU) $(LIBBZIP2)
|
||||||
$(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS)
|
$(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.exe.map
|
||||||
kos32-objcopy $@ -O binary
|
kos32-objcopy $@ -O binary
|
||||||
|
|
||||||
unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X)
|
unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X)
|
||||||
|
@ -116,7 +116,7 @@ struct dirent* readdir(DIR *dirp)
|
|||||||
|
|
||||||
int rc = sf_file(1, &di); // read dir
|
int rc = sf_file(1, &di); // read dir
|
||||||
if(rc) {
|
if(rc) {
|
||||||
fprintf(stderr, "Error %d reading dir item %s", rc, dirp->entry.d_name);
|
fprintf(stderr, "Error %d reading dir item %s\n", rc, dirp->entry.d_name);
|
||||||
errno = rc;
|
errno = rc;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -144,20 +144,52 @@ void rewinddir(DIR *dirp)
|
|||||||
|
|
||||||
int mkdir(const char *_path, mode_t m)
|
int mkdir(const char *_path, mode_t m)
|
||||||
{
|
{
|
||||||
struct fs_dirinfo di;
|
char namebuffer[1050]; // need for save data after di!!!
|
||||||
memset(&di, 0, sizeof di);
|
struct fs_dirinfo *di = (struct fs_dirinfo *)namebuffer;
|
||||||
di.ppath = (char*)_path;
|
|
||||||
|
|
||||||
int rc = sf_file(9, &di); // creat dir
|
debug_board_printf("mkdir start (%s)\n", _path);
|
||||||
|
memset(di, 0, sizeof(struct fs_dirinfo));
|
||||||
|
//di.ppath = (char*)_path; // dont work with 70.9
|
||||||
|
strcpy(di->path, _path);
|
||||||
|
|
||||||
|
int rc = sf_file(9, di); // creat dir
|
||||||
if(rc) {
|
if(rc) {
|
||||||
fprintf(stderr, "Error %d creating dir item %s", rc, _path);
|
fprintf(stderr, "Error %d creating dir item %s\n", rc, _path);
|
||||||
errno = rc;
|
errno = rc;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug_board_printf("mkdir end (%s)\n", _path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void __attribute__ ((noinline)) debug_board_write_str(const char* str){
|
||||||
|
while(*str)
|
||||||
|
debug_board_write_byte(*str++);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __attribute__ ((noinline)) debug_board_printf(const char *format,...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
char log_board[300];
|
||||||
|
|
||||||
|
va_start (ap, format);
|
||||||
|
vsnprintf(log_board, sizeof log_board, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
debug_board_write_str(log_board);
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((noinline)) void trap(int n)
|
||||||
|
{
|
||||||
|
// nothing todo, just see n in debugger. use "bp trap" command
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"nop"
|
||||||
|
:
|
||||||
|
:"a"(n));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* tested example
|
/* tested example
|
||||||
void* read_folderdata(char* name)
|
void* read_folderdata(char* name)
|
||||||
|
@ -91,13 +91,9 @@ int mapattr(__G)
|
|||||||
|
|
||||||
|
|
||||||
/********************************************************************************************************************/
|
/********************************************************************************************************************/
|
||||||
/*** Function checkdir() */
|
/*** Function mapname() */
|
||||||
/********************************************************************************************************************/
|
/********************************************************************************************************************/
|
||||||
|
|
||||||
/************************/
|
|
||||||
/* Function mapname() */
|
|
||||||
/************************/
|
|
||||||
|
|
||||||
int mapname(__G__ renamed)
|
int mapname(__G__ renamed)
|
||||||
__GDEF
|
__GDEF
|
||||||
int renamed;
|
int renamed;
|
||||||
@ -212,7 +208,8 @@ int mapname(__G__ renamed)
|
|||||||
/* disable control character filter when requested,
|
/* disable control character filter when requested,
|
||||||
* else allow 8-bit characters (e.g. UTF-8) in filenames:
|
* else allow 8-bit characters (e.g. UTF-8) in filenames:
|
||||||
*/
|
*/
|
||||||
;
|
if ((isprint(workch) || (128 <= workch && workch <= 254)))
|
||||||
|
*pp++ = (char)workch;
|
||||||
/*kos
|
/*kos
|
||||||
if (uO.cflxflag ||
|
if (uO.cflxflag ||
|
||||||
(isprint(workch) || (128 <= workch && workch <= 254)))
|
(isprint(workch) || (128 <= workch && workch <= 254)))
|
||||||
@ -350,9 +347,10 @@ int mapname(__G__ renamed)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************/
|
/********************************************************************************************************************/
|
||||||
/* Function checkdir() */
|
/*** Function checkdir() */
|
||||||
/***********************/
|
/********************************************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
int checkdir(__G__ pathcomp, flag)
|
int checkdir(__G__ pathcomp, flag)
|
||||||
__GDEF
|
__GDEF
|
||||||
|
Loading…
Reference in New Issue
Block a user