Index: trunk/libs/libalmosmkh/almosmkh.h
===================================================================
--- trunk/libs/libalmosmkh/almosmkh.h	(revision 650)
+++ trunk/libs/libalmosmkh/almosmkh.h	(revision 657)
@@ -2,5 +2,5 @@
  * almosmkh.h - User level ALMOS-MKH specific library definition.
  * 
- * Author     Alain Greiner (2016,2017,2018,2019)
+ * Author     Alain Greiner (2016,2017,2018,2019,2020)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -29,9 +29,12 @@
  * - non standard system calls.
  * - debug functions.
- * - remote malloc extensions. 
+ * - remote malloc extensions.
+ * - a parallel_pthread_create function.
+ * - Frame Buffer access syscalls.
  **************************************************************************************/
 
 #include <pthread.h>
 #include <shared_almos.h>
+
 
 /****************** Non standard (ALMOS_MKH specific) system calls ********************/
@@ -138,10 +141,25 @@
 
 /***************************************************************************************
- * This syscall returns an unsigned 32 bits integer from the standard "stdin" stream.
+ * This syscall returns an 32 bits integer from the standard "stdin" stream.
+ * The value is copied in buffer pointed by the <buf> argument
  * Both decimal numbers and hexadecimal numbers (prefixed by 0x) are supported.
  ***************************************************************************************
- * returns the integer value if success / returns -1 if failure.
- **************************************************************************************/
-unsigned int get_uint32( void );
+ * @ buffer    : pointer on buffer.
+ * @ returns 0 if success / returns -1 if failure.
+ **************************************************************************************/
+int get_uint32( unsigned int * buffer );
+
+/***************************************************************************************
+ * This syscall returns a character string from the standard "stdin" stream.
+ * The string is copied in buffer pointed by the <string> argument. 
+ * The string length (including the NUL terminating character) cannot be larger
+ * than the size defined by the <size> argument.
+ ***************************************************************************************
+ * @ string   : pointer on the string buffer.
+ * @ maxlen   : max number of bytes in string buffer.
+ * @ returns 0 if success / returns -1 if failure.
+ **************************************************************************************/
+int get_string( char * string,
+                int    maxlen );
 
 
@@ -278,14 +296,16 @@
 
 /*************************************************************************************** 
- * This debug syscall displays on the kernel terminal TXT0 the content of one given
- * page of the FAT mapper.
- * It can be called by any thread running in any cluster.
- ***************************************************************************************
- * @ page_id    : page index in file.
- * @ nb_entries : number of bytes to display.
+ * This debug syscall displays on the kernel terminal TXT0 the content of <nb_slots>
+ * of the FAT mapper, starting from <min_slot>.
+ * If <nb_slots> is zero, it displays the state of the FATFS context in cluster
+ * defined by the <min_slot> argument interpreted as a cluster identifier.
+ * It can be called by any thread running in any cluster.
+ ***************************************************************************************
+ * @ min_slot   : first slot in page
+ * @ nb_slots   : number of slots to display.
  * @ return 0 if success / return -1 if page not found.
  **************************************************************************************/
-int display_fat( unsigned int page_id,
-                 unsigned int nb_entries );
+int display_fat( unsigned int min_slot,
+                 unsigned int nb_slots );
 
 /***************************************************************************************** 
@@ -551,6 +571,4 @@
 
 
-
-
 /********* Non standard (ALMOS-MKH specific) Frame Buffer access syscalls   *************/
 
