github.com/gotranspile/cxgo@v0.3.7/libs/semaphore.go (about)

     1  package libs
     2  
     3  const (
     4  	semaphoreH = "semaphore.h"
     5  )
     6  
     7  func init() {
     8  	RegisterLibrary(semaphoreH, func(c *Env) *Library {
     9  		return &Library{
    10  			// TODO
    11  			Header: `
    12  #include <` + BuiltinH + `>
    13  #include <` + timeH + `>
    14  
    15  typedef struct {} sem_t;
    16  
    17  int    sem_close(sem_t *);
    18  int    sem_destroy(sem_t *);
    19  int    sem_getvalue(sem_t *, int *);
    20  int    sem_init(sem_t *, int, unsigned);
    21  sem_t *sem_open(const char *, int, ...);
    22  int    sem_post(sem_t *);
    23  int    sem_timedwait(sem_t *, const struct timespec *);
    24  int    sem_trywait(sem_t *);
    25  int    sem_unlink(const char *);
    26  int    sem_wait(sem_t *);
    27  `,
    28  		}
    29  	})
    30  }