Make IWYU happy

This commit is contained in:
Davidson Francis 2024-07-16 22:53:12 -03:00
parent 40c6355b5e
commit 25bc29f174
9 changed files with 15 additions and 33 deletions

View File

@ -4,19 +4,9 @@
*/ */
#define _POSIX_C_SOURCE 200809L #define _POSIX_C_SOURCE 200809L
#include <errno.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdarg.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <netdb.h>
#include "alertik.h" #include "alertik.h"
#include "events.h" #include "events.h"

View File

@ -6,8 +6,6 @@
#ifndef ALERTIK_H #ifndef ALERTIK_H
#define ALERTIK_H #define ALERTIK_H
#include <stdarg.h>
#include <stdlib.h>
#include <time.h> #include <time.h>
#define MIN(a,b) (((a)<(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b))

View File

@ -7,7 +7,10 @@
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include "log.h"
#include "env_events.h" #include "env_events.h"
#include "alertik.h" #include "alertik.h"
#include "notifiers.h" #include "notifiers.h"

View File

@ -6,8 +6,6 @@
#ifndef ENV_EVENTS_H #ifndef ENV_EVENTS_H
#define ENV_EVENTS_H #define ENV_EVENTS_H
#include "events.h"
#define MAX_ENV_EVENTS 16 #define MAX_ENV_EVENTS 16
struct env_event { struct env_event {

5
log.c
View File

@ -3,18 +3,15 @@
* This is free and unencumbered software released into the public domain. * This is free and unencumbered software released into the public domain.
*/ */
#include <ctype.h>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h>
#include "events.h" #include "events.h"
#include "log.h" #include "log.h"

5
log.h
View File

@ -6,7 +6,10 @@
#ifndef LOG_H #ifndef LOG_H
#define LOG_H #define LOG_H
#include "events.h" #include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
struct log_event;
/* Uncomment/comment to enable/disable the following settings. */ /* Uncomment/comment to enable/disable the following settings. */
// #define USE_FILE_AS_LOG /* stdout if commented. */ // #define USE_FILE_AS_LOG /* stdout if commented. */

View File

@ -3,14 +3,12 @@
* This is free and unencumbered software released into the public domain. * This is free and unencumbered software released into the public domain.
*/ */
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <stdlib.h>
#include <time.h>
#include <curl/curl.h> #include <curl/curl.h>
#include "log.h"
#include "notifiers.h" #include "notifiers.h"
#include "alertik.h" #include "alertik.h"

View File

@ -3,22 +3,15 @@
* This is free and unencumbered software released into the public domain. * This is free and unencumbered software released into the public domain.
*/ */
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <time.h>
#include "events.h"
#include "log.h" #include "log.h"
#include "syslog.h" #include "syslog.h"

View File

@ -6,6 +6,8 @@
#ifndef SYSLOG_H #ifndef SYSLOG_H
#define SYSLOG_H #define SYSLOG_H
struct log_event;
#define FIFO_MAX 64 #define FIFO_MAX 64
#define SYSLOG_PORT 5140 #define SYSLOG_PORT 5140