*/
#include "includes.h"
+#include "lib/util/bitmap.h"
/* these functions provide a simple way to allocate integers from a
pool without repetition */
if (!bm) return NULL;
bm->n = n;
- bm->b = talloc_zero_array(bm, uint32, (n+31)/32);
+ bm->b = talloc_zero_array(bm, uint32_t, (n+31)/32);
if (!bm->b) {
TALLOC_FREE(bm);
return NULL;
int count = MIN(dst->n, src->n);
SMB_ASSERT(dst->b != src->b);
- memcpy(dst->b, src->b, sizeof(uint32)*((count+31)/32));
+ memcpy(dst->b, src->b, sizeof(uint32_t)*((count+31)/32));
return count;
}
--- /dev/null
+/*
+ Unix SMB/CIFS implementation.
+ simple bitmap functions
+ Copyright (C) Andrew Tridgell 1992-1998
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/* The following definitions come from lib/bitmap.c */
+
+struct bitmap {
+ uint32_t *b;
+ unsigned int n;
+};
+
+struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n);
+int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src);
+bool bitmap_set(struct bitmap *bm, unsigned i);
+bool bitmap_clear(struct bitmap *bm, unsigned i);
+bool bitmap_query(struct bitmap *bm, unsigned i);
+int bitmap_find(struct bitmap *bm, unsigned ofs);
deps='tdb_compat talloc samba-util',
private_library=True,
local_include=False
- )
+ )
+
+bld.SAMBA_LIBRARY('bitmap',
+ source='bitmap.c',
+ deps='talloc samba-util',
+ local_include=False,
+ private_library=True)
lib/username.o \
../libds/common/flag_mapping.o \
lib/access.o lib/smbrun.o \
- lib/bitmap.o ../lib/util/dprintf.o $(UTIL_REG_OBJ) \
+ ../lib/util/bitmap.o ../lib/util/dprintf.o $(UTIL_REG_OBJ) \
lib/wins_srv.o lib/string_init.o \
lib/util_str.o ../lib/util/util_str_common.o \
../lib/util/util_str.o \
bool get_audit_category_from_param(const char *param, uint32 *audit_category);
const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32 policy);
-/* The following definitions come from lib/bitmap.c */
-
-struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n);
-int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src);
-bool bitmap_set(struct bitmap *bm, unsigned i);
-bool bitmap_clear(struct bitmap *bm, unsigned i);
-bool bitmap_query(struct bitmap *bm, unsigned i);
-int bitmap_find(struct bitmap *bm, unsigned ofs);
-
/* The following definitions come from lib/charcnv.c */
void gfree_charcnv(void);
uint32 unused_compatitibility_field;
};
-struct bitmap {
- uint32 *b;
- unsigned int n;
-};
-
/* offsets into message for common items */
#define smb_com 8
#define smb_rcls 9
#include "system/filesys.h"
#include "../libcli/security/security.h"
#include "../librpc/gen_ndr/ndr_security.h"
+#include "../lib/util/bitmap.h"
static NTSTATUS create_acl_blob(const struct security_descriptor *psd,
DATA_BLOB *pblob,
#include "auth.h"
#include "ntioctl.h"
#include "lib/param/loadparm.h"
+#include "lib/util/bitmap.h"
static int vfs_full_audit_debug_level = DBGC_VFS;
#include "smb_signing.h"
#include "dbwrap.h"
#include "smbldap.h"
+#include "../lib/util/bitmap.h"
#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#include "passdb.h"
#include "../libcli/auth/libcli_auth.h"
#include "../libcli/security/security.h"
+#include "../lib/util/bitmap.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
#include "includes.h"
#include "smbd/smbd.h"
#include "smbd/globals.h"
+#include "lib/util/bitmap.h"
/* The connections bitmap is expanded in increments of BITMAP_BLOCK_SZ. The
* maximum size of the bitmap is the largest positive integer, but you will hit
#include "smbd/smbd.h"
#include "smbd/globals.h"
#include "libcli/security/security.h"
+#include "lib/util/bitmap.h"
/*
This module implements directory related functions for Samba.
#include "libcli/security/security.h"
#include "util_tdb.h"
#include <ccan/hash/hash.h>
+#include "lib/util/bitmap.h"
#define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < real_max_open_files))
#include "../lib/tsocket/tsocket.h"
#include "../lib/util/tevent_ntstatus.h"
#include "smbprofile.h"
+#include "../lib/util/bitmap.h"
#define OUTVEC_ALLOC_SIZE (SMB2_HDR_BODY + 9)
deps='samba-util',
private_library=True)
-bld.SAMBA3_LIBRARY('bitmap',
- source='lib/bitmap.c',
- deps='samba-util',
- private_library=True)
-
bld.SAMBA3_LIBRARY('namearray',
source='lib/namearray.c',
deps='samba-util',