mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
include/: refactor header files more
This commit is contained in:
parent
53266a0d5a
commit
4d1363dcae
32 changed files with 130 additions and 78 deletions
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* Very simple C buffer implementation
|
||||
* Very simple C string buffer implementation
|
||||
*
|
||||
* Copyright Johan Malm 2020
|
||||
*/
|
||||
|
||||
#ifndef BUF_H
|
||||
#define BUF_H
|
||||
#ifndef __LABWC_BUF_H
|
||||
#define __LABWC_BUF_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -17,7 +17,18 @@ struct buf {
|
|||
int len;
|
||||
};
|
||||
|
||||
/*
|
||||
* buf_init - allocate NULL-terminated C string buffer
|
||||
* @s - buffer
|
||||
* Note: use free(s->buf) to free it.
|
||||
*/
|
||||
void buf_init(struct buf *s);
|
||||
|
||||
/*
|
||||
* buf_add - add data to C string buffer
|
||||
* @s - buffer
|
||||
* @data - data to be added
|
||||
*/
|
||||
void buf_add(struct buf *s, const char *data);
|
||||
|
||||
#endif /* BUF_H */
|
||||
#endif /* __LABWC_BUF_H */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
#ifndef __LABWC_BUG_ON_H
|
||||
#define __LABWC_BUG_ON_H
|
||||
|
||||
/*
|
||||
* BUG_ON - assert() without abort()
|
||||
* @condition - expression to be evaluated
|
||||
*/
|
||||
#define BUG_ON(condition) \
|
||||
do { \
|
||||
if ((condition) != 0) { \
|
||||
|
|
@ -9,5 +13,4 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* __LABWC_BUT_ON_H */
|
||||
|
||||
#endif /* __LABWC_BUG_ON_H */
|
||||
|
|
|
|||
10
include/common/spawn.h
Normal file
10
include/common/spawn.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef __LABWC_SPAWN_H
|
||||
#define __LABWC_SPAWN_H
|
||||
|
||||
/**
|
||||
* spawn_async_no_shell - execute asyncronously
|
||||
* @command: command to be executed
|
||||
*/
|
||||
void spawn_async_no_shell(char const *command);
|
||||
|
||||
#endif /* __LABWC_SPAWN_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue