Initial commit

This commit is contained in:
Gwen Gourevich
2021-10-27 10:34:18 +02:00
parent 43ad18eb04
commit c5f4f6ba25
199 changed files with 73169 additions and 0 deletions

48
LIB386/LIB_SYS/LOADMALL.C Normal file
View File

@@ -0,0 +1,48 @@
/*
MALLOC (c) Adeline 1993
Functions:
- Malloc
- Free
- Mshrink
*/
#include <i86.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include "adeline.h"
#include "lib_sys.h"
ULONG LoadMallocFileSize ;
/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
void *LoadMalloc( char *name )
{
LONG handle ;
ULONG sizer ;
void *pt ;
LoadMallocFileSize = FileSize( name ) ;
if ( !LoadMallocFileSize ) return( 0 ) ;
pt = Malloc( LoadMallocFileSize ) ;
if ( pt == 0 ) return( 0 ) ;
handle = OpenRead( name ) ;
if ( !handle) return( 0 ) ;
sizer = Read( handle, pt, LoadMallocFileSize );
if ( sizer != LoadMallocFileSize )
{
Close( handle ) ;
return( 0 );
}
Close( handle ) ;
return( pt ) ;
}
/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/