Index: trunk/libs/mini-libc/stdlib.h
===================================================================
--- trunk/libs/mini-libc/stdlib.h	(revision 443)
+++ trunk/libs/mini-libc/stdlib.h	(revision 444)
@@ -25,13 +25,13 @@
 #define _STDLIB_H
 
-#define   RAND_MAX   65535
-  
-/*********************************************************************************************
- * This function tests the <expression> argument value. 
- * When the value is false, it displays an error message, and terminates the calling thread.
- *********************************************************************************************
- * @ expression : Boolean expression to be checked.
- ********************************************************************************************/
-void assert( int expression ); 
+#include <almos-mkh/stdlib.h>
+
+/***************************************************************************************** 
+ * This function terminates a process.
+ *****************************************************************************************
+ * @ status   : terminaison status : 0 / EXIT_SUCCESS / EXIT_FAILURE.
+ ****************************************************************************************/
+void exit( int status );
+
 
 /*********************************************************************************************
@@ -46,71 +46,4 @@
  ********************************************************************************************/
 double atof(const char *str);
-
-/*********************************************************************************************
- * This function copies the content of a <src> byte array to a <dst> byte array.
- * Behaviour is undefined if <src> and <dst> arrays overlap.
- *********************************************************************************************
- * @ dst     : pointer on destination array.
- * @ dst     : pointer on source array.
- * @ size    : number of bytes to move.
- * @ return first argument.
- ********************************************************************************************/
-void * memcpy( void         * dst, 
-               const void   * src,
-               unsigned int   size );
-
-/*********************************************************************************************
- * This function fill a byte array with a byte value.
- *********************************************************************************************
- * @ dst     : pointer on the byte array.
- * @ s       : byte value (will be casted to unsigned char).
- * @ size    : number of bytes to be set.
- * @ return first argument.
- ********************************************************************************************/
-void * memset( void        * dst,
-               int           s, 
-               unsigned int  size);
-
-/*********************************************************************************************
- * This function writes a formated string to the standard "stdout" stream.
- *********************************************************************************************
- * @ returns number of characters written if success / returns -1 if failure.
- ********************************************************************************************/
-int printf( const char * format, ... );
-
-/*********************************************************************************************
- * This function returns a positive integer fom the standard "stdin" stream.
- *********************************************************************************************
- * returns the integer value if success / returns -1 if failure.
- ********************************************************************************************/
-int getint();
-
-/*********************************************************************************************
- * This function writes one single character to the standard "stdout" stream.
- *********************************************************************************************
- * @ returns written character code if success / returns 0 (EOF) if failure.
- ********************************************************************************************/
-int putchar( int c );
-
-/*********************************************************************************************
- * This function returns one single character from the standard "stdin" stream.
- *********************************************************************************************
- * @ returns read character code if success / returns 0 (EOF) if failure.
- ********************************************************************************************/
-int getchar();
-
-/*********************************************************************************************
- * This function copies a formated string to a fixed size buffer. 
- * it includes the NUL terminating character. 
- * it cheks that the formated string fit in the buffer length.
- *********************************************************************************************
- * @ string    :  pointer on target buffer.
- * @ length    : max bumber of characters in target buffer.
- * @ format    : formated string.
- * @ returns number of characters written if success / returns -1 if failure.
- ********************************************************************************************/
-int snprintf( char         * string,
-              unsigned int   length,
-              const char   * format, ... );
 
 /*********************************************************************************************
@@ -130,19 +63,49 @@
 int rand();
 
-/*********************************************************************************************
- * This blocking function implements an user-level interactive debugger that can be
- * introduced in any user application to display various kernel distributed structures
- * related to the calling process. The supported commands are:
- * - p (cxy)     : display all processes descriptors in a given cluster.
- * - s (cxy,lid) : display all threads attached to a given core in a given cluster.
- * - v (cxy)     : display the calling process VMM in a given cluster.
- * - t (tid)     : display all owner process descriptors attached to a given TXT terminal.
- * - x           : force the calling process to exit.
- * - c           : continue calling process execution.
- *********************************************************************************************
- * @ return an integer value between 0 and RAND_MAX.
- ********************************************************************************************/
-void idbg();
+/*****************************************************************************************
+ * This function allocates <size> bytes of memory in user space and returns a pointer
+ * on the allocated buffer. The physical memory is allocated from store located in 
+ * the calling core cluster.
+ *****************************************************************************************
+ * @ size    : number of requested bytes.
+ * @ returns a pointer on the allocated buffer if success / returns NULL if failure
+ ****************************************************************************************/
+void * malloc( unsigned int size );
 
 
+/*****************************************************************************************
+ * This function releases the memory buffer identified by the <ptr> argument,
+ * to the store located in the calling core cluster.
+ * It displays an error message, but does nothing if the ptr is illegal.
+ *****************************************************************************************
+ * @ ptr   : pointer on the released buffer.
+ ****************************************************************************************/
+void free( void * ptr );
+
+/*****************************************************************************************
+ * This function releases the memory buffer identified by the <ptr> argument,
+ * to the store located in the calling core cluster, and allocates a new buffer
+ * containing <size> bytes from this store. 
+ * The content of the old buffer is copied to the new buffer, up to <size> bytes.
+ * It displays an error message, but does nothing if the ptr is illegal.
+ *****************************************************************************************
+ * @ ptr   : pointer on the released buffer.
+ * @ size  : new buffer requested size (bytes).
+ * @ return a pointer on allocated buffer if success / return NULL if failure
+ ****************************************************************************************/
+void * realloc( void        * ptr,
+                unsigned int  size );
+
+
+/*****************************************************************************************
+ * This function allocates enough space for <count> objects that are <size> bytes
+ * of memory each from the store located in the calling core cluster.
+ * The allocated memory is filled with bytes of value zero.
+ *****************************************************************************************
+ * @ count   : number of requested objects.
+ * @ size    : number of bytes per object.
+ * @ returns a pointer on allocated buffer if success / returns NULL if failure
+ ****************************************************************************************/
+void * calloc( unsigned int count,
+               unsigned int size );
 #endif  // _STDLIB_H_
