Move most headers containing generic template classes out of kernel/util.
This follows on the move of BitUtils. Many of these headers were already used in userspace. Fixes #19849.
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
#include <../private/kernel/util/BumpAllocator.h>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include <../private/kernel/util/DoublyLinkedList.h>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include <../private/kernel/util/OpenHashTable.h>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include <../private/kernel/util/SinglyLinkedList.h>
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include <../private/util/BumpAllocator.h>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include <../private/util/DoublyLinkedList.h>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include <../private/util/OpenHashTable.h>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include <../private/util/SinglyLinkedList.h>
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
#ifndef HASH_MAP_H
|
#ifndef HASH_MAP_H
|
||||||
#define HASH_MAP_H
|
#define HASH_MAP_H
|
||||||
|
|
||||||
#include <OpenHashTable.h>
|
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
#include <util/OpenHashTable.h>
|
||||||
|
|
||||||
#include "AutoLocker.h"
|
#include "AutoLocker.h"
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
#ifndef HASH_SET_H
|
#ifndef HASH_SET_H
|
||||||
#define HASH_SET_H
|
#define HASH_SET_H
|
||||||
|
|
||||||
#include <OpenHashTable.h>
|
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
#include <util/OpenHashTable.h>
|
||||||
|
|
||||||
#include "AutoLocker.h"
|
#include "AutoLocker.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#include <../kernel/util/OpenHashTable.h>
|
|
||||||
@@ -11,9 +11,10 @@
|
|||||||
#include <lock.h>
|
#include <lock.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <util/SplayTree.h>
|
||||||
|
|
||||||
#include "DirectoryIterator.h"
|
#include "DirectoryIterator.h"
|
||||||
#include "exfat.h"
|
#include "exfat.h"
|
||||||
#include "SplayTree.h"
|
|
||||||
#include "Volume.h"
|
#include "Volume.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel file_systems exfat ;
|
SubDir HAIKU_TOP src add-ons kernel file_systems exfat ;
|
||||||
|
|
||||||
UsePrivateHeaders [ FDirName kernel util ] ;
|
|
||||||
UsePrivateHeaders shared storage ;
|
UsePrivateHeaders shared storage ;
|
||||||
UsePrivateHeaders file_systems ;
|
UsePrivateHeaders file_systems ;
|
||||||
UsePrivateKernelHeaders ;
|
UsePrivateKernelHeaders ;
|
||||||
@@ -16,4 +15,4 @@ KernelAddon exfat :
|
|||||||
;
|
;
|
||||||
|
|
||||||
SEARCH on [ FGristFiles DeviceOpener.cpp ]
|
SEARCH on [ FGristFiles DeviceOpener.cpp ]
|
||||||
= [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems shared ] ;
|
= [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems shared ] ;
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <StorageDefs.h>
|
#include <StorageDefs.h>
|
||||||
|
#include <util/SplayTree.h>
|
||||||
|
|
||||||
#include "exfat.h"
|
#include "exfat.h"
|
||||||
#include "SplayTree.h"
|
|
||||||
|
|
||||||
|
|
||||||
struct node_key {
|
struct node_key {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <image.h>
|
#include <image.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#include <kernel/util/DoublyLinkedList.h>
|
#include <util/DoublyLinkedList.h>
|
||||||
|
|
||||||
#include "FSCapabilities.h"
|
#include "FSCapabilities.h"
|
||||||
#include "Locker.h"
|
#include "Locker.h"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <fs_interface.h>
|
#include <fs_interface.h>
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
#include <kernel/util/DoublyLinkedList.h>
|
#include <util/DoublyLinkedList.h>
|
||||||
|
|
||||||
#include "FSCapabilities.h"
|
#include "FSCapabilities.h"
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,11 @@
|
|||||||
#define RTF_H
|
#define RTF_H
|
||||||
|
|
||||||
|
|
||||||
#include "Stack.h"
|
|
||||||
|
|
||||||
#include <List.h>
|
#include <List.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <GraphicsDefs.h>
|
#include <GraphicsDefs.h>
|
||||||
#include <BufferIO.h>
|
#include <BufferIO.h>
|
||||||
|
#include <util/Stack.h>
|
||||||
|
|
||||||
|
|
||||||
namespace RTF {
|
namespace RTF {
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
/* Stack - a template stack class
|
|
||||||
*
|
|
||||||
* Copyright 2001-2005, Axel Dörfler, [email protected].
|
|
||||||
* This file may be used under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
#ifndef STACK_H
|
|
||||||
#define STACK_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
|
||||||
|
|
||||||
|
|
||||||
template<class T> class Stack {
|
|
||||||
public:
|
|
||||||
Stack()
|
|
||||||
:
|
|
||||||
fArray(NULL),
|
|
||||||
fUsed(0),
|
|
||||||
fMax(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~Stack()
|
|
||||||
{
|
|
||||||
free(fArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsEmpty() const
|
|
||||||
{
|
|
||||||
return fUsed == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MakeEmpty()
|
|
||||||
{
|
|
||||||
// could also free the memory
|
|
||||||
fUsed = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
status_t Push(T value)
|
|
||||||
{
|
|
||||||
if (fUsed >= fMax) {
|
|
||||||
fMax += 16;
|
|
||||||
T *newArray = (T *)realloc(fArray, fMax * sizeof(T));
|
|
||||||
if (newArray == NULL)
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
fArray = newArray;
|
|
||||||
}
|
|
||||||
fArray[fUsed++] = value;
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Pop(T *value)
|
|
||||||
{
|
|
||||||
if (fUsed == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
*value = fArray[--fUsed];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
T *fArray;
|
|
||||||
int32 fUsed;
|
|
||||||
int32 fMax;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* STACK_H */
|
|
||||||
@@ -23,8 +23,6 @@
|
|||||||
|
|
||||||
#include <AutoDeleter.h>
|
#include <AutoDeleter.h>
|
||||||
|
|
||||||
#include "Stack.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define READ_BUFFER_SIZE 2048
|
#define READ_BUFFER_SIZE 2048
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include <kernel/util/DoublyLinkedList.h>
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
|
#include <util/DoublyLinkedList.h>
|
||||||
|
|
||||||
|
|
||||||
class BBitmap;
|
class BBitmap;
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
/* Stack - a template stack class (plus some handy methods)
|
|
||||||
*
|
|
||||||
* Copyright 2001-2005, Axel Dörfler, axeld@pinc-software.de.
|
|
||||||
* This file may be used under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
#ifndef KERNEL_UTIL_STACK_H
|
|
||||||
#define KERNEL_UTIL_STACK_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
template<class T> class Stack {
|
|
||||||
public:
|
|
||||||
Stack()
|
|
||||||
:
|
|
||||||
fArray(NULL),
|
|
||||||
fUsed(0),
|
|
||||||
fMax(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~Stack()
|
|
||||||
{
|
|
||||||
free(fArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsEmpty() const
|
|
||||||
{
|
|
||||||
return fUsed == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MakeEmpty()
|
|
||||||
{
|
|
||||||
// could also free the memory
|
|
||||||
fUsed = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
status_t Push(T value)
|
|
||||||
{
|
|
||||||
if (fUsed >= fMax) {
|
|
||||||
fMax += 16;
|
|
||||||
T *newArray = (T *)realloc(fArray, fMax * sizeof(T));
|
|
||||||
if (newArray == NULL)
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
fArray = newArray;
|
|
||||||
}
|
|
||||||
fArray[fUsed++] = value;
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Pop(T *value)
|
|
||||||
{
|
|
||||||
if (fUsed == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
*value = fArray[--fUsed];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
T *Array()
|
|
||||||
{
|
|
||||||
return fArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32 CountItems() const
|
|
||||||
{
|
|
||||||
return fUsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
T *fArray;
|
|
||||||
int32 fUsed;
|
|
||||||
int32 fMax;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* KERNEL_UTIL_STACK_H */
|
|
||||||
@@ -3,11 +3,11 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "SudokuSolver.h"
|
#include "SudokuSolver.h"
|
||||||
|
|
||||||
|
#include <util/Stack.h>
|
||||||
|
|
||||||
#include "SudokuField.h"
|
#include "SudokuField.h"
|
||||||
#include "Stack.h"
|
|
||||||
|
|
||||||
|
|
||||||
struct SolutionStep {
|
struct SolutionStep {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ SubDir HAIKU_TOP src kits media ;
|
|||||||
|
|
||||||
AddResources libmedia.so : libmedia.rdef ;
|
AddResources libmedia.so : libmedia.rdef ;
|
||||||
|
|
||||||
UsePrivateHeaders app media kernel shared ;
|
UsePrivateHeaders app media shared ;
|
||||||
UsePrivateHeaders [ FDirName media experimental ] ;
|
UsePrivateHeaders [ FDirName media experimental ] ;
|
||||||
UsePrivateHeaders [ FDirName interface ] ;
|
UsePrivateHeaders [ FDirName interface ] ;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#include <locks.h>
|
#include <locks.h>
|
||||||
#include <kernel/util/DoublyLinkedList.h>
|
#include <util/DoublyLinkedList.h>
|
||||||
|
|
||||||
|
|
||||||
//#define TRACE_RTM
|
//#define TRACE_RTM
|
||||||
|
|||||||
Reference in New Issue
Block a user