Skip to content

Commit

Permalink
compat: add compat.h header to get forward declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentbernat committed Dec 4, 2023
1 parent 80d5190 commit f2d5c6f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/compat/asprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
#include "compat.h"

#define INIT_SZ 128

Expand Down
1 change: 1 addition & 0 deletions src/compat/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "compat.h"

int
daemon(int nochdir, int noclose)
Expand Down
1 change: 1 addition & 0 deletions src/compat/getline.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "compat.h"

#define MINBUF 128

Expand Down
1 change: 1 addition & 0 deletions src/compat/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#undef malloc
#include <stdlib.h>
#include <sys/types.h>
#include "compat.h"

/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
Expand Down
1 change: 1 addition & 0 deletions src/compat/realloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#undef realloc
#include <stdlib.h>
#include <sys/types.h>
#include "compat.h"

/* Reallocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
Expand Down
2 changes: 2 additions & 0 deletions src/compat/setproctitle.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* -*- mode: c; c-file-style: "openbsd" -*- */

#include "compat.h"

void
setproctitle(const char *fmt, ...)
{
Expand Down
1 change: 1 addition & 0 deletions src/compat/strlcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <sys/types.h>
#include <string.h>
#include "compat.h"

/*
* Copy src to string dst of size siz. At most siz-1 characters
Expand Down
1 change: 1 addition & 0 deletions src/compat/strndup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <stdlib.h>
#include <string.h>
#include "compat.h"

/*
* Similar to `strdup()` but copies at most n bytes.
Expand Down
1 change: 1 addition & 0 deletions src/compat/strnlen.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* -*- mode: c; c-file-style: "openbsd" -*- */

#include <string.h>
#include "compat.h"

/*
* Determine the length of a fixed-size string. This is really a
Expand Down
1 change: 1 addition & 0 deletions src/compat/strtonum.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include "compat.h"

#define INVALID 1
#define TOOSMALL 2
Expand Down

0 comments on commit f2d5c6f

Please sign in to comment.