Skip to content

Commit

Permalink
add macro.h header
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncaen committed Sep 1, 2023
1 parent 3a43ee2 commit b74bf7f
Show file tree
Hide file tree
Showing 27 changed files with 176 additions and 111 deletions.
2 changes: 2 additions & 0 deletions bin/xbps-alternatives/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#include <xbps.h>

#include "macro.h"

static void __attribute__((noreturn))
usage(bool fail)
{
Expand Down
17 changes: 10 additions & 7 deletions bin/xbps-checkvers/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@
*
*/

#include <sys/stat.h>

#include <assert.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <getopt.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <dirent.h>
#include <limits.h>
#include <sys/stat.h>
#include <assert.h>

#include <xbps.h>

#include "macro.h"

#define GOT_PKGNAME_VAR 0x1
#define GOT_VERSION_VAR 0x2
#define GOT_REVISION_VAR 0x4
Expand Down
27 changes: 15 additions & 12 deletions bin/xbps-create/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,30 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <stdio.h>
#include <sys/types.h>

#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <ftw.h>
#include <getopt.h>
#include <libgen.h>
#include <locale.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stdarg.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#include <getopt.h>
#include <ftw.h>
#include <fcntl.h>
#include <libgen.h>
#include <locale.h>
#include <dirent.h>

#include <xbps.h>

#include "macro.h"
#include "queue.h"

#ifdef __clang__
Expand Down
24 changes: 14 additions & 10 deletions bin/xbps-fbulk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,26 @@
*/
#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <dirent.h>
#include <assert.h>
#include <libgen.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>

#include <sys/file.h>
#include <sys/stat.h>
#include <sys/wait.h>

#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <libgen.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include <xbps.h>

#include "macro.h"
#include "uthash.h"

#ifndef __arraycount
Expand Down
2 changes: 2 additions & 0 deletions bin/xbps-install/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#include <getopt.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

static void __attribute__((noreturn))
usage(bool fail)
Expand Down
7 changes: 5 additions & 2 deletions bin/xbps-install/state_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <assert.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

int
state_cb(const struct xbps_state_cb_data *xscd, void *cbdata UNUSED)
Expand Down
9 changes: 6 additions & 3 deletions bin/xbps-pkgdb/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
*/

#include <sys/param.h>
#include <stdio.h>

#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

static int
pkgdb_cb(struct xbps_handle *xhp UNUSED,
Expand Down
9 changes: 2 additions & 7 deletions bin/xbps-pkgdb/check_pkg_unneeded.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#include <sys/param.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

/*
* Checks package integrity of an installed package.
Expand Down
7 changes: 4 additions & 3 deletions bin/xbps-pkgdb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <errno.h>
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>

#include <xbps.h>

#include "defs.h"

static void __attribute__((noreturn))
Expand Down
10 changes: 7 additions & 3 deletions bin/xbps-query/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@
*/

#include <sys/types.h>
#include <stdio.h>

#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <assert.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

struct list_pkgver_cb {
unsigned int pkgver_len;
Expand Down
5 changes: 3 additions & 2 deletions bin/xbps-query/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <errno.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <errno.h>

#include <xbps.h>

#include "defs.h"

static void __attribute__((noreturn))
Expand Down
14 changes: 8 additions & 6 deletions bin/xbps-query/ownedby.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fnmatch.h>
#include <dirent.h>
#include <assert.h>
#include <regex.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

struct ffdata {
bool rematch;
Expand Down
16 changes: 9 additions & 7 deletions bin/xbps-query/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@

#include "compat.h"

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <libgen.h>
#include <fnmatch.h>
#include <assert.h>
#include <libgen.h>
#include <limits.h>
#include <regex.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

struct search_data {
bool regex, repo_mode;
Expand Down
8 changes: 5 additions & 3 deletions bin/xbps-reconfigure/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <syslog.h>
#include <unistd.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

static void __attribute__((noreturn))
usage(bool fail)
Expand Down
12 changes: 7 additions & 5 deletions bin/xbps-remove/clean-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#include <dirent.h>
#include <limits.h>

#include <xbps.h>

#include "defs.h"
#include "macro.h"

static int
binpkg_parse(char *buf, size_t bufsz, const char *path, const char **pkgver, const char **arch)
Expand Down
14 changes: 8 additions & 6 deletions bin/xbps-remove/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <signal.h>
#include <assert.h>
#include <unistd.h>
#include <getopt.h>
#include <syslog.h>
#include <unistd.h>

#include <xbps.h>

#include "../xbps-install/defs.h"
#include "defs.h"
#include "macro.h"

static void __attribute__((noreturn))
usage(bool fail)
Expand Down
Loading

0 comments on commit b74bf7f

Please sign in to comment.