This mapping has 23 all-to-all groups: every node on one side corresponds to every node on the other, and none is deleted or inserted. Each member carries an all N:M badge; selecting one highlights all of its counterparts, in the tree and in the code view alike.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–1714 unchanged (1714 lines)
1715
1716 return 1;
1717}
1718
1719/* Compare entry pointer to by 'p' with string 's' of length 'slen'.
1720 * Return 1 if equal. */
1721unsigned int lpCompare(unsigned char *p, unsigned char *s, uint32_t slen) {
1722 unsigned char *value;
1723 int64_t sz;
1724 if (p[0] == LP_EOF) return 0;
1725
1726 value = lpGet(p, &sz, NULL);
1727 if (value) {
1728 return (slen == sz) && memcmp(value,s,slen) == 0;
1729 } else {
1730 /* We use lpStringToInt64() to get an integer representation of the
1731 * string 's' and compare it to 'sval', it's much faster than convert
1732 * integer to string and comparing. */
1733 int64_t sval;
1734 if (lpStringToInt64((const char*)s, slen, &sval))
1735 return sz == sval;
1736 }
1737
1738 return 0;
1739}
1740
1741/* uint compare for qsort */
…lines 1742–2135 unchanged (394 lines)
2136 while(p < len)
2137 target[p++] = minval+rand()%(maxval-minval+1);
2138 return len;
2139}
2140
2141static void verifyEntry(unsigned char *p, unsigned char *s, size_t slen) {
2142 assert(lpCompare(p, s, slen));
2143}
2144
2145static int lpValidation(unsigned char *p, unsigned int head_count, void *userdata) {
2146 UNUSED(p);
2147 UNUSED(head_count);
2148
2149 int ret;
2150 long *count = userdata;
2151 ret = lpCompare(p, (unsigned char *)mixlist[*count], strlen(mixlist[*count]));
2152 (*count)++;
2153 return ret;
2154}
2155
2156static int lpFindCbCmp(const unsigned char *lp, unsigned char *p, void *user, unsigned char *s, long long slen) {
2157 assert(lp);
…lines 2158–2535 unchanged (378 lines)
2536 }
2537
2538 TEST("Delete foo while iterating") {
2539 lp = createList();
2540 p = lpFirst(lp);
2541 while (p) {
2542 if (lpCompare(p, (unsigned char*)"foo", 3)) {
2543 lp = lpDelete(lp, p, &p);
2544 } else {
2545 p = lpNext(lp, p);
2546 }
2547 }
2548 lpFree(lp);
2549 }
2550
…lines 2551–2616 unchanged (66 lines)
2617 lpFree(lp);
2618 }
2619
2620 TEST("Compare strings with listpack entries") {
2621 lp = createList();
2622 p = lpSeek(lp,0);
2623 assert(lpCompare(p,(unsigned char*)"hello",5));
2624 assert(!lpCompare(p,(unsigned char*)"hella",5));
2625
2626 p = lpSeek(lp,3);
2627 assert(lpCompare(p,(unsigned char*)"1024",4));
2628 assert(!lpCompare(p,(unsigned char*)"1025",4));
2629 lpFree(lp);
2630 }
2631
2632 TEST("lpMerge two empty listpacks") {
2633 unsigned char *lp1 = lpNew(0);
2634 unsigned char *lp2 = lpNew(0);
…lines 2635–3248 unchanged (614 lines)
3249
3250 TEST("Benchmark lpCompare with string") {
3251 unsigned long long start = usec();
3252 for (int i = 0; i < 2000; i++) {
3253 unsigned char *eptr = lpSeek(lp,0);
3254 while (eptr != NULL) {
3255 lpCompare(eptr,(unsigned char*)"nothing",7);
3256 eptr = lpNext(lp,eptr);
3257 }
3258 }
3259 printf("Done. usec=%lld\n", usec()-start);
3260 }
3261
3262 TEST("Benchmark lpCompare with number") {
3263 unsigned long long start = usec();
3264 for (int i = 0; i < 2000; i++) {
3265 unsigned char *eptr = lpSeek(lp,0);
3266 while (eptr != NULL) {
3267 lpCompare(lp, (unsigned char*)"99999", 5);
3268 eptr = lpNext(lp,eptr);
3269 }
3270 }
3271 printf("Done. usec=%lld\n", usec()-start);
3272 }
3273
3274 lpFree(lp);
3275 }
3276
3277 return 0;
3278}
3279
3280#endif
3281

After

…lines 1–1714 unchanged (1714 lines)
1715
1716 return 1;
1717}
1718
1719/* Compare entry pointer to by 'p' with string 's' of length 'slen'.
1720 * Return 1 if equal. */
1721unsigned int lpCompare(unsigned char *p, unsigned char *s, uint32_t slen,
1722 long long *cached_longval, int *cached_valid) {
1723 unsigned char *value;
1724 int64_t sz;
1725 if (p[0] == LP_EOF) return 0;
1726
1727 value = lpGet(p, &sz, NULL);
1728 if (value) {
1729 return (slen == sz) && memcmp(value,s,slen) == 0;
1730 } else {
1731 int64_t sval;
1732 /* We use lpStringToInt64() to get an integer representation of the
1733 * string 's' and compare it to 'sval', it's much faster than convert
1734 * integer to string and comparing. */
1735 if (cached_valid != NULL) {
1736 /* Use caching */
1737 if (*cached_valid == 0) {
1738 if (lpStringToInt64((const char*)s, slen, (int64_t*)cached_longval)) {
1739 *cached_valid = 1;
1740 } else {
1741 *cached_valid = -1;
1742 }
1743 }
1744 return (*cached_valid == 1 && sz == *cached_longval);
1745 } else {
1746 /* No caching - direct conversion */
1747 if (lpStringToInt64((const char*)s, slen, &sval))
1748 return sz == sval;
1749 }
1750 }
1751
1752 return 0;
1753}
1754
1755/* uint compare for qsort */
…lines 1756–2149 unchanged (394 lines)
2150 while(p < len)
2151 target[p++] = minval+rand()%(maxval-minval+1);
2152 return len;
2153}
2154
2155static void verifyEntry(unsigned char *p, unsigned char *s, size_t slen) {
2156 assert(lpCompare(p, s, slen, NULL, NULL));
2157}
2158
2159static int lpValidation(unsigned char *p, unsigned int head_count, void *userdata) {
2160 UNUSED(p);
2161 UNUSED(head_count);
2162
2163 int ret;
2164 long *count = userdata;
2165 ret = lpCompare(p, (unsigned char *)mixlist[*count], strlen(mixlist[*count]), NULL, NULL);
2166 (*count)++;
2167 return ret;
2168}
2169
2170static int lpFindCbCmp(const unsigned char *lp, unsigned char *p, void *user, unsigned char *s, long long slen) {
2171 assert(lp);
…lines 2172–2549 unchanged (378 lines)
2550 }
2551
2552 TEST("Delete foo while iterating") {
2553 lp = createList();
2554 p = lpFirst(lp);
2555 while (p) {
2556 if (lpCompare(p, (unsigned char*)"foo", 3, NULL, NULL)) {
2557 lp = lpDelete(lp, p, &p);
2558 } else {
2559 p = lpNext(lp, p);
2560 }
2561 }
2562 lpFree(lp);
2563 }
2564
…lines 2565–2630 unchanged (66 lines)
2631 lpFree(lp);
2632 }
2633
2634 TEST("Compare strings with listpack entries") {
2635 lp = createList();
2636 p = lpSeek(lp,0);
2637 assert(lpCompare(p,(unsigned char*)"hello",5,NULL,NULL));
2638 assert(!lpCompare(p,(unsigned char*)"hella",5,NULL,NULL));
2639
2640 p = lpSeek(lp,3);
2641 assert(lpCompare(p,(unsigned char*)"1024",4,NULL,NULL));
2642 assert(!lpCompare(p,(unsigned char*)"1025",4,NULL,NULL));
2643 lpFree(lp);
2644 }
2645
2646 TEST("lpMerge two empty listpacks") {
2647 unsigned char *lp1 = lpNew(0);
2648 unsigned char *lp2 = lpNew(0);
…lines 2649–3262 unchanged (614 lines)
3263
3264 TEST("Benchmark lpCompare with string") {
3265 unsigned long long start = usec();
3266 for (int i = 0; i < 2000; i++) {
3267 unsigned char *eptr = lpSeek(lp,0);
3268 while (eptr != NULL) {
3269 lpCompare(eptr,(unsigned char*)"nothing",7,NULL,NULL);
3270 eptr = lpNext(lp,eptr);
3271 }
3272 }
3273 printf("Done. usec=%lld\n", usec()-start);
3274 }
3275
3276 TEST("Benchmark lpCompare with number") {
3277 unsigned long long start = usec();
3278 for (int i = 0; i < 2000; i++) {
3279 unsigned char *eptr = lpSeek(lp,0);
3280 while (eptr != NULL) {
3281 lpCompare(eptr, (unsigned char*)"99999", 5, NULL, NULL);
3282 eptr = lpNext(lp,eptr);
3283 }
3284 }
3285 printf("Done. usec=%lld\n", usec()-start);
3286 }
3287
3288 TEST("Benchmark lpCompare with number and caching") {
3289 unsigned long long start = usec();
3290 for (int i = 0; i < 2000; i++) {
3291 unsigned char *eptr = lpSeek(lp,0);
3292 long long cached_val = 0;
3293 int cached_valid = 0;
3294 while (eptr != NULL) {
3295 lpCompare(eptr, (unsigned char*)"99999", 5, &cached_val, &cached_valid);
3296 eptr = lpNext(lp,eptr);
3297 }
3298 }
3299 printf("Done. usec=%lld\n", usec()-start);
3300 }
3301
3302 lpFree(lp);
3303 }
3304
3305 return 0;
3306}
3307
3308#endif
3309

