Apps: fixed 3 programs for using a long path in parameters
[kolibrios.git] / programs / KOSfuncs.inc
blob4c484ae25bfe5052841afc522f98f715c0f36bf9
1 \r
2 ; KolibriOS system functions:\r
3 SF_TERMINATE_PROCESS=-1\r
4 SF_CREATE_WINDOW=0      ; define and draw the window\r
5 SF_PUT_PIXEL=1          ; draw pixel to the window\r
6 SF_GET_KEY=2            ; get code of the pressed key\r
7 SF_GET_SYS_TIME=3\r
8 SF_DRAW_TEXT=4\r
9 SF_SLEEP=5              ; pause process\r
10 SF_PUT_IMAGE=7          ; draw image to the window\r
11 SF_DEFINE_BUTTON=8      ; define/delete the button\r
12 SF_THREAD_INFO=9        ; information on execution thread\r
13 SF_WAIT_EVENT=10        ; wait for event\r
14 SF_CHECK_EVENT=11       ; check for event and return\r
15 SF_REDRAW=12\r
16   SSF_BEGIN_DRAW=1\r
17   SSF_END_DRAW=2\r
18 SF_DRAW_RECT=13         ; draw rectangle to the window\r
19 SF_GET_SCREEN_SIZE=14   ; get screen resolution\r
20 SF_BACKGROUND_SET=15    ; work with desktop background graphics\r
21   SSF_SIZE_BG=1         ; set a size of the background image\r
22   SSF_PIXEL_BG=2        ; put pixel on the background image\r
23   SSF_REDRAW_BG=3       ; redraw background\r
24   SSF_MODE_BG=4         ; set drawing mode for the background\r
25   SSF_IMAGE_BG=5        ; put block of pixels on the background image\r
26   SSF_MAP_BG=6          ; map background image to the address space of the process\r
27   SSF_UNMAP_BG=7        ; close mapped background data\r
28   SSF_LAST_DRAW=8       ; get coordinates of the last draw to the background\r
29   SSF_REDRAW_RECT=9     ; redraws a rectangular part of the background\r
30 SF_RD_TO_FLOPPY=16      ; save ramdisk on the floppy\r
31 SF_GET_BUTTON=17        ; get ID of the pressed button\r
32 SF_SYSTEM=18\r
33   SSF_UNFOCUS_WINDOW=1          ; take focus from the window of the given thread\r
34   SSF_TERMINATE_THREAD=2        ; terminate process/thread by the slot number\r
35   SSF_FOCUS_WINDOW=3            ; give focus to the window of the given thread\r
36   SSF_GET_IDLE_COUNT=4          ; get counter of idle cycles per second\r
37   SSF_GET_CPU_FREQUENCY=5        ; get CPU clock rate\r
38   SSF_RD_TO_HDD=6               ; save ramdisk to the file on hard disk\r
39   SSF_GET_ACTIVE_WINDOW=7       ; get slot number of the active window\r
40   SSF_SPEAKER=8\r
41     SSSF_GET_STATE=1\r
42     SSSF_TOGGLE=2\r
43   SSF_SHUTDOWN=9                ; system shutdown/reboot\r
44   SSF_MINIMIZE_WINDOW=10        ; minimize active window\r
45   SSF_INFO_DISC_SYS=11          ; get disk subsystem information\r
46   SSF_KERNEL_VERSION=13         ; get kernel version\r
47   SSF_WAIT_RETRACE=14           ; wait for screen retrace\r
48   SSF_CURSOR_CENTER=15          ; center mouse cursor on the screen\r
49   SSF_GET_FREE_RAM=16           ; get size of free RAM\r
50   SSF_GET_TOTAL_RAM=17          ; get total amount of RAM\r
51   SSF_TERMINATE_THREAD_ID=18    ; Terminate process/thread by the ID\r
52   SSF_MOUSE_SETTINGS=19\r
53     SSSF_GET_SPEED=0\r
54     SSSF_SET_SPEED=1\r
55     SSSF_GET_SPEEDUP=2\r
56     SSSF_SET_SPEEDUP=3          ; set mouse acceleration\r
57     SSSF_SET_POS=4              ; set mouse pointer position\r
58     SSSF_SET_BUTTON=5           ; simulate state of mouse buttons\r
59     SSSF_GET_DOUBLE_CLICK_DELAY=6\r
60     SSSF_SET_DOUBLE_CLICK_DELAY=7\r
61   SSF_GET_RAM_INFO=20           ; get information on RAM\r
62   SSF_GET_THREAD_SLOT=21        ; get slot number of process/thread by the ID\r
63   SSF_FOREIGN_WINDOW=22         ; operations with window of another thread by slot/ID\r
64     SSSF_MINIMIZE=0\r
65     SSSF_MINIMIZE_ID=1\r
66     SSSF_RESTORE=2\r
67     SSSF_RESTORE_ID=3\r
68   SSF_MINIMIZE_ALL=23\r
69   SSF_SET_SCREEN_LIMITS=24\r
70   SSF_WINDOW_BEHAVIOR=25        ; window focus relation with other windows\r
71     SSSF_GET_WB=1\r
72     SSSF_SET_WB=2\r
73 SF_MIDI=20\r
74   SSF_RESET=1\r
75   SSF_OUTPUT=2\r
76 SF_SYSTEM_SET=21\r
77   SSF_MPU_MIDI_BASE=1\r
78   SSF_KEYBOARD_LAYOUT=2\r
79   SSF_SYS_LANG=5\r
80   SSF_ACCESS_HD_LBA=11  ; setting of low-level access to HD\r
81   SSF_ACCESS_PCI=12     ; setting of low-level access to PCI\r
82 SF_SET_TIME_DATE=22\r
83 SF_WAIT_EVENT_TIMEOUT=23; wait for event with timeout\r
84 SF_CD=24\r
85   SSF_EJECT_TRAY=4\r
86   SSF_INSERT_TRAY=5\r
87 SF_SCREEN_PUT_IMAGE=25  ; put image on the background layer\r
88 SF_SYSTEM_GET=26\r
89   ; Same as SF_SYSTEM_SET, plus:\r
90   SSF_TIME_COUNT=9\r
91   SSF_TIME_COUNT_PRO=10 ; get value of the high precision time counter\r
92 SF_GET_SYS_DATE=29\r
93 SF_CURRENT_FOLDER=30\r
94   SSF_SET_CF=1          ; set current folder for the thread\r
95   SSF_GET_CF=2\r
96   SSF_ADD_SYS_FOLDER=3  ; install the add.system directory for the kernel\r
97 SF_GET_PIXEL_OWNER=34   ; get slot number of the screen pixel owner\r
98 SF_GET_PIXEL=35         ; read the screen pixel color\r
99 SF_GET_IMAGE=36         ; read the screen area\r
100 SF_MOUSE_GET=37\r
101   SSF_SCREEN_POSITION=0\r
102   SSF_WINDOW_POSITION=1\r
103   SSF_BUTTON=2          ; states of the mouse buttons\r
104   SSF_BUTTON_EXT=3      ; states and events of the mouse buttons\r
105   SSF_LOAD_CURSOR=4\r
106   SSF_SET_CURSOR=5\r
107   SSF_DEL_CURSOR=6\r
108   SSF_SCROLL_DATA=7\r
109 SF_DRAW_LINE=38\r
110 SF_BACKGROUND_GET=39\r
111   ;SSF_SIZE_BG=1\r
112   ;SSF_PIXEL_BG=2\r
113   ;SSF_MODE_BG=4\r
114 SF_SET_EVENTS_MASK=40   ; turn on/off desired events\r
115 SF_PORT_IN_OUT=43       ; input/output to a port\r
116 SF_SET_PORTS=46         ; reserve/free a group of input/output ports\r
117 SF_DRAW_NUMBER=47       ; draw number to the window\r
118 SF_STYLE_SETTINGS=48\r
119   SSF_APPLY=0           ; apply screen settings\r
120   SSF_SET_BUTTON_STYLE=1\r
121   SSF_SET_COLORS=2\r
122   SSF_GET_COLORS=3      ; get standard window colors\r
123   SSF_GET_SKIN_HEIGHT=4\r
124   SSF_GET_SCREEN_AREA=5 ; get screen working area\r
125   SSF_SET_SCREEN_AREA=6\r
126   SSF_GET_SKIN_MARGINS=7\r
127   SSF_SET_SKIN=8\r
128   SSF_GET_FONT_SMOOTH=9\r
129   SSF_SET_FONT_SMOOTH=10\r
130   SSF_GET_FONT_SIZE=11\r
131   SSF_SET_FONT_SIZE=12\r
132 SF_APM=49\r
133 SF_SET_WINDOW_SHAPE=50\r
134 SF_CREATE_THREAD=51\r
135 SF_CLIPBOARD=54\r
136   SSF_GET_SLOT_COUNT=0  ; get the number of slots in the clipboard\r
137   SSF_READ_CB=1\r
138   SSF_WRITE_CB=2\r
139   SSF_DEL_SLOT=3        ; delete the last slot in the clipboard\r
140   SSF_UNLOCK_BUFFER=4   ; emergency buffer unlock\r
141 SF_SPEAKER_PLAY=55\r
142 SF_PCI_BIOS=57\r
143 SF_IPC=60               ; Inter Process Communication\r
144   SSF_SET_AREA=1        ; set area for IPC receiving\r
145   SSF_SEND_MESSAGE=2\r
146 SF_GET_GRAPHICAL_PARAMS=61\r
147   SSF_SCREEN_SIZE=1\r
148   SSF_BITS_PER_PIXEL=2\r
149   SSF_BYTES_PER_LINE=3\r
150 SF_PCI=62\r
151   SSF_GET_VERSION=0     ; get version of PCI-interface\r
152   SSF_GET_LAST_BUS=1    ; get number of the last PCI-bus\r
153   SSF_GET_ADRR_MODE=2   ; get addressing mode of the PCI configuration space\r
154   SSF_READ_BYTE=4\r
155   SSF_READ_WORD=5\r
156   SSF_READ_DWORD=6\r
157   SSF_WRITE_BYTE=8\r
158   SSF_WRITE_WORD=9\r
159   SSF_WRITE_DWORD=10\r
160 SF_BOARD=63\r
161   SSF_DEBUG_WRITE=1\r
162   SSF_DEBUG_READ=2\r
163 SF_MEMORY_RESIZE=64     ; resize total application memory\r
164 SF_PUT_IMAGE_EXT=65     ; draw image with palette to the window\r
165 SF_KEYBOARD=66\r
166   SSF_SET_INPUT_MODE=1\r
167   SSF_GET_INPUT_MODE=2\r
168   SSF_GET_CONTROL_KEYS=3; get status of control keys\r
169   SSF_SET_SYS_HOTKEY=4\r
170   SSF_DEL_SYS_HOTKEY=5\r
171   SSF_LOCK_INPUT=6      ; block normal input\r
172   SSF_UNLOCK_INPUT=7    ; restore normal input\r
173 SF_CHANGE_WINDOW=67     ; change position/sizes of the window\r
174 SF_SYS_MISC=68\r
175   SSF_GET_TASK_SWITCH_COUNT=0\r
176   SSF_SWITCH_TASK=1\r
177   SSF_PERFORMANCE=2\r
178     SSSF_ALLOW_RDPMC=0\r
179     SSSF_CACHE_STATUS=1\r
180     SSSF_CACHE_ON=2\r
181     SSSF_CACHE_OFF=3\r
182   SSF_READ_MSR=3\r
183   SSF_WRITE_MSR=4\r
184   SSF_HEAP_INIT=11\r
185   SSF_MEM_ALLOC=12\r
186   SSF_MEM_FREE=13\r
187   SSF_WAIT_SIGNAL=14    ; wait for signal from another program/driver\r
188   SSF_LOAD_DRIVER=16\r
189   SSF_CONTROL_DRIVER=17\r
190   SSF_LOAD_DLL=19\r
191   SSF_MEM_REALLOC=20\r
192   SSF_LOAD_DRIVER_PE=21\r
193   SSF_MEM_OPEN=22       ; open named memory area\r
194   SSF_MEM_CLOSE=23\r
195   SSF_SET_EXCEPTION_HANDLER=24\r
196   SSF_SET_EXCEPTION_STATE=25\r
197   SSF_MEM_FREE_EXT=26\r
198   SSF_LOAD_FILE=27\r
199 SF_DEBUG=69\r
200   SSF_SET_MESSAGE_AREA=0\r
201   SSF_GET_REGISTERS=1\r
202   SSF_SET_REGISTERS=2\r
203   SSF_DETACH=3\r
204   SSF_SUSPEND=4\r
205   SSF_RESUME=5\r
206   SSF_READ_MEMORY=6\r
207   SSF_WRITE_MEMORY=7\r
208   SSF_TERMINATE=8\r
209   SSF_DEFINE_BREAKPOINT=9\r
210 SF_FILE=70\r
211   SSF_READ_FILE=0\r
212   SSF_READ_FOLDER=1\r
213   SSF_CREATE_FILE=2\r
214   SSF_WRITE_FILE=3\r
215   SSF_SET_END=4\r
216   SSF_GET_INFO=5\r
217   SSF_SET_INFO=6\r
218   SSF_START_APP=7\r
219   SSF_DELETE=8\r
220   SSF_CREATE_FOLDER=9\r
221 SF_SET_CAPTION=71\r
222 SF_SEND_MESSAGE=72\r
223 SF_BLITTER=73\r
224 SF_NETWORK_DEVICE=74\r
225   SSF_DEVICE_COUNT=255  ; get number of active network devices\r
226   SSF_DEVICE_TYPE=0\r
227   SSF_DEVICE_NAME=1\r
228   SSF_RESET_DEVICE=2\r
229   SSF_STOP_DEVICE=3\r
230   SSF_DEVICE_POINTER=4\r
231   SSF_TX_PACKET_COUNT=6\r
232   SSF_RX_PACKET_COUNT=7\r
233   SSF_TX_BYTE_COUNT=8\r
234   SSF_RX_BYTE_COUNT=9\r
235   SSF_LINK_STATUS=10\r
236   SSF_TX_PACKET_ERROR_COUNT=11\r
237   SSF_TX_PACKET_DROP_COUNT=12\r
238   SSF_TX_PACKET_MISS_COUNT=13\r
239   SSF_RX_PACKET_ERROR_COUNT=14\r
240   SSF_RX_PACKET_DROP_COUNT=15\r
241   SSF_RX_PACKET_MISS_COUNT=16\r
242 SF_NETWORK_SOCKET=75\r
243   SSF_OPEN=0\r
244   SSF_CLOSE=1\r
245   SSF_BIND=2\r
246   SSF_LISTEN=3\r
247   SSF_CONNECT=4\r
248   SSF_ACCEPT=5\r
249   SSF_SEND=6\r
250   SSF_RECEIVE=7\r
251   SSF_SET_OPTIONS=8\r
252   SSF_GET_OPTIONS=9\r
253   SSF_SOCKET_PAIR=10\r
254 SF_NETWORK_PROTOCOL=76\r
255   SSF_ETHERNET_READ_MAC=0\r
256   SSF_IP4_PACKETS_SENT=10000h\r
257   SSF_IP4_PACKETS_RECEIVED=10001h\r
258   SSF_IP4_READ_IP=10002h\r
259   SSF_IP4_WRITE_IP=10003h\r
260   SSF_IP4_READ_DNS=10004h\r
261   SSF_IP4_WRITE_DNS=10005h\r
262   SSF_IP4_READ_SUBNET=10006h\r
263   SSF_IP4_WRITE_SUBNET=10007h\r
264   SSF_IP4_READ_GATEWAY=10008h\r
265   SSF_IP4_WRITE_GATEWAY=10009h\r
266   SSF_ICMP_PACKETS_SENT=20000h\r
267   SSF_ICMP_PACKETS_RECEIVED=20001h\r
268   SSF_ICMP_ECHO_REPLY=20003h\r
269   SSF_UDP_PACKETS_SENT=30000h\r
270   SSF_UDP_PACKETS_RECEIVED=30001h\r
271   SSF_TCP_PACKETS_SENT=40000h\r
272   SSF_TCP_PACKETS_RECEIVED=40001h\r
273   SSF_ARP_PACKETS_SENT=50000h\r
274   SSF_ARP_PACKETS_RECEIVED=50001h\r
275   SSF_ARP_GET_ENTRY_COUNT=50002h\r
276   SSF_ARP_READ_ENTRY=50003h\r
277   SSF_ARP_ADD_STATIC_ENTRY=50004h\r
278   SSF_ARP_DEL_ENTRY=50005h\r
279   SSF_ARP_SEND_ANNOUNCE=50006h\r
280   SSF_ARP_CONFLICTS_COUNT=50007h\r
281 SF_FUTEX=77\r
282   SSF_CREATE=0\r
283   SSF_DESTROY=1\r
284   SSF_WAIT=2\r
285   SSF_WAKE=3\r
287 ; File system errors:\r
288 FSERR_SUCCESS=0\r
289 FSERR_UNSUPPORTED=2\r
290 FSERR_UNKNOWN=3\r
291 FSERR_FILE_NOT_FOUND=5\r
292 FSERR_END_OF_FILE=6\r
293 FSERR_INVALID_BUFFER=7\r
294 FSERR_DISK_FULL=8\r
295 FSERR_FAIL=9\r
296 FSERR_ACCESS_DENIED=10\r
297 FSERR_DEVICE_FAIL=11\r
298 FSERR_OUT_OF_MEMORY=12\r