many cleanups (forgotten includes)
This commit is contained in:
@@ -56,11 +56,11 @@ int main(int argc,char* argv[]) {
|
||||
for (i=0; i<attribute_count; ++i) {
|
||||
uint32 j;
|
||||
uint32_unpack(x,&j);
|
||||
buffer_puts(buffer_1,map+j); buffer_putsflush(buffer_1,"\n");
|
||||
// buffer_puts(buffer_1,map+j); buffer_putsflush(buffer_1,"\n");
|
||||
if (!strcasecmp(map+j,"dn")) dn=j;
|
||||
if (!strcasecmp(map+j,"objectClass")) objectClass=j;
|
||||
if (!strcasecmp(map+j,argv[2])) {
|
||||
buffer_putsflush(buffer_2,"found attribute!\n");
|
||||
// buffer_putsflush(buffer_2,"found attribute!\n");
|
||||
wanted=j; casesensitive=x+attribute_count*4-map;
|
||||
uint32_unpack(map+casesensitive,&j);
|
||||
if (j) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "str.h"
|
||||
#include "uint32.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "str.h"
|
||||
#include "uint32.h"
|
||||
#include "bstr.h"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "asn1.h"
|
||||
#include "ldap.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include "buffer.h"
|
||||
#include "mmap.h"
|
||||
#include "uint32.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
extern char* map;
|
||||
extern long filelen;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "byte.h"
|
||||
#include "buffer.h"
|
||||
#include "asn1.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "byte.h"
|
||||
#include "buffer.h"
|
||||
#include "asn1.h"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "case.h"
|
||||
#include "ldif.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include "case.h"
|
||||
#include "ldif.h"
|
||||
|
||||
|
||||
@@ -11,5 +11,5 @@ typedef struct mduptable {
|
||||
mstorage_t table,strings;
|
||||
} mduptab_t;
|
||||
|
||||
const long mduptab_add(mduptab_t* t,const char* s,unsigned int len);
|
||||
const long mduptab_adds(mduptab_t* t,const char* s);
|
||||
long mduptab_add(mduptab_t* t,const char* s,unsigned int len);
|
||||
long mduptab_adds(mduptab_t* t,const char* s);
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "str.h"
|
||||
#include "bstr.h"
|
||||
#include "mstorage.h"
|
||||
#include "mduptab.h"
|
||||
#include "uint32.h"
|
||||
|
||||
const long mduptab_add(mduptab_t* t,const char* s,unsigned int len) {
|
||||
long mduptab_add(mduptab_t* t,const char* s,unsigned int len) {
|
||||
unsigned int i;
|
||||
unsigned long* l=(unsigned long*)t->table.root;
|
||||
static char zero;
|
||||
|
||||
@@ -1,26 +1,8 @@
|
||||
#include <stdlib.h>
|
||||
#include "str.h"
|
||||
#include <string.h>
|
||||
#include "mstorage.h"
|
||||
#include "mduptab.h"
|
||||
#include "bstr.h"
|
||||
|
||||
const long mduptab_adds(mduptab_t* t,const char* s) {
|
||||
long mduptab_adds(mduptab_t* t,const char* s) {
|
||||
return mduptab_add(t,s,strlen(s));
|
||||
}
|
||||
#if 0
|
||||
const long mduptab_adds(mduptab_t* t,const char* s) {
|
||||
unsigned int i;
|
||||
unsigned long* l=(unsigned long*)t->table.root;
|
||||
for (i=0; i<t->strings.used/sizeof(unsigned long); ++i)
|
||||
if (bstr_equal(t->strings.root+l[i],s))
|
||||
return l[i];
|
||||
{
|
||||
long x=mstorage_add(&t->strings,s,strlen(s)+1);
|
||||
if (mstorage_add(&t->table,(const char*)&x,sizeof(x))<0) {
|
||||
t->strings.used-=strlen(s)+1;
|
||||
return -1;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,7 @@ extern mstorage_t mstorage_root;
|
||||
/* Works like strstorage_add, but will return an
|
||||
* offset to mstorage_root, which is mmapped and may thus change. */
|
||||
/* negative offset == error */
|
||||
const long mstorage_add(mstorage_t* p,const char* s,unsigned long n);
|
||||
long mstorage_add(mstorage_t* p,const char* s,unsigned long n);
|
||||
|
||||
/* undo mapping */
|
||||
void mstorage_unmap(mstorage_t* p);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#define PAGEMASK ((PAGE_SIZE)-1)
|
||||
|
||||
const long mstorage_add(mstorage_t* p,const char* s,unsigned long n) {
|
||||
long mstorage_add(mstorage_t* p,const char* s,unsigned long n) {
|
||||
if (p->mapped-p->used<n) {
|
||||
if (!p->root) {
|
||||
/* nothing allocated. mmap /dev/zero */
|
||||
|
||||
1
parse.c
1
parse.c
@@ -3,6 +3,7 @@
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/shm.h>
|
||||
#include <stdlib.h>
|
||||
#include "buffer.h"
|
||||
#include "ldif.h"
|
||||
#include "mduptab.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "str.h"
|
||||
#include "strduptab.h"
|
||||
#include "strstorage.h"
|
||||
#include <string.h>
|
||||
|
||||
#define PAGESIZE 4096
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ static void fixup(struct Filter* f) {
|
||||
case NOT:
|
||||
if (f->x) fixup(f->x);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (f->next) fixup(f->next);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user