]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/d/dmd/root/stringtable.h
2 /* Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved
3 * http://www.digitalmars.com
4 * Distributed under the Boost Software License, Version 1.0.
5 * http://www.boost.org/LICENSE_1_0.txt
6 * https://github.com/dlang/dmd/blob/master/src/dmd/root/stringtable.h
12 #include "dcompat.h" // for d_size_t
16 // StringValue is a variable-length structure. It has neither proper c'tors nor a
17 // factory method because the only thing which should be creating these is StringTable.
22 char *lstring() { return (char *)(this + 1); }
24 size_t len() const { return length
; }
25 const char *toDchars() const { return (const char *)(this + 1); }
27 StringValue(); // not constructible
43 void _init(d_size_t size
= 0);
44 void reset(d_size_t size
= 0);
47 StringValue
*lookup(const char *s
, d_size_t len
);
48 StringValue
*insert(const char *s
, size_t len
, void *ptrvalue
);
49 StringValue
*update(const char *s
, d_size_t len
);
50 int apply(int (*fp
)(StringValue
*));
53 uint32_t allocValue(const char *p
, size_t length
, void *ptrvalue
);
54 StringValue
*getValue(uint32_t validx
);
55 size_t findSlot(hash_t hash
, const char *s
, size_t len
);