added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / c / Unpack / support.c
blobca53fdc170f7f363b4fd945484f4d02aa97eba66
1 /*
2 Copyright © 2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <dos/dos.h>
9 #include <proto/dos.h>
11 #include "support.h"
13 BOOL MakeDir( CONST_STRPTR path )
15 BPTR lock = CreateDir( path );
17 if( lock != NULL )
19 UnLock( lock );
20 return TRUE;
23 return FALSE;
26 BOOL MakeDirs( STRPTR path )
28 STRPTR position;
29 BOOL success = FALSE;
30 BPTR lock = NULL;
32 for( position = path; *position != '\0'; position++ )
34 if( *position == '/' )
36 *position = '\0';
38 if( (lock = Lock( path, SHARED_LOCK )) != NULL )
40 UnLock( lock );
41 success = TRUE;
43 else
45 success = MakeDir( path );
48 *position = '/';
50 if( !success ) return FALSE;
54 return TRUE;