Skip to content

Commit

Permalink
poolmem: remove bareos.h include from mem_pool.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
arogge committed Dec 2, 2021
1 parent 387c475 commit 0c48fcb
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 7 deletions.
6 changes: 3 additions & 3 deletions core/src/include/baconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#ifndef BAREOS_INCLUDE_BACONFIG_H_
#define BAREOS_INCLUDE_BACONFIG_H_

#include <arpa/inet.h>
#include <string.h>

#include "lib/message.h"

/* Bareos common configuration defines */
Expand Down Expand Up @@ -602,9 +605,6 @@ int Getdomainname(char* name, int len);
# endif /* __cplusplus */
#endif /* HAVE_OSF1_OS */

/** Determine endianes */
static inline bool bigendian() { return htonl(1) == 1L; }

#ifndef __GNUC__
# define __PRETTY_FUNCTION__ __func__
#endif
Expand Down
6 changes: 6 additions & 0 deletions core/src/lib/bsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
#ifndef BAREOS_LIB_BSYS_H_
#define BAREOS_LIB_BSYS_H_

#include <stddef.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "mem_pool.h"
class JobControlRecord;


char* bstrinlinecpy(char* dest, const char* src);
char* bstrncpy(char* dest, const char* src, int maxlen);
Expand Down
6 changes: 5 additions & 1 deletion core/src/lib/mem_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@
*
* Kern E. Sibbald
*/
#include "lib/mem_pool.h"

#include <stdarg.h>
#include <string.h>

#include "include/bareos.h"
#include "lib/util.h"
#include "include/baconfig.h"

// Memory allocation control structures and storage.
struct abufhead {
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/mem_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <stdarg.h>
#include <string.h>
#include <include/bc_types.h>
#include "include/bc_types.h"

POOLMEM* GetPoolMemory(int pool);
POOLMEM* GetMemory(int32_t size);
Expand Down
1 change: 1 addition & 0 deletions core/src/lib/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#ifndef BAREOS_LIB_MESSAGE_H_
#define BAREOS_LIB_MESSAGE_H_

#include "include/bc_types.h"
#include "lib/bits.h"
#include "lib/dlink.h"
#include "lib/rwlock.h"
Expand Down
3 changes: 3 additions & 0 deletions core/src/lib/message_destination_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#ifndef BAREOS_LIB_MESSAGE_DESTINATION_INFO_H_
#define BAREOS_LIB_MESSAGE_DESTINATION_INFO_H_

#include <stdio.h>
#include <string>

#include "lib/message_severity.h"

enum class MessageDestinationCode : int
Expand Down
2 changes: 2 additions & 0 deletions core/src/lib/rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef BAREOS_LIB_RWLOCK_H_
#define BAREOS_LIB_RWLOCK_H_

#include <pthread.h>

typedef struct s_rwlock_tag {
pthread_mutex_t mutex;
pthread_cond_t read; /* wait for read */
Expand Down
5 changes: 4 additions & 1 deletion core/src/lib/serial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
Copyright (C) 2013-2018 Bareos GmbH & Co. KG
Copyright (C) 2013-2021 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -28,6 +28,9 @@
#include "include/bareos.h"
#include "serial.h"

/** Determine endianness */
static bool bigendian() { return htonl(1) == 1L; }

/*
NOTE: The following functions should work on any
Expand Down
4 changes: 3 additions & 1 deletion core/src/lib/util.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2018-2020 Bareos GmbH & Co. KG
Copyright (C) 2018-2021 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -21,6 +21,8 @@
#ifndef BAREOS_LIB_UTIL_H_
#define BAREOS_LIB_UTIL_H_

#include <sys/stat.h>

#include "lib/ascii_control_characters.h"
#include "lib/message.h"

Expand Down

0 comments on commit 0c48fcb

Please sign in to comment.