Buchempfehlung
Visual Basic 6 Kochbuch
Visual Basic 6 Kochbuch
Viele praktische Tipps zum Programmieren mit Visual Basic 6, die sich oft auch auf FB übertragen lassen. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

X11_shm.bi

Uploader:MitgliedThePuppetMaster
Datum/Zeit:09.03.2016 14:33:56

'##############################################################################################################################################################
'##############################################################################################################################################################
'### EWH4 - V:4.00.0 - R:0
'##############################################################################################################################################################
'##############################################################################################################################################################
'### Date of Idea:  2012.10.24 - 22:37:52
'### Autor:         DeltaLab's Germany [Experimental Computing]
'###                Martin Wiemann
'### Contact:       FreeBasic@DeltaLabs.de   /   Info@DeltaLabs.de   /   IRC://DeltaLabs.de/#mln
'### Licence:       Tu was du nicht lassen kannst, solange du hiermit nicht mehr Geld verdienst als ich.
'##############################################################################################################################################################
'##############################################################################################################################################################



'##############################################################################################################################################################
#include once "crt.bi"
#inclib "Xext"



'##############################################################################################################################################################
Type ShmSeg as UInteger
Type XShmSegmentInfo
    shmseg      as ShmSeg
    shmid       as Integer
    shmaddr     as byte Ptr
    readOnly    as Integer
End Type



'##############################################################################################################################################################
Type ipc_perm
    __key       as __key_t
    uid         as __uid_t
    gid         as __gid_t
    cuid        as __uid_t
    cgid        as __gid_t
    mode        as UShort
    __pad1      as UShort
    __seq       as UShort
    __pad2      as UShort
    __unused1   as UInteger
    __unused2   as UInteger
End Type



'##############################################################################################################################################################
Type shmatt_t   as UInteger



'##############################################################################################################################################################
Type shmid_ds
    shm_perm    as ipc_perm
    shm_segsz   as size_t
    shm_atime   as __time_t
    __unused1   as UInteger
    shm_dtime   as __time_t
    __unused2   as UInteger
    shm_ctime   as __time_t
    __unused3   as UInteger
    shm_cpid    as __pid_t
    shm_lpid    as __pid_t
    shm_nattch  as shmatt_t
    __unused4   as UInteger
    __unused5   as UInteger
End Type



'##############################################################################################################################################################
#define IPC_RMID            &H0
#define IPC_SET             &H1
#define IPC_STAT            &H2
#define SHM_SIZE            &H6

#define IPC_CREAT           &H200
#define IPC_EXCL            &H400
#define SHM_TS_NP           &H10000
#define SHM_RESIZE_NP       &H40000
#define SHM_MAP_FIXED_NP    &H100000



'##############################################################################################################################################################
extern "c"
    declare function shmctl(byval __shmid as integer, byval __cmd as integer, byval __buf as shmid_ds Ptr) as integer
    declare function shmget(byval __key as integer, byval __size as integer, byval __shmflg as integer) as integer
    declare function shmat(byval __shmid as integer, byval __shmaddr as byte Ptr, byval __shmflg as integer) as any ptr
    declare function shmdt(byval __shmaddr as byte Ptr) as integer
end extern

declare function XShmQueryExtension cdecl alias "XShmQueryExtension"(byval lpDisplay as Display ptr) as XBOOLEAN
declare function XShmQueryVersion cdecl alias "XShmQueryVersion"(byval lpDisplay as Display ptr, byval major as integer ptr, byval minor as integer ptr, byval pixmaps as XBOOLEAN ptr) as integer
declare function XShmCreateImage cdecl alias "XShmCreateImage"(byval lpDisplay as Display ptr, byval visual as VISUAL ptr, byval depth as integer, byval format as integer, byval offset as integer, byval shminfo as XShmSegmentInfo ptr, byval w as uinteger, byval height as uinteger) as XImage ptr
declare function XShmAttach cdecl alias "XShmAttach"(byval lpDisplay as Display ptr, byval shminfo as XShmSegmentInfo ptr) as Integer
declare function XShmDetach cdecl alias "XShmDetach"(byval lpDisplay as Display ptr, byval shminfo as XShmSegmentInfo ptr) as Integer
declare function XShmPutImage cdecl alias "XShmPutImage"(byval lpDisplay as Display ptr, byval d as DRAWABLE, byval gc as GCONTEXT, byval image as XIMAGE ptr, byval src_x as integer, byval src_y as integer, byval des_x as integer, byval des_y as integer, byval width as uinteger, byval height as uinteger, byval height as XBOOLEAN) as integer
declare function XShmGetEventBase cdecl alias "XShmGetEventBase"(byval lpDisplay as Display ptr) as Integer