Before

translation_unit
comment "/* Listpack -- A lists of strings serialization format\n *\n *"...
preproc_include
#include "#include"
system_lib_string "<stdint.h>"
preproc_include
#include "#include"
system_lib_string "<limits.h>"
preproc_include
#include "#include"
system_lib_string "<sys/types.h>"
preproc_include
#include "#include"
system_lib_string "<stdlib.h>"
preproc_include
#include "#include"
system_lib_string "<string.h>"
preproc_include
#include "#include"
system_lib_string "<stdio.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "listpack.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "listpack_malloc.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "redisassert.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "util.h"
" "\""
preproc_def
#define "#define"
identifier "LP_HDR_SIZE"
preproc_arg "6 "
comment "/* 32 bit total len + 16 bit number of elements. */"
preproc_def
#define "#define"
identifier "LP_HDR_NUMELE_UNKNOWN"
preproc_arg "UINT16_MAX"
preproc_def
#define "#define"
identifier "LP_MAX_INT_ENCODING_LEN"
preproc_arg "9"
preproc_def
#define "#define"
identifier "LP_MAX_BACKLEN_SIZE"
preproc_arg "5"
preproc_def
#define "#define"
identifier "LP_ENCODING_INT"
preproc_arg "0"
preproc_def
#define "#define"
identifier "LP_ENCODING_STRING"
preproc_arg "1"
preproc_def
#define "#define"
identifier "LP_ENCODING_7BIT_UINT"
preproc_arg "0"
preproc_def
#define "#define"
identifier "LP_ENCODING_7BIT_UINT_MASK"
preproc_arg "0x80"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_7BIT_UINT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_7BIT_UINT_MASK)==LP_ENCODING_7BIT_UINT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_7BIT_UINT_ENTRY_SIZE"
preproc_arg "2"
preproc_def
#define "#define"
identifier "LP_ENCODING_6BIT_STR"
preproc_arg "0x80"
preproc_def
#define "#define"
identifier "LP_ENCODING_6BIT_STR_MASK"
preproc_arg "0xC0"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_6BIT_STR"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_6BIT_STR_MASK)==LP_ENCODING_6BIT_STR)"
preproc_def
#define "#define"
identifier "LP_ENCODING_13BIT_INT"
preproc_arg "0xC0"
preproc_def
#define "#define"
identifier "LP_ENCODING_13BIT_INT_MASK"
preproc_arg "0xE0"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_13BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_13BIT_INT_MASK)==LP_ENCODING_13BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_13BIT_INT_ENTRY_SIZE"
preproc_arg "3"
preproc_def
#define "#define"
identifier "LP_ENCODING_12BIT_STR"
preproc_arg "0xE0"
preproc_def
#define "#define"
identifier "LP_ENCODING_12BIT_STR_MASK"
preproc_arg "0xF0"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_12BIT_STR"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_12BIT_STR_MASK)==LP_ENCODING_12BIT_STR)"
preproc_def
#define "#define"
identifier "LP_ENCODING_16BIT_INT"
preproc_arg "0xF1"
preproc_def
#define "#define"
identifier "LP_ENCODING_16BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_16BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_16BIT_INT_MASK)==LP_ENCODING_16BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_16BIT_INT_ENTRY_SIZE"
preproc_arg "4"
preproc_def
#define "#define"
identifier "LP_ENCODING_24BIT_INT"
preproc_arg "0xF2"
preproc_def
#define "#define"
identifier "LP_ENCODING_24BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_24BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_24BIT_INT_MASK)==LP_ENCODING_24BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_24BIT_INT_ENTRY_SIZE"
preproc_arg "5"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_INT"
preproc_arg "0xF3"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_32BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_32BIT_INT_MASK)==LP_ENCODING_32BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_INT_ENTRY_SIZE"
preproc_arg "6"
preproc_def
#define "#define"
identifier "LP_ENCODING_64BIT_INT"
preproc_arg "0xF4"
preproc_def
#define "#define"
identifier "LP_ENCODING_64BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_64BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_64BIT_INT_MASK)==LP_ENCODING_64BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_64BIT_INT_ENTRY_SIZE"
preproc_arg "10"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_STR"
preproc_arg "0xF0"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_STR_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_32BIT_STR"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_32BIT_STR_MASK)==LP_ENCODING_32BIT_STR)"
preproc_def
#define "#define"
identifier "LP_EOF"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_6BIT_STR_LEN"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "((p)[0] & 0x3F)"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_12BIT_STR_LEN"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "((((p)[0] & 0xF) << 8) | (p)[1])"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_32BIT_STR_LEN"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "(((uint32_t)(p)[1]<<0) | \\\n "...
preproc_function_def
#define "#define"
identifier "lpGetTotalBytes"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "(((uint32_t)(p)[0]<<0) | \\\n "...
preproc_function_def
#define "#define"
identifier "lpGetNumElements"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "(((uint32_t)(p)[4]<<0) | \\\n "...
preproc_function_def
#define "#define"
identifier "lpSetTotalBytes"
preproc_params
( "("
identifier "p"
, ","
identifier "v"
) ")"
preproc_arg "do { \\\n (p)[0] = (v)&0xff; \\\n (p)[1] = ((v)>>8)&0xff; "...
preproc_function_def
#define "#define"
identifier "lpSetNumElements"
preproc_params
( "("
identifier "p"
, ","
identifier "v"
) ")"
preproc_arg "do { \\\n (p)[4] = (v)&0xff; \\\n (p)[5] = ((v)>>8)&0xff; "...
comment "/* Validates that 'p' is not outside the listpack.\n * All fu"...
preproc_function_def
#define "#define"
identifier "ASSERT_INTEGRITY"
preproc_params
( "("
identifier "lp"
, ","
identifier "p"
) ")"
preproc_arg "do { \\\n assert((p) >= (lp)+LP_HDR_SIZE && (p) < (lp)+lpGe"...
comment "/* Similar to the above, but validates the entire element le"...
preproc_function_def
#define "#define"
identifier "ASSERT_INTEGRITY_LEN"
preproc_params
( "("
identifier "lp"
, ","
identifier "p"
, ","
identifier "len"
) ")"
preproc_arg "do { \\\n assert((p) >= (lp)+LP_HDR_SIZE && (p)+(len) < (lp"...
declaration (+31 nodes collapsed)
comment "/* Don't let listpacks grow over 1GB in any case, don't wann"...
preproc_def
#define "#define"
identifier "LISTPACK_MAX_SAFETY_SIZE"
preproc_arg "(1<<30)"
function_definition (+58 nodes collapsed)
comment "/* Convert a string into a signed 64 bit integer.\n * The fun"...
function_definition (+488 nodes collapsed)
comment "/* Create a new, empty listpack.\n * On success the new listp"...
function_definition (+99 nodes collapsed)
comment "/* Free the specified listpack. */"
function_definition (+25 nodes collapsed)
comment "/* Generic version of lpFree. */"
function_definition (+32 nodes collapsed)
comment "/* Shrink the memory to fit. */"
function_definition (+70 nodes collapsed)
comment "/* Stores the integer encoded representation of 'v' in the '"...
function_definition (+803 nodes collapsed)
comment "/* Given an element 'ele' of size 'size', determine if the e"...
function_definition (+157 nodes collapsed)
comment "/* Store a reverse-encoded variable length field, representi"...
function_definition (+436 nodes collapsed)
comment "/* Calculate the number of bytes required to reverse-encode "...
function_definition (+98 nodes collapsed)
comment "/* Decode the backlen and returns it. If the encoding looks "...
function_definition (+119 nodes collapsed)
comment "/* Encode the string element pointed by 's' of size 'len' in"...
function_definition (+234 nodes collapsed)
comment "/* Return the encoded length of the listpack element pointed"...
function_definition (+237 nodes collapsed)
comment "/* Return bytes needed to encode the length of the listpack "...
function_definition (+173 nodes collapsed)
comment "/* Skip the current entry returning the next. It is invalid "...
function_definition (+60 nodes collapsed)
comment "/* This is similar to lpNext() but avoids the inner call to "...
function_definition (+88 nodes collapsed)
comment "/* If 'p' points to an element of the listpack, calling lpNe"...
function_definition (+87 nodes collapsed)
comment "/* If 'p' points to an element of the listpack, calling lpPr"...
function_definition (+114 nodes collapsed)
comment "/* Return a pointer to the first element of the listpack, or"...
function_definition (+75 nodes collapsed)
comment "/* Return a pointer to the last element of the listpack, or "...
function_definition (+56 nodes collapsed)
comment "/* Return the number of elements inside the listpack. This f"...
function_definition (+119 nodes collapsed)
comment "/* Return the listpack element pointed by 'p'.\n *\n * The fun"...
function_definition (+1041 nodes collapsed)
comment "/* Return the listpack element pointed by 'p'.\n *\n * The fun"...
function_definition (+818 nodes collapsed)
function_definition (+48 nodes collapsed)
comment "/* This is just a wrapper to lpGet() that is able to get ent"...
function_definition (+101 nodes collapsed)
comment "/* This is just a wrapper to lpGet() that is able to get an "...
function_definition (+68 nodes collapsed)
comment "/* Find pointer to the entry with a comparator callback.\n *\n"...
function_definition (+327 nodes collapsed)
function_definition (+62 nodes collapsed)
struct_specifier (+28 nodes collapsed)
; ";"
comment "/* Comparator function to find item */"
function_definition (+260 nodes collapsed)
comment "/* Find pointer to the entry equal to the specified entry. S"...
function_definition (+90 nodes collapsed)
comment "/* Insert, delete or replace the specified string element 'e"...
function_definition (+909 nodes collapsed)
comment "/* Insert the specified elements with 'entries' and 'len' at"...
function_definition (+877 nodes collapsed)
comment "/* This is just a wrapper for lpInsert() to directly use a s"...
function_definition (+77 nodes collapsed)
comment "/* This is just a wrapper for lpInsert() to directly use a 6"...
function_definition (+100 nodes collapsed)
comment "/* Append the specified element 's' of length 'slen' at the "...
function_definition (+93 nodes collapsed)
comment "/* Append the specified integer element 'lval' at the head o"...
function_definition (+80 nodes collapsed)
comment "/* Append the specified element 'ele' of length 'size' at th"...
function_definition (+85 nodes collapsed)
comment "/* Append the specified integer element 'lval' at the end of"...
function_definition (+74 nodes collapsed)
comment "/* Append batch of entries to the listpack.\n *\n * This call "...
function_definition (+82 nodes collapsed)
comment "/* This is just a wrapper for lpInsert() to directly use a s"...
function_definition (+67 nodes collapsed)
comment "/* This is just a wrapper for lpInsertInteger() to directly "...
function_definition (+56 nodes collapsed)
comment "/* Remove the element pointed by 'p', and return the resulti"...
function_definition (+62 nodes collapsed)
comment "/* Delete a range of entries from the listpack start with th"...
function_definition (+307 nodes collapsed)
comment "/* Delete a range of entries from the listpack. */"
function_definition (+228 nodes collapsed)
comment "/* Delete the elements 'ps' passed as an array of 'count' el"...
function_definition (+373 nodes collapsed)
comment "/* Merge listpacks 'first' and 'second' by appending 'second"...
function_definition (+518 nodes collapsed)
function_definition (+65 nodes collapsed)
comment "/* Return the total number of bytes the listpack is composed"...
function_definition (+26 nodes collapsed)
comment "/* Returns the size 'lval' will require when encoded, in byt"...
function_definition (+55 nodes collapsed)
comment "/* Returns the size of a listpack consisting of an integer r"...
function_definition (+39 nodes collapsed)
comment "/* Seek the specified element and returns the pointer to the"...
function_definition (+296 nodes collapsed)
comment "/* Same as lpFirst but without validation assert, to be used"...
function_definition (+58 nodes collapsed)
comment "/* Validate the integrity of a single listpack entry and mov"...
function_definition (+263 nodes collapsed)
comment "/* Validate that the entry doesn't reach outside the listpac"...
function_definition (+52 nodes collapsed)
comment "/* Validate the integrity of the data structure.\n * when `de"...
function_definition (+273 nodes collapsed)
comment "/* Compare entry pointer to by 'p' with string 's' of length"...
function_definition
sized_type_specifier
unsigned "unsigned"
primitive_type "int"
function_declarator
identifier "lpCompare"
parameter_list
( "("
parameter_declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "p"
, ","
parameter_declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "s"
, ","
parameter_declaration
primitive_type "uint32_t"
identifier "slen"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "value"
; ";"
declaration
primitive_type "int64_t"
identifier "sz"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
subscript_expression
identifier "p"
[ "["
number_literal "0"
] "]"
== "=="
identifier "LP_EOF"
) ")"
return_statement
return "return"
number_literal "0"
; ";"
expression_statement
assignment_expression
identifier "value"
= "="
call_expression
identifier "lpGet"
argument_list
( "("
identifier "p"
, ","
pointer_expression
& "&"
identifier "sz"
, ","
null
NULL "NULL"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
identifier "value"
) ")"
compound_statement (+28 nodes collapsed)
else_clause
else "else"
compound_statement
{ "{"
comment "/* We use lpStringToInt64() to get an integer representation"...
declaration
primitive_type "int64_t"
identifier "sval"
; ";"
if_statement all 1:2
if "if" all 1:2
parenthesized_expression all 1:2
( "(" all 1:2
call_expression all 1:2
identifier "lpStringToInt64" all 1:2
argument_list all 1:2
( "(" all 1:2
cast_expression all 1:2
( "(" all 1:2
type_descriptor all 1:2
type_qualifier all 1:2
const "const" all 1:2
primitive_type "char" all 1:2
abstract_pointer_declarator all 1:2
* "*" all 1:2
) ")" all 1:2
identifier "s" all 1:2
, "," all 1:2
identifier "slen" all 1:2
, "," all 1:2
pointer_expression
& "&"
identifier "sval"
) ")" all 1:2
) ")" all 1:2
return_statement
return "return"
binary_expression
identifier "sz"
== "=="
identifier "sval"
; ";"
} "}"
return_statement
return "return"
number_literal "0"
; ";"
} "}"
comment "/* uint compare for qsort */"
function_definition (+59 nodes collapsed)
comment "/* Helper method to store a string into from val or lval int"...
function_definition (+64 nodes collapsed)
comment "/* Randomly select a pair of key and value.\n * total_count i"...
function_definition (+208 nodes collapsed)
comment "/* Randomly select 'count' entries and store them in the 'en"...
function_definition (+344 nodes collapsed)
comment "/* Randomly select count of key value pairs and store into '"...
function_definition (+501 nodes collapsed)
comment "/* Randomly select count of key value pairs and store into '"...
function_definition (+337 nodes collapsed)
comment "/* Iterates forward to the \"next random\" element, given we a"...
function_definition (+245 nodes collapsed)
comment "/* Print info of listpack which is used in debugCommand */"
function_definition (+466 nodes collapsed)
preproc_ifdef
#ifdef "#ifdef"
identifier "REDIS_TEST"
preproc_include
#include "#include"
system_lib_string "<sys/time.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "adlist.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "sds.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "testhelp.h"
" "\""
preproc_function_def
#define "#define"
identifier "UNUSED"
preproc_params
( "("
identifier "x"
) ")"
preproc_arg "(void)(x)"
preproc_function_def
#define "#define"
identifier "TEST"
preproc_params
( "("
identifier "name"
) ")"
preproc_arg "printf(\"test — %s\\n\", name);"
declaration (+33 nodes collapsed)
declaration (+43 nodes collapsed)
function_definition (+186 nodes collapsed)
function_definition (+260 nodes collapsed)
function_definition (+64 nodes collapsed)
function_definition (+323 nodes collapsed)
function_definition (+209 nodes collapsed)
function_definition (+197 nodes collapsed)
function_definition
storage_class_specifier
static "static"
primitive_type "void"
function_declarator (+24 nodes collapsed)
compound_statement
{ "{"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
identifier "s"
, ","
identifier "slen"
) ")"
) ")"
; ";"
} "}"
function_definition
storage_class_specifier
static "static"
primitive_type "int"
function_declarator (+24 nodes collapsed)
compound_statement
{ "{"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "p"
) ")"
; ";"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "head_count"
) ")"
; ";"
declaration
primitive_type "int"
identifier "ret"
; ";"
declaration
sized_type_specifier
long "long"
init_declarator
pointer_declarator
* "*"
identifier "count"
= "="
identifier "userdata"
; ";"
expression_statement
assignment_expression
identifier "ret"
= "="
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
subscript_expression
identifier "mixlist"
[ "["
pointer_expression
* "*"
identifier "count"
] "]"
, ","
call_expression
identifier "strlen"
argument_list
( "("
subscript_expression
identifier "mixlist"
[ "["
pointer_expression
* "*"
identifier "count"
] "]"
) ")"
) ")"
; ";"
expression_statement
update_expression
parenthesized_expression
( "("
pointer_expression
* "*"
identifier "count"
) ")"
++ "++"
; ";"
return_statement
return "return"
identifier "ret"
; ";"
} "}"
function_definition (+179 nodes collapsed)
function_definition
primitive_type "int"
function_declarator (+21 nodes collapsed)
compound_statement
{ "{"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "argc"
) ")"
; ";"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "argv"
) ")"
; ";"
declaration
primitive_type "int"
identifier "i"
; ";"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "lp"
, ","
pointer_declarator
* "*"
identifier "p"
, ","
pointer_declarator
* "*"
identifier "vstr"
; ";"
declaration
primitive_type "int64_t"
identifier "vlen"
; ";"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
array_declarator
identifier "intbuf"
[ "["
identifier "LP_INTBUF_SIZE"
] "]"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "accurate"
= "="
parenthesized_expression
( "("
binary_expression
identifier "flags"
& "&"
identifier "REDIS_TEST_ACCURATE"
) ")"
; ";"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Create int list"
" "\""
) ")"
; ""
compound_statement (+37 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Create list"
" "\""
) ")"
; ""
compound_statement (+37 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpPrepend"
" "\""
) ")"
; ""
compound_statement (+138 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpPrependInteger"
" "\""
) ")"
; ""
compound_statement (+162 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Get element at index"
" "\""
) ")"
; ""
compound_statement (+183 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Pop list"
" "\""
) ")"
; ""
compound_statement (+73 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Get element at index"
" "\""
) ")"
; ""
compound_statement (+183 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate list from 0 to end"
" "\""
) ")"
; ""
compound_statement (+99 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate list from 1 to end"
" "\""
) ")"
; ""
compound_statement (+101 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate list from 2 to end"
" "\""
) ")"
; ""
compound_statement (+101 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate from back to front"
" "\""
) ")"
; ""
compound_statement (+99 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate from back to front, deleting all items"
" "\""
) ")"
; ""
compound_statement (+126 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete whole listpack when num == -1"
" "\""
) ")"
; ";"
compound_statement (+193 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete whole listpack with negative index"
" "\""
) ")"
; ";"
compound_statement (+195 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete inclusive range 0,0"
" "\""
) ")"
; ";"
compound_statement (+171 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete inclusive range 0,1"
" "\""
) ")"
; ";"
compound_statement (+197 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete inclusive range 1,2"
" "\""
) ")"
; ";"
compound_statement (+199 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete with start index out of range"
" "\""
) ")"
; ";"
compound_statement (+52 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete with num overflow"
" "\""
) ")"
; ";"
compound_statement (+199 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Batch append"
" "\""
) ")"
; ""
compound_statement (+833 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Batch insert"
" "\""
) ")"
; ""
compound_statement (+1300 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Batch delete"
" "\""
) ")"
; ""
compound_statement (+224 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete foo while iterating"
" "\""
) ")"
; ""
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "createList"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpFirst"
argument_list
( "("
identifier "lp"
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
identifier "p"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "foo"
" "\""
, ","
number_literal "3"
) ")"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "lpDelete"
argument_list
( "("
identifier "lp"
, ","
identifier "p"
, ","
pointer_expression
& "&"
identifier "p"
) ")"
; ";"
} "}"
else_clause
else "else"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "p"
) ")"
; ";"
} "}"
} "}"
expression_statement
call_expression
identifier "lpFree"
argument_list
( "("
identifier "lp"
) ")"
; ";"
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Replace with same size"
" "\""
) ")"
; ""
compound_statement (+247 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Replace with different size"
" "\""
) ")"
; ""
compound_statement (+133 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Regression test for >255 byte strings"
" "\""
) ")"
; ""
compound_statement (+251 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Create long list and check indices"
" "\""
) ")"
; ""
compound_statement (+217 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Compare strings with listpack entries"
" "\""
) ")"
; ""
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "createList"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "hello"
" "\""
, ","
number_literal "5"
) ")"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
unary_expression
! "!"
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "hella"
" "\""
, ","
number_literal "5"
) ")"
) ")"
; ";"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "3"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "1024"
" "\""
, ","
number_literal "4"
) ")"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
unary_expression
! "!"
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "1025"
" "\""
, ","
number_literal "4"
) ")"
) ")"
; ";"
expression_statement
call_expression
identifier "lpFree"
argument_list
( "("
identifier "lp"
) ")"
; ";"
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpMerge two empty listpacks"
" "\""
) ")"
; ""
compound_statement (+77 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpMerge two listpacks - first larger than second"
" "\""
) ")"
; ""
compound_statement (+312 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpMerge two listpacks - second larger than first"
" "\""
) ")"
; ""
compound_statement (+312 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpNextRandom normal usage"
" "\""
) ")"
; ""
compound_statement (+270 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpNextRandom corner cases"
" "\""
) ")"
; ""
compound_statement (+671 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pair with one element"
" "\""
) ")"
; ""
compound_statement (+150 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pair with many elements"
" "\""
) ")"
; ""
compound_statement (+285 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pair with tuple_len 3"
" "\""
) ")"
; ""
compound_statement (+494 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs with one element"
" "\""
) ")"
; ""
compound_statement (+219 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs with many elements"
" "\""
) ")"
; ""
compound_statement (+395 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs with many elements and tuple_len 3"
" "\""
) ")"
; ""
compound_statement (+590 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs unique with one element"
" "\""
) ")"
; ""
compound_statement (+233 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs unique with many elements"
" "\""
) ")"
; ""
compound_statement (+414 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs unique with many elements and tuple_len 3"
" "\""
) ")"
; ""
compound_statement (+609 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "push various encodings"
" "\""
) ")"
; ""
compound_statement (+877 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpFind"
" "\""
) ")"
; ""
compound_statement (+171 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpFindCb"
" "\""
) ")"
; ""
compound_statement (+304 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpValidateIntegrity"
" "\""
) ")"
; ""
compound_statement (+60 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test number of elements exceeds LP_HDR_NUMELE_UNKNOWN"
" "\""
) ")"
; ""
compound_statement (+176 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test number of elements exceeds LP_HDR_NUMELE_UNKNOWN with b"...
" "\""
) ")"
; ""
compound_statement (+260 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Stress with random payloads of different encoding"
" "\""
) ")"
; ""
compound_statement (+670 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Stress with variable listpack size"
" "\""
) ")"
; ""
compound_statement (+79 nodes collapsed)
comment "/* Benchmarks */"
compound_statement
{ "{"
declaration
primitive_type "int"
init_declarator
identifier "iteration"
= "="
conditional_expression
identifier "accurate"
? "?"
number_literal "100000"
: ":"
number_literal "100"
; ";"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "lpNew"
argument_list
( "("
number_literal "0"
) ")"
; ";"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpAppend"
" "\""
) ")"
; ""
compound_statement (+332 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpFind string"
" "\""
) ")"
; ""
compound_statement (+107 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpFind number"
" "\""
) ")"
; ""
compound_statement (+107 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpSeek"
" "\""
) ")"
; ""
compound_statement (+70 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpValidateIntegrity"
" "\""
) ")"
; ""
compound_statement (+83 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpCompare with string"
" "\""
) ")"
; ""
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
long "long"
init_declarator
identifier "start"
= "="
call_expression
identifier "usec"
argument_list
( "("
) ")"
; ";"
for_statement
for "for"
( "("
declaration
primitive_type "int"
init_declarator
identifier "i"
= "="
number_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
number_literal "2000"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "eptr"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "eptr"
!= "!="
null
NULL "NULL"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "eptr"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "nothing"
" "\""
, ","
number_literal "7"
) ")"
; ";"
expression_statement
assignment_expression
identifier "eptr"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "eptr"
) ")"
; ";"
} "}"
} "}"
expression_statement (+21 nodes collapsed)
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpCompare with number"
" "\""
) ")"
; ""
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
long "long"
init_declarator
identifier "start"
= "="
call_expression
identifier "usec"
argument_list
( "("
) ")"
; ";"
for_statement
for "for"
( "("
declaration
primitive_type "int"
init_declarator
identifier "i"
= "="
number_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
number_literal "2000"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "eptr"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "eptr"
!= "!="
null
NULL "NULL"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "lp"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "99999"
" "\""
, ","
number_literal "5"
) ")"
; ";"
expression_statement
assignment_expression
identifier "eptr"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "eptr"
) ")"
; ";"
} "}"
} "}"
expression_statement (+21 nodes collapsed)
} "}"
expression_statement
call_expression
identifier "lpFree"
argument_list
( "("
identifier "lp"
) ")"
; ";"
} "}"
return_statement
return "return"
number_literal "0"
; ";"
} "}"
#endif "#endif"