@@ -562,10 +580,11 @@
 
 /*****************************************************************************************
- * This function returns in the <width> and <height> arguments the buffer size.
+ * This function returns in the <width>, <height> and <type> arguments 
+ * the implementation specific frame buffer features.
  *****************************************************************************************
  * @ width   : [out] number of pixels per line.
  * @ height  : [out] number of lines.
  * @ type    : [out] pixel encoding type.
- * @ returns 0 if success / returns -1 if error.
+ * @ returns 0 if success / returns -1 if not found.
  ****************************************************************************************/
 int fbf_get_config( unsigned int * width,
@@ -574,11 +593,101 @@
 
 /*****************************************************************************************
- * This blocking function moves <length> bytes from the frame buffer, starting 
- * from <offset>, to the user buffer defined by <buffer> argument.
+ * This function creates a new window defined by the <l_zero>, <p_zero>, <nlines>,
+ * and <npixels> arguments for the calling process, and register the process PID, the
+ * allocated <wid>, and the window size and coordinates in the FBF device descriptor.
+ * It returns in the output argument <buffer> the pointer on the buffer associated to
+ * the window, mapped in user space.
+ * Warning : Both pixel [p_zero,l_zero] and pixel [p_zero+npixels-1,l_zero+nlines-1]
+ * must be contained in the frame buffer.
+ *****************************************************************************************
+ * @ l_zero  : [in]  first line index in FBF coordinates system.
+ * @ p_zero  : [in]  first pixel index in FBF coordinates system.
+ * @ nlines  : [in]  number of lines in the window.
+ * @ npixels : [in]  number of pixels per line in the window.
+ * @ buffer  : [out] pointer on 
+ * @ returns <wid> if success / returns -1 if illegal size or coordinates.
+ ****************************************************************************************/
+int fbf_create_window( unsigned int   l_zero,
+                       unsigned int   p_zero,
+                       unsigned int   nlines,
+                       unsigned int   npixels,
+                       void        ** buffer );
+
+/*****************************************************************************************
+ * This function deletes an existing window, identified by the <wid> argument.
+ * The calling process must be the window owner.
+ *****************************************************************************************
+ * @ wid     : window identifier.
+ * @ returns 0 if success / returns -1 if not found or process not owner.
+ ****************************************************************************************/
+int fbf_delete_window( unsigned int  wid );
+
+/*****************************************************************************************
+ * This function refreshes in FBF all lines of a window identified by the <wid> argument,
+ * when the line index is in the interval [line_first,line_last[.
+ * It scans all registered windows to take into account the windows overlap.
+ *****************************************************************************************
+ * @ wid        : window identifier.
+ * @ line_first : first line index.
+ * @ line_last  : last line index (excluded).
+ * @ returns 0 if success / returns -1 if illegal argument.
+ ****************************************************************************************/
+int fbf_refresh_window( unsigned int   wid,
+                        unsigned int   line_first,
+                        unsigned int   line_last );
+
+/*****************************************************************************************
+ * This function changes the size of a window identified by the <wid> argument as defined
+ * by the <width> and height> arguments. The calling process must be the window owner.
+ * WARNING : Both pixel [p_zero,l_zero] and pixel [p_zero+width-1,l_zero+height-1]
+ * must be contained in the frame buffer.
+ *****************************************************************************************
+ * @ wid     : window identifier.
+ * @ width   : number of pixels in line (one byte per pixel).
+ * @ height  : number of lines in window.
+ * @ returns 0 if success / returns -1 if illegal arguments.
+ ****************************************************************************************/
+int fbf_resize_window( unsigned int   wid,
+                       unsigned int   width,
+                       unsigned int   height );
+
+/*****************************************************************************************
+ * This function changes the <l_zero> & <p_zero> coordinates of a window identified
+ * by the <wid> argument. The calling process must be the window owner.
+ * WARNING : Both pixel [p_zero,l_zero] and pixel [p_zero+width-1,l_zero+height-1]
+ * must be contained in the frame buffer.
+ *****************************************************************************************
+ * @ wid     : window identifier.
+ * @ l_zero  : new first line index in FBF.
+ * @ p_zero  : new first pixel index in FBF.
+ * @ returns 0 if success / returns -1 if illegal arguments.
+ ****************************************************************************************/
+int fbf_move_window( unsigned int  wid,
+                     unsigned int  l_zero,
+                     unsigned int  p_zero );
+
+/*****************************************************************************************
+ * This syscall is deprecated (january 2020 AG)
+ * This blocking function moves <length> pixels from the user buffer defined by <buffer>
+ * argument to the frame buffer, starting at <offset> in FBF.
  *****************************************************************************************
  * @ buffer  : pointer on buffer in user space.
  * @ length  : number of pixels (one byte per pixel).
- * @ offset  : first pixel index in frame buffer.
- * @ returns 0 if success / returns -1 if error.
+ * @ offset  : first pixel index in window.
+ * @ returns 0 if success / returns -1 if illegal arguments.
+ ****************************************************************************************/
+int fbf_write( void         * buffer,
+               unsigned int   length,
+               unsigned int   offset );
+
+/*****************************************************************************************
+ * This syscall is deprecated (january 2020 AG)
+ * This blocking function moves <length> pixels from the frame buffer, starting at 
+ * <offset> in FBF, to the user buffer defined by <buffer>  argument.
+ *****************************************************************************************
+ * @ buffer  : pointer on buffer in user space.
+ * @ length  : number of pixels (one byte per pixel).
+ * @ offset  : first pixel index in window.
+ * @ returns 0 if success / returns -1 if illegal arguments.
  ****************************************************************************************/
 int fbf_read( void         * buffer,
@@ -586,16 +695,4 @@
               unsigned int   offset );
 
-/*****************************************************************************************
- * This blocking function moves <length> bytes from the user buffer defined by <buffer>
- * argument to the frame buffer, starting at <offset> in frame buffer.
- *****************************************************************************************
- * @ buffer  : pointer on buffer in user space.
- * @ length  : number of pixels (one byte per pixel).
- * @ offset  : first pixel index in frame buffer.
- * @ returns 0 if success / returns -1 if error.
- ****************************************************************************************/
-int fbf_write( void         * buffer,
-               unsigned int   length,
-               unsigned int   offset );
 
 #endif /* _LIBALMOSMKH_H_ */