After

translation_unit
comment "/* Listpack -- A lists of strings serialization format\n *\n *"...
preproc_include
#include "#include"
system_lib_string "<stdint.h>"
preproc_include
#include "#include"
system_lib_string "<limits.h>"
preproc_include
#include "#include"
system_lib_string "<sys/types.h>"
preproc_include
#include "#include"
system_lib_string "<stdlib.h>"
preproc_include
#include "#include"
system_lib_string "<string.h>"
preproc_include
#include "#include"
system_lib_string "<stdio.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "listpack.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "listpack_malloc.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "redisassert.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "util.h"
" "\""
preproc_def
#define "#define"
identifier "LP_HDR_SIZE"
preproc_arg "6 "
comment "/* 32 bit total len + 16 bit number of elements. */"
preproc_def
#define "#define"
identifier "LP_HDR_NUMELE_UNKNOWN"
preproc_arg "UINT16_MAX"
preproc_def
#define "#define"
identifier "LP_MAX_INT_ENCODING_LEN"
preproc_arg "9"
preproc_def
#define "#define"
identifier "LP_MAX_BACKLEN_SIZE"
preproc_arg "5"
preproc_def
#define "#define"
identifier "LP_ENCODING_INT"
preproc_arg "0"
preproc_def
#define "#define"
identifier "LP_ENCODING_STRING"
preproc_arg "1"
preproc_def
#define "#define"
identifier "LP_ENCODING_7BIT_UINT"
preproc_arg "0"
preproc_def
#define "#define"
identifier "LP_ENCODING_7BIT_UINT_MASK"
preproc_arg "0x80"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_7BIT_UINT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_7BIT_UINT_MASK)==LP_ENCODING_7BIT_UINT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_7BIT_UINT_ENTRY_SIZE"
preproc_arg "2"
preproc_def
#define "#define"
identifier "LP_ENCODING_6BIT_STR"
preproc_arg "0x80"
preproc_def
#define "#define"
identifier "LP_ENCODING_6BIT_STR_MASK"
preproc_arg "0xC0"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_6BIT_STR"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_6BIT_STR_MASK)==LP_ENCODING_6BIT_STR)"
preproc_def
#define "#define"
identifier "LP_ENCODING_13BIT_INT"
preproc_arg "0xC0"
preproc_def
#define "#define"
identifier "LP_ENCODING_13BIT_INT_MASK"
preproc_arg "0xE0"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_13BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_13BIT_INT_MASK)==LP_ENCODING_13BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_13BIT_INT_ENTRY_SIZE"
preproc_arg "3"
preproc_def
#define "#define"
identifier "LP_ENCODING_12BIT_STR"
preproc_arg "0xE0"
preproc_def
#define "#define"
identifier "LP_ENCODING_12BIT_STR_MASK"
preproc_arg "0xF0"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_12BIT_STR"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_12BIT_STR_MASK)==LP_ENCODING_12BIT_STR)"
preproc_def
#define "#define"
identifier "LP_ENCODING_16BIT_INT"
preproc_arg "0xF1"
preproc_def
#define "#define"
identifier "LP_ENCODING_16BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_16BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_16BIT_INT_MASK)==LP_ENCODING_16BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_16BIT_INT_ENTRY_SIZE"
preproc_arg "4"
preproc_def
#define "#define"
identifier "LP_ENCODING_24BIT_INT"
preproc_arg "0xF2"
preproc_def
#define "#define"
identifier "LP_ENCODING_24BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_24BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_24BIT_INT_MASK)==LP_ENCODING_24BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_24BIT_INT_ENTRY_SIZE"
preproc_arg "5"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_INT"
preproc_arg "0xF3"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_32BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_32BIT_INT_MASK)==LP_ENCODING_32BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_INT_ENTRY_SIZE"
preproc_arg "6"
preproc_def
#define "#define"
identifier "LP_ENCODING_64BIT_INT"
preproc_arg "0xF4"
preproc_def
#define "#define"
identifier "LP_ENCODING_64BIT_INT_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_64BIT_INT"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_64BIT_INT_MASK)==LP_ENCODING_64BIT_INT)"
preproc_def
#define "#define"
identifier "LP_ENCODING_64BIT_INT_ENTRY_SIZE"
preproc_arg "10"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_STR"
preproc_arg "0xF0"
preproc_def
#define "#define"
identifier "LP_ENCODING_32BIT_STR_MASK"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_IS_32BIT_STR"
preproc_params
( "("
identifier "byte"
) ")"
preproc_arg "(((byte)&LP_ENCODING_32BIT_STR_MASK)==LP_ENCODING_32BIT_STR)"
preproc_def
#define "#define"
identifier "LP_EOF"
preproc_arg "0xFF"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_6BIT_STR_LEN"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "((p)[0] & 0x3F)"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_12BIT_STR_LEN"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "((((p)[0] & 0xF) << 8) | (p)[1])"
preproc_function_def
#define "#define"
identifier "LP_ENCODING_32BIT_STR_LEN"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "(((uint32_t)(p)[1]<<0) | \\\n "...
preproc_function_def
#define "#define"
identifier "lpGetTotalBytes"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "(((uint32_t)(p)[0]<<0) | \\\n "...
preproc_function_def
#define "#define"
identifier "lpGetNumElements"
preproc_params
( "("
identifier "p"
) ")"
preproc_arg "(((uint32_t)(p)[4]<<0) | \\\n "...
preproc_function_def
#define "#define"
identifier "lpSetTotalBytes"
preproc_params
( "("
identifier "p"
, ","
identifier "v"
) ")"
preproc_arg "do { \\\n (p)[0] = (v)&0xff; \\\n (p)[1] = ((v)>>8)&0xff; "...
preproc_function_def
#define "#define"
identifier "lpSetNumElements"
preproc_params
( "("
identifier "p"
, ","
identifier "v"
) ")"
preproc_arg "do { \\\n (p)[4] = (v)&0xff; \\\n (p)[5] = ((v)>>8)&0xff; "...
comment "/* Validates that 'p' is not outside the listpack.\n * All fu"...
preproc_function_def
#define "#define"
identifier "ASSERT_INTEGRITY"
preproc_params
( "("
identifier "lp"
, ","
identifier "p"
) ")"
preproc_arg "do { \\\n assert((p) >= (lp)+LP_HDR_SIZE && (p) < (lp)+lpGe"...
comment "/* Similar to the above, but validates the entire element le"...
preproc_function_def
#define "#define"
identifier "ASSERT_INTEGRITY_LEN"
preproc_params
( "("
identifier "lp"
, ","
identifier "p"
, ","
identifier "len"
) ")"
preproc_arg "do { \\\n assert((p) >= (lp)+LP_HDR_SIZE && (p)+(len) < (lp"...
declaration (+31 nodes collapsed)
comment "/* Don't let listpacks grow over 1GB in any case, don't wann"...
preproc_def
#define "#define"
identifier "LISTPACK_MAX_SAFETY_SIZE"
preproc_arg "(1<<30)"
function_definition (+58 nodes collapsed)
comment "/* Convert a string into a signed 64 bit integer.\n * The fun"...
function_definition (+488 nodes collapsed)
comment "/* Create a new, empty listpack.\n * On success the new listp"...
function_definition (+99 nodes collapsed)
comment "/* Free the specified listpack. */"
function_definition (+25 nodes collapsed)
comment "/* Generic version of lpFree. */"
function_definition (+32 nodes collapsed)
comment "/* Shrink the memory to fit. */"
function_definition (+70 nodes collapsed)
comment "/* Stores the integer encoded representation of 'v' in the '"...
function_definition (+803 nodes collapsed)
comment "/* Given an element 'ele' of size 'size', determine if the e"...
function_definition (+157 nodes collapsed)
comment "/* Store a reverse-encoded variable length field, representi"...
function_definition (+436 nodes collapsed)
comment "/* Calculate the number of bytes required to reverse-encode "...
function_definition (+98 nodes collapsed)
comment "/* Decode the backlen and returns it. If the encoding looks "...
function_definition (+119 nodes collapsed)
comment "/* Encode the string element pointed by 's' of size 'len' in"...
function_definition (+234 nodes collapsed)
comment "/* Return the encoded length of the listpack element pointed"...
function_definition (+237 nodes collapsed)
comment "/* Return bytes needed to encode the length of the listpack "...
function_definition (+173 nodes collapsed)
comment "/* Skip the current entry returning the next. It is invalid "...
function_definition (+60 nodes collapsed)
comment "/* This is similar to lpNext() but avoids the inner call to "...
function_definition (+88 nodes collapsed)
comment "/* If 'p' points to an element of the listpack, calling lpNe"...
function_definition (+87 nodes collapsed)
comment "/* If 'p' points to an element of the listpack, calling lpPr"...
function_definition (+114 nodes collapsed)
comment "/* Return a pointer to the first element of the listpack, or"...
function_definition (+75 nodes collapsed)
comment "/* Return a pointer to the last element of the listpack, or "...
function_definition (+56 nodes collapsed)
comment "/* Return the number of elements inside the listpack. This f"...
function_definition (+119 nodes collapsed)
comment "/* Return the listpack element pointed by 'p'.\n *\n * The fun"...
function_definition (+1041 nodes collapsed)
comment "/* Return the listpack element pointed by 'p'.\n *\n * The fun"...
function_definition (+818 nodes collapsed)
function_definition (+48 nodes collapsed)
comment "/* This is just a wrapper to lpGet() that is able to get ent"...
function_definition (+101 nodes collapsed)
comment "/* This is just a wrapper to lpGet() that is able to get an "...
function_definition (+68 nodes collapsed)
comment "/* Find pointer to the entry with a comparator callback.\n *\n"...
function_definition (+327 nodes collapsed)
function_definition (+62 nodes collapsed)
struct_specifier (+28 nodes collapsed)
; ";"
comment "/* Comparator function to find item */"
function_definition (+260 nodes collapsed)
comment "/* Find pointer to the entry equal to the specified entry. S"...
function_definition (+90 nodes collapsed)
comment "/* Insert, delete or replace the specified string element 'e"...
function_definition (+909 nodes collapsed)
comment "/* Insert the specified elements with 'entries' and 'len' at"...
function_definition (+877 nodes collapsed)
comment "/* This is just a wrapper for lpInsert() to directly use a s"...
function_definition (+77 nodes collapsed)
comment "/* This is just a wrapper for lpInsert() to directly use a 6"...
function_definition (+100 nodes collapsed)
comment "/* Append the specified element 's' of length 'slen' at the "...
function_definition (+93 nodes collapsed)
comment "/* Append the specified integer element 'lval' at the head o"...
function_definition (+80 nodes collapsed)
comment "/* Append the specified element 'ele' of length 'size' at th"...
function_definition (+85 nodes collapsed)
comment "/* Append the specified integer element 'lval' at the end of"...
function_definition (+74 nodes collapsed)
comment "/* Append batch of entries to the listpack.\n *\n * This call "...
function_definition (+82 nodes collapsed)
comment "/* This is just a wrapper for lpInsert() to directly use a s"...
function_definition (+67 nodes collapsed)
comment "/* This is just a wrapper for lpInsertInteger() to directly "...
function_definition (+56 nodes collapsed)
comment "/* Remove the element pointed by 'p', and return the resulti"...
function_definition (+62 nodes collapsed)
comment "/* Delete a range of entries from the listpack start with th"...
function_definition (+307 nodes collapsed)
comment "/* Delete a range of entries from the listpack. */"
function_definition (+228 nodes collapsed)
comment "/* Delete the elements 'ps' passed as an array of 'count' el"...
function_definition (+373 nodes collapsed)
comment "/* Merge listpacks 'first' and 'second' by appending 'second"...
function_definition (+518 nodes collapsed)
function_definition (+65 nodes collapsed)
comment "/* Return the total number of bytes the listpack is composed"...
function_definition (+26 nodes collapsed)
comment "/* Returns the size 'lval' will require when encoded, in byt"...
function_definition (+55 nodes collapsed)
comment "/* Returns the size of a listpack consisting of an integer r"...
function_definition (+39 nodes collapsed)
comment "/* Seek the specified element and returns the pointer to the"...
function_definition (+296 nodes collapsed)
comment "/* Same as lpFirst but without validation assert, to be used"...
function_definition (+58 nodes collapsed)
comment "/* Validate the integrity of a single listpack entry and mov"...
function_definition (+263 nodes collapsed)
comment "/* Validate that the entry doesn't reach outside the listpac"...
function_definition (+52 nodes collapsed)
comment "/* Validate the integrity of the data structure.\n * when `de"...
function_definition (+273 nodes collapsed)
comment "/* Compare entry pointer to by 'p' with string 's' of length"...
function_definition
sized_type_specifier
unsigned "unsigned"
primitive_type "int"
function_declarator
identifier "lpCompare"
parameter_list
( "("
parameter_declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "p"
, ","
parameter_declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "s"
, ","
parameter_declaration
primitive_type "uint32_t"
identifier "slen"
, ","
parameter_declaration
sized_type_specifier
long "long"
long "long"
pointer_declarator
* "*"
identifier "cached_longval"
, ","
parameter_declaration
primitive_type "int"
pointer_declarator
* "*"
identifier "cached_valid"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "value"
; ";"
declaration
primitive_type "int64_t"
identifier "sz"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
subscript_expression
identifier "p"
[ "["
number_literal "0"
] "]"
== "=="
identifier "LP_EOF"
) ")"
return_statement
return "return"
number_literal "0"
; ";"
expression_statement
assignment_expression
identifier "value"
= "="
call_expression
identifier "lpGet"
argument_list
( "("
identifier "p"
, ","
pointer_expression
& "&"
identifier "sz"
, ","
null
NULL "NULL"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
identifier "value"
) ")"
compound_statement (+28 nodes collapsed)
else_clause
else "else"
compound_statement
{ "{"
declaration
primitive_type "int64_t"
identifier "sval"
; ";"
comment "/* We use lpStringToInt64() to get an integer representation"...
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "cached_valid"
!= "!="
null
NULL "NULL"
) ")"
compound_statement
{ "{"
comment "/* Use caching */"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
pointer_expression
* "*"
identifier "cached_valid"
== "=="
number_literal "0"
) ")"
compound_statement
{ "{"
if_statement all 1:2
if "if" all 1:2
parenthesized_expression all 1:2
( "(" all 1:2
call_expression all 1:2
identifier "lpStringToInt64" all 1:2
argument_list all 1:2
( "(" all 1:2
cast_expression all 1:2
( "(" all 1:2
type_descriptor all 1:2
type_qualifier all 1:2
const "const" all 1:2
primitive_type "char" all 1:2
abstract_pointer_declarator all 1:2
* "*" all 1:2
) ")" all 1:2
identifier "s" all 1:2
, "," all 1:2
identifier "slen" all 1:2
, "," all 1:2
cast_expression
( "("
type_descriptor
primitive_type "int64_t"
abstract_pointer_declarator
* "*"
) ")"
identifier "cached_longval"
) ")" all 1:2
) ")" all 1:2
compound_statement
{ "{"
expression_statement
assignment_expression
pointer_expression
* "*"
identifier "cached_valid"
= "="
number_literal "1"
; ";"
} "}"
else_clause
else "else"
compound_statement
{ "{"
expression_statement
assignment_expression
pointer_expression
* "*"
identifier "cached_valid"
= "="
number_literal "-1"
; ";"
} "}"
} "}"
return_statement
return "return"
parenthesized_expression
( "("
binary_expression
binary_expression
pointer_expression
* "*"
identifier "cached_valid"
== "=="
number_literal "1"
&& "&&"
binary_expression
identifier "sz"
== "=="
pointer_expression
* "*"
identifier "cached_longval"
) ")"
; ";"
} "}"
else_clause
else "else"
compound_statement
{ "{"
comment "/* No caching - direct conversion */"
if_statement all 1:2
if "if" all 1:2
parenthesized_expression all 1:2
( "(" all 1:2
call_expression all 1:2
identifier "lpStringToInt64" all 1:2
argument_list all 1:2
( "(" all 1:2
cast_expression all 1:2
( "(" all 1:2
type_descriptor all 1:2
type_qualifier all 1:2
const "const" all 1:2
primitive_type "char" all 1:2
abstract_pointer_declarator all 1:2
* "*" all 1:2
) ")" all 1:2
identifier "s" all 1:2
, "," all 1:2
identifier "slen" all 1:2
, "," all 1:2
pointer_expression
& "&"
identifier "sval"
) ")" all 1:2
) ")" all 1:2
return_statement
return "return"
binary_expression
identifier "sz"
== "=="
identifier "sval"
; ";"
} "}"
} "}"
return_statement
return "return"
number_literal "0"
; ";"
} "}"
comment "/* uint compare for qsort */"
function_definition (+59 nodes collapsed)
comment "/* Helper method to store a string into from val or lval int"...
function_definition (+64 nodes collapsed)
comment "/* Randomly select a pair of key and value.\n * total_count i"...
function_definition (+208 nodes collapsed)
comment "/* Randomly select 'count' entries and store them in the 'en"...
function_definition (+344 nodes collapsed)
comment "/* Randomly select count of key value pairs and store into '"...
function_definition (+501 nodes collapsed)
comment "/* Randomly select count of key value pairs and store into '"...
function_definition (+337 nodes collapsed)
comment "/* Iterates forward to the \"next random\" element, given we a"...
function_definition (+245 nodes collapsed)
comment "/* Print info of listpack which is used in debugCommand */"
function_definition (+466 nodes collapsed)
preproc_ifdef
#ifdef "#ifdef"
identifier "REDIS_TEST"
preproc_include
#include "#include"
system_lib_string "<sys/time.h>"
preproc_include
#include "#include"
string_literal
" "\""
string_content "adlist.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "sds.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "testhelp.h"
" "\""
preproc_function_def
#define "#define"
identifier "UNUSED"
preproc_params
( "("
identifier "x"
) ")"
preproc_arg "(void)(x)"
preproc_function_def
#define "#define"
identifier "TEST"
preproc_params
( "("
identifier "name"
) ")"
preproc_arg "printf(\"test — %s\\n\", name);"
declaration (+33 nodes collapsed)
declaration (+43 nodes collapsed)
function_definition (+186 nodes collapsed)
function_definition (+260 nodes collapsed)
function_definition (+64 nodes collapsed)
function_definition (+323 nodes collapsed)
function_definition (+209 nodes collapsed)
function_definition (+197 nodes collapsed)
function_definition
storage_class_specifier
static "static"
primitive_type "void"
function_declarator (+24 nodes collapsed)
compound_statement
{ "{"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
identifier "s"
, ","
identifier "slen"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
) ")"
; ";"
} "}"
function_definition
storage_class_specifier
static "static"
primitive_type "int"
function_declarator (+24 nodes collapsed)
compound_statement
{ "{"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "p"
) ")"
; ";"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "head_count"
) ")"
; ";"
declaration
primitive_type "int"
identifier "ret"
; ";"
declaration
sized_type_specifier
long "long"
init_declarator
pointer_declarator
* "*"
identifier "count"
= "="
identifier "userdata"
; ";"
expression_statement
assignment_expression
identifier "ret"
= "="
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
subscript_expression
identifier "mixlist"
[ "["
pointer_expression
* "*"
identifier "count"
] "]"
, ","
call_expression
identifier "strlen"
argument_list
( "("
subscript_expression
identifier "mixlist"
[ "["
pointer_expression
* "*"
identifier "count"
] "]"
) ")"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
; ";"
expression_statement
update_expression
parenthesized_expression
( "("
pointer_expression
* "*"
identifier "count"
) ")"
++ "++"
; ";"
return_statement
return "return"
identifier "ret"
; ";"
} "}"
function_definition (+179 nodes collapsed)
function_definition
primitive_type "int"
function_declarator (+21 nodes collapsed)
compound_statement
{ "{"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "argc"
) ")"
; ";"
expression_statement
call_expression
identifier "UNUSED"
argument_list
( "("
identifier "argv"
) ")"
; ";"
declaration
primitive_type "int"
identifier "i"
; ";"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
pointer_declarator
* "*"
identifier "lp"
, ","
pointer_declarator
* "*"
identifier "p"
, ","
pointer_declarator
* "*"
identifier "vstr"
; ";"
declaration
primitive_type "int64_t"
identifier "vlen"
; ";"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
array_declarator
identifier "intbuf"
[ "["
identifier "LP_INTBUF_SIZE"
] "]"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "accurate"
= "="
parenthesized_expression
( "("
binary_expression
identifier "flags"
& "&"
identifier "REDIS_TEST_ACCURATE"
) ")"
; ";"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Create int list"
" "\""
) ")"
; ""
compound_statement (+37 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Create list"
" "\""
) ")"
; ""
compound_statement (+37 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpPrepend"
" "\""
) ")"
; ""
compound_statement (+138 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpPrependInteger"
" "\""
) ")"
; ""
compound_statement (+162 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Get element at index"
" "\""
) ")"
; ""
compound_statement (+183 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Pop list"
" "\""
) ")"
; ""
compound_statement (+73 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Get element at index"
" "\""
) ")"
; ""
compound_statement (+183 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate list from 0 to end"
" "\""
) ")"
; ""
compound_statement (+99 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate list from 1 to end"
" "\""
) ")"
; ""
compound_statement (+101 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate list from 2 to end"
" "\""
) ")"
; ""
compound_statement (+101 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate from back to front"
" "\""
) ")"
; ""
compound_statement (+99 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Iterate from back to front, deleting all items"
" "\""
) ")"
; ""
compound_statement (+126 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete whole listpack when num == -1"
" "\""
) ")"
; ";"
compound_statement (+193 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete whole listpack with negative index"
" "\""
) ")"
; ";"
compound_statement (+195 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete inclusive range 0,0"
" "\""
) ")"
; ";"
compound_statement (+171 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete inclusive range 0,1"
" "\""
) ")"
; ";"
compound_statement (+197 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete inclusive range 1,2"
" "\""
) ")"
; ";"
compound_statement (+199 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete with start index out of range"
" "\""
) ")"
; ";"
compound_statement (+52 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete with num overflow"
" "\""
) ")"
; ";"
compound_statement (+199 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Batch append"
" "\""
) ")"
; ""
compound_statement (+833 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Batch insert"
" "\""
) ")"
; ""
compound_statement (+1300 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Batch delete"
" "\""
) ")"
; ""
compound_statement (+224 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Delete foo while iterating"
" "\""
) ")"
; ""
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "createList"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpFirst"
argument_list
( "("
identifier "lp"
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
identifier "p"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "foo"
" "\""
, ","
number_literal "3"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "lpDelete"
argument_list
( "("
identifier "lp"
, ","
identifier "p"
, ","
pointer_expression
& "&"
identifier "p"
) ")"
; ";"
} "}"
else_clause
else "else"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "p"
) ")"
; ";"
} "}"
} "}"
expression_statement
call_expression
identifier "lpFree"
argument_list
( "("
identifier "lp"
) ")"
; ";"
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Replace with same size"
" "\""
) ")"
; ""
compound_statement (+247 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Replace with different size"
" "\""
) ")"
; ""
compound_statement (+133 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Regression test for >255 byte strings"
" "\""
) ")"
; ""
compound_statement (+251 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Create long list and check indices"
" "\""
) ")"
; ""
compound_statement (+217 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Compare strings with listpack entries"
" "\""
) ")"
; ""
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "createList"
argument_list
( "("
) ")"
; ";"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "hello"
" "\""
, ","
number_literal "5"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
unary_expression
! "!"
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "hella"
" "\""
, ","
number_literal "5"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
) ")"
; ";"
expression_statement
assignment_expression
identifier "p"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "3"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "1024"
" "\""
, ","
number_literal "4"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
) ")"
; ";"
expression_statement
call_expression
identifier "assert"
argument_list
( "("
unary_expression
! "!"
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "p"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "1025"
" "\""
, ","
number_literal "4"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
) ")"
; ";"
expression_statement
call_expression
identifier "lpFree"
argument_list
( "("
identifier "lp"
) ")"
; ";"
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpMerge two empty listpacks"
" "\""
) ")"
; ""
compound_statement (+77 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpMerge two listpacks - first larger than second"
" "\""
) ")"
; ""
compound_statement (+312 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpMerge two listpacks - second larger than first"
" "\""
) ")"
; ""
compound_statement (+312 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpNextRandom normal usage"
" "\""
) ")"
; ""
compound_statement (+270 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "lpNextRandom corner cases"
" "\""
) ")"
; ""
compound_statement (+671 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pair with one element"
" "\""
) ")"
; ""
compound_statement (+150 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pair with many elements"
" "\""
) ")"
; ""
compound_statement (+285 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pair with tuple_len 3"
" "\""
) ")"
; ""
compound_statement (+494 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs with one element"
" "\""
) ")"
; ""
compound_statement (+219 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs with many elements"
" "\""
) ")"
; ""
compound_statement (+395 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs with many elements and tuple_len 3"
" "\""
) ")"
; ""
compound_statement (+590 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs unique with one element"
" "\""
) ")"
; ""
compound_statement (+233 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs unique with many elements"
" "\""
) ")"
; ""
compound_statement (+414 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Random pairs unique with many elements and tuple_len 3"
" "\""
) ")"
; ""
compound_statement (+609 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "push various encodings"
" "\""
) ")"
; ""
compound_statement (+877 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpFind"
" "\""
) ")"
; ""
compound_statement (+171 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpFindCb"
" "\""
) ")"
; ""
compound_statement (+304 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test lpValidateIntegrity"
" "\""
) ")"
; ""
compound_statement (+60 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test number of elements exceeds LP_HDR_NUMELE_UNKNOWN"
" "\""
) ")"
; ""
compound_statement (+176 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Test number of elements exceeds LP_HDR_NUMELE_UNKNOWN with b"...
" "\""
) ")"
; ""
compound_statement (+260 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Stress with random payloads of different encoding"
" "\""
) ")"
; ""
compound_statement (+670 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Stress with variable listpack size"
" "\""
) ")"
; ""
compound_statement (+79 nodes collapsed)
comment "/* Benchmarks */"
compound_statement
{ "{"
declaration
primitive_type "int"
init_declarator
identifier "iteration"
= "="
conditional_expression
identifier "accurate"
? "?"
number_literal "100000"
: ":"
number_literal "100"
; ";"
expression_statement
assignment_expression
identifier "lp"
= "="
call_expression
identifier "lpNew"
argument_list
( "("
number_literal "0"
) ")"
; ";"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpAppend"
" "\""
) ")"
; ""
compound_statement (+332 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpFind string"
" "\""
) ")"
; ""
compound_statement (+107 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpFind number"
" "\""
) ")"
; ""
compound_statement (+107 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpSeek"
" "\""
) ")"
; ""
compound_statement (+70 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpValidateIntegrity"
" "\""
) ")"
; ""
compound_statement (+83 nodes collapsed)
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpCompare with string"
" "\""
) ")"
; ""
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
long "long"
init_declarator
identifier "start"
= "="
call_expression
identifier "usec"
argument_list
( "("
) ")"
; ";"
for_statement
for "for"
( "("
declaration
primitive_type "int"
init_declarator
identifier "i"
= "="
number_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
number_literal "2000"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "eptr"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "eptr"
!= "!="
null
NULL "NULL"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "eptr"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "nothing"
" "\""
, ","
number_literal "7"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
; ";"
expression_statement
assignment_expression
identifier "eptr"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "eptr"
) ")"
; ";"
} "}"
} "}"
expression_statement (+21 nodes collapsed)
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpCompare with number"
" "\""
) ")"
; ""
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
long "long"
init_declarator
identifier "start"
= "="
call_expression
identifier "usec"
argument_list
( "("
) ")"
; ";"
for_statement
for "for"
( "("
declaration
primitive_type "int"
init_declarator
identifier "i"
= "="
number_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
number_literal "2000"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "eptr"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "eptr"
!= "!="
null
NULL "NULL"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "eptr"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "99999"
" "\""
, ","
number_literal "5"
, ","
null
NULL "NULL"
, ","
null
NULL "NULL"
) ")"
; ";"
expression_statement
assignment_expression
identifier "eptr"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "eptr"
) ")"
; ";"
} "}"
} "}"
expression_statement (+21 nodes collapsed)
} "}"
expression_statement
call_expression
identifier "TEST"
argument_list
( "("
string_literal
" "\""
string_content "Benchmark lpCompare with number and caching"
" "\""
) ")"
; ""
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
long "long"
long "long"
init_declarator
identifier "start"
= "="
call_expression
identifier "usec"
argument_list
( "("
) ")"
; ";"
for_statement
for "for"
( "("
declaration
primitive_type "int"
init_declarator
identifier "i"
= "="
number_literal "0"
; ";"
binary_expression
identifier "i"
< "<"
number_literal "2000"
; ";"
update_expression
identifier "i"
++ "++"
) ")"
compound_statement
{ "{"
declaration
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "eptr"
= "="
call_expression
identifier "lpSeek"
argument_list
( "("
identifier "lp"
, ","
number_literal "0"
) ")"
; ";"
declaration
sized_type_specifier
long "long"
long "long"
init_declarator
identifier "cached_val"
= "="
number_literal "0"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "cached_valid"
= "="
number_literal "0"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "eptr"
!= "!="
null
NULL "NULL"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "lpCompare"
argument_list
( "("
identifier "eptr"
, ","
cast_expression
( "("
type_descriptor
sized_type_specifier
unsigned "unsigned"
primitive_type "char"
abstract_pointer_declarator
* "*"
) ")"
string_literal
" "\""
string_content "99999"
" "\""
, ","
number_literal "5"
, ","
pointer_expression
& "&"
identifier "cached_val"
, ","
pointer_expression
& "&"
identifier "cached_valid"
) ")"
; ";"
expression_statement
assignment_expression
identifier "eptr"
= "="
call_expression
identifier "lpNext"
argument_list
( "("
identifier "lp"
, ","
identifier "eptr"
) ")"
; ";"
} "}"
} "}"
expression_statement
call_expression
identifier "printf"
argument_list
( "("
string_literal
" "\""
string_content "Done. usec=%lld"
escape_sequence "\\n"
" "\""
, ","
binary_expression
call_expression
identifier "usec"
argument_list
( "("
) ")"
- "-"
identifier "start"
) ")"
; ";"
} "}"
expression_statement
call_expression
identifier "lpFree"
argument_list
( "("
identifier "lp"
) ")"
; ";"
} "}"
return_statement
return "return"
number_literal "0"
; ";"
} "}"
#endif "#endif"