text
stringlengths
24
1.04M
metadata
stringlengths
233
497
### File: doc/ZremCommand.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img style="border:n...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/ZremCommand.html", "license": "bsd", "size": 1824}
### File: doc/ZremrangebyrankCommand.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img styl...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/ZremrangebyrankCommand.html", "license": "bsd", "size": 1961}
### File: doc/ZremrangebyscoreCommand.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img sty...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/ZremrangebyscoreCommand.html", "license": "bsd", "size": 1787}
### File: doc/ZscoreCommand.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img style="border...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/ZscoreCommand.html", "license": "bsd", "size": 1727}
### File: doc/ZunionCommand.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img style="border...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/ZunionCommand.html", "license": "bsd", "size": 3505}
### File: doc/ZunionstoreCommand.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img style="b...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/ZunionstoreCommand.html", "license": "bsd", "size": 3506}
### File: doc/index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <div id="page"> <div id='header'> <a href="index.html"> <img style="border:none" a...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "HTML", "repo_name": "minhanghuang/redis", "path": "doc/index.html", "license": "bsd", "size": 6152}
### File: doc/style.css body { font-family: 'Verdana'; width:800px; } a { text-decoration: none; } h1, h2, h3, h4, h5 { color: #333; } h1 { font-size: 20px; } .codeblock { color: darkgreen; padding:5px; } h1.wikiname { color: #f55000; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/redis", "path": "doc/style.css", "license": "bsd", "size": 250}
### File: src/Makefile # Redis Makefile # Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com> # This file is released under the BSD license, see the COPYING file release_hdr := $(shell sh -c './mkreleasehdr.sh') uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') OPTIMIZATION?=-O2 CCCOLOR="\03...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/redis", "path": "src/Makefile", "license": "bsd", "size": 7854}
### File: src/adlist.c /* adlist.c - A generic doubly linked list implementation * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following cond...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/adlist.c", "license": "bsd", "size": 9528}
### File: src/adlist.h /* adlist.h - A generic doubly linked list implementation * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following cond...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/adlist.h", "license": "bsd", "size": 3420}
### File: src/ae.c /* A simple event-driven programming library. Originally I wrote this code * for the Jim's event-loop (Jim is a Tcl interpreter) but later translated * it in form of a library for easy reuse. * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ae.c", "license": "bsd", "size": 13203}
### File: src/ae.h /* A simple event-driven programming library. Originally I wrote this code * for the Jim's event-loop (Jim is a Tcl interpreter) but later translated * it in form of a library for easy reuse. * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ae.h", "license": "bsd", "size": 4380}
### File: src/ae_epoll.c /* Linux epoll(2) based ae.c module * Copyright (C) 2009-2010 Salvatore Sanfilippo - antirez@gmail.com * Released under the BSD license. See the COPYING file for more info. */ #include <sys/epoll.h> typedef struct aeApiState { int epfd; struct epoll_event events[AE_SETSIZE]; } aeApi...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ae_epoll.c", "license": "bsd", "size": 2845}
### File: src/ae_kqueue.c /* Kqueue(2)-based ae.c module * Copyright (C) 2009 Harish Mallipeddi - harish.mallipeddi@gmail.com * Released under the BSD license. See the COPYING file for more info. */ #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> typedef struct aeApiState { int kqfd; str...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ae_kqueue.c", "license": "bsd", "size": 2664}
### File: src/ae_select.c /* Select()-based ae.c module * Copyright (C) 2009-2010 Salvatore Sanfilippo - antirez@gmail.com * Released under the BSD license. See the COPYING file for more info. */ #include <string.h> typedef struct aeApiState { fd_set rfds, wfds; /* We need to have a copy of the fd sets as i...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ae_select.c", "license": "bsd", "size": 2151}
### File: src/anet.c /* anet.c -- Basic TCP socket stuff made a bit less boring * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condi...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/anet.c", "license": "bsd", "size": 9968}
### File: src/anet.h /* anet.c -- Basic TCP socket stuff made a bit less boring * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condi...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/anet.h", "license": "bsd", "size": 2507}
### File: src/aof.c #include "redis.h" #include <signal.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> /* Called when the user switches from "appendonly yes" to "appendonly no" * at runtime using the CONFIG command. */ void sto...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/aof.c", "license": "bsd", "size": 26706}
### File: src/config.c #include "redis.h" /*----------------------------------------------------------------------------- * Config file parsing *----------------------------------------------------------------------------*/ int yesnotoi(char *s) { if (!strcasecmp(s,"yes")) return 1; else if (!strcasecmp(s,"...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/config.c", "license": "bsd", "size": 27768}
### File: src/config.h #ifndef __CONFIG_H #define __CONFIG_H #ifdef __APPLE__ #include <AvailabilityMacros.h> #endif /* Use tcmalloc's malloc_size() when available. * When tcmalloc is used, native OSX malloc_size() may never be used because * this expects a different allocation scheme. Therefore, *exclusively* use ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/config.h", "license": "bsd", "size": 1549}
### File: src/db.c #include "redis.h" #include <signal.h> /*----------------------------------------------------------------------------- * C-level DB API *----------------------------------------------------------------------------*/ robj *lookupKey(redisDb *db, robj *key) { dictEntry *de = dictFind(db->dict,...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/db.c", "license": "bsd", "size": 16578}
### File: src/debug.c #include "redis.h" #include "sha1.h" /* SHA1 is used for DEBUG DIGEST */ #include <arpa/inet.h> /* ================================= Debugging ============================== */ /* Compute the sha1 of string at 's' with 'len' bytes long. * The SHA1 is then xored againt the string pointed by d...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/debug.c", "license": "bsd", "size": 11401}
### File: src/dict.c /* Hash Tables Implementation. * * This file implements in memory hash tables with insert/del/replace/find/ * get-random-element operations. Hash tables will auto resize if needed * tables of power of two in size are used, collisions are handled by * chaining. See the source code for more info...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/dict.c", "license": "bsd", "size": 22219}
### File: src/dict.h /* Hash Tables Implementation. * * This file implements in memory hash tables with insert/del/replace/find/ * get-random-element operations. Hash tables will auto resize if needed * tables of power of two in size are used, collisions are handled by * chaining. See the source code for more info...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/dict.h", "license": "bsd", "size": 5900}
### File: src/fmacros.h #ifndef _REDIS_FMACRO_H #define _REDIS_FMACRO_H #define _BSD_SOURCE #if defined(__linux__) || defined(__OpenBSD__) #define _XOPEN_SOURCE 700 #else #define _XOPEN_SOURCE #endif #define _LARGEFILE_SOURCE #define _FILE_OFFSET_BITS 64 #endif
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/fmacros.h", "license": "bsd", "size": 242}
### File: src/intset.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "intset.h" #include "zmalloc.h" /* Note that these encodings are ordered, so: * INTSET_ENC_INT16 < INTSET_ENC_INT32 < INTSET_ENC_INT64. */ #define INTSET_ENC_INT16 (sizeof(int16_t)) #define INTSET_ENC_INT32 (sizeof(int32_t)) #d...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/intset.c", "license": "bsd", "size": 12904}
### File: src/intset.h #ifndef __INTSET_H #define __INTSET_H #include <stdint.h> typedef struct intset { uint32_t encoding; uint32_t length; int8_t contents[]; } intset; intset *intsetNew(void); intset *intsetAdd(intset *is, int64_t value, uint8_t *success); intset *intsetRemove(intset *is, int64_t value,...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/intset.h", "license": "bsd", "size": 509}
### File: src/lzf.h /* * Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de> * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/lzf.h", "license": "bsd", "size": 4413}
### File: src/lzfP.h /* * Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de> * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copy...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/lzfP.h", "license": "bsd", "size": 5152}
### File: src/lzf_c.c /* * Copyright (c) 2000-2008 Marc Alexander Lehmann <schmorp@schmorp.de> * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above cop...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/lzf_c.c", "license": "bsd", "size": 8859}
### File: src/lzf_d.c /* * Copyright (c) 2000-2007 Marc Alexander Lehmann <schmorp@schmorp.de> * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above cop...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/lzf_d.c", "license": "bsd", "size": 4304}
### File: src/mkreleasehdr.sh #!/bin/sh GIT_SHA1=`(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1` GIT_DIRTY=`git diff 2> /dev/null | wc -l` test -f release.h || touch release.h (cat release.h | grep SHA1 | grep $GIT_SHA1) && \ (cat release.h | grep DIRTY | grep $GIT_DIRTY) && exit 0 # Already u...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/redis", "path": "src/mkreleasehdr.sh", "license": "bsd", "size": 460}
### File: src/multi.c #include "redis.h" /* ================================ MULTI/EXEC ============================== */ /* Client state initialization for MULTI/EXEC */ void initClientMultiState(redisClient *c) { c->mstate.commands = NULL; c->mstate.count = 0; } /* Release all the resources associated with...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/multi.c", "license": "bsd", "size": 8655}
### File: src/networking.c #include "redis.h" #include <sys/uio.h> void *dupClientReplyValue(void *o) { incrRefCount((robj*)o); return o; } int listMatchObjects(void *a, void *b) { return equalStringObjects(a,b); } redisClient *createClient(int fd) { redisClient *c = zmalloc(sizeof(redisClient)); ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/networking.c", "license": "bsd", "size": 29334}
### File: src/object.c #include "redis.h" #include <pthread.h> #include <math.h> robj *createObject(int type, void *ptr) { robj *o = zmalloc(sizeof(*o)); o->type = type; o->encoding = REDIS_ENCODING_RAW; o->ptr = ptr; o->refcount = 1; /* Set the LRU to the current lruclock (minutes resolution)...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/object.c", "license": "bsd", "size": 14988}
### File: src/pqsort.c /* The following is the NetBSD libc qsort implementation modified in order to * support partial sorting of ranges for Redis. * * Copyright(C) 2009-2010 Salvatore Sanfilippo. All rights reserved. * * The original copyright notice follows. */ /* $NetBSD: qsort.c,v 1.19 2009/01/30 23:38:44 lu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/pqsort.c", "license": "bsd", "size": 5875}
### File: src/pqsort.h /* The following is the NetBSD libc qsort implementation modified in order to * support partial sorting of ranges for Redis. * * Copyright(C) 2009-2010 Salvatore Sanfilippo. All rights reserved. * * See the pqsort.c file for the original copyright notice. */ #ifndef __PQSORT_H #define __PQS...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/pqsort.h", "license": "bsd", "size": 430}
### File: src/pubsub.c #include "redis.h" /*----------------------------------------------------------------------------- * Pubsub low level API *----------------------------------------------------------------------------*/ void freePubsubPattern(void *p) { pubsubPattern *pat = p; decrRefCount(pat->patter...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/pubsub.c", "license": "bsd", "size": 8602}
### File: src/rdb.c #include "redis.h" #include "lzf.h" /* LZF compression library */ #include <math.h> #include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> #include <sys/wait.h> #include <arpa/inet.h> #include <sys/stat.h> /* Convenience wrapper around fwrite, that returns the number of bytes wr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/rdb.c", "license": "bsd", "size": 34976}
### File: src/redis-benchmark.c /* Redis benchmark utility. * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * *...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/redis-benchmark.c", "license": "bsd", "size": 17436}
### File: src/redis-check-aof.c #include "fmacros.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> #include "config.h" #define ERROR(...) { \ char __buf[1024]; \ sprintf(__buf, __VA_ARGS__); \ sprintf(error, "0x%08lx: %s", epos, __buf); \ } static cha...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/redis-check-aof.c", "license": "bsd", "size": 4447}
### File: src/redis-check-dump.c #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/mman.h> #include <string.h> #include <arpa/inet.h> #include <stdint.h> #include <limits.h> #include "lzf.h" /* Object types */ #define REDIS_STRING 0 #define REDIS_LIST 1 #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/redis-check-dump.c", "license": "bsd", "size": 18606}
### File: src/redis-cli.c /* Redis CLI (command line interface) * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/redis-cli.c", "license": "bsd", "size": 25385}
### File: src/redis.c /* * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code mu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/redis.c", "license": "bsd", "size": 63462}
### File: src/redis.h #ifndef __REDIS_H #define __REDIS_H #include "fmacros.h" #include "config.h" #if defined(__sun) #include "solarisfixes.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <limits.h> #include <unistd.h> #include <errno.h> #include <inttypes.h> #include...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/redis.h", "license": "bsd", "size": 40472}
### File: src/release.c /* Every time the Redis Git SHA1 or Dirty status changes only this file * small file is recompiled, as we access this information in all the other * files using this functions. */ #include "release.h" char *redisGitSHA1(void) { return REDIS_GIT_SHA1; } char *redisGitDirty(void) { re...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/release.c", "license": "bsd", "size": 320}
### File: src/replication.c #include "redis.h" #include <sys/time.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> /* ---------------------------------- MASTER -------------------------------- */ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) { listNode *ln; listIt...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/replication.c", "license": "bsd", "size": 21393}
### File: src/sds.c /* SDSLib, A C dynamic strings library * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/sds.c", "license": "bsd", "size": 18283}
### File: src/sds.h /* SDSLib, A C dynamic strings library * * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/sds.h", "license": "bsd", "size": 2833}
### File: src/sha1.c /* from valgrind tests */ /* ================ sha1.c ================ */ /* SHA-1 in C By Steve Reid <steve@edmweb.com> 100% Public Domain Test Vectors (from FIPS PUB 180-1) "abc" A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 84983E44...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/sha1.c", "license": "bsd", "size": 8847}
### File: src/sha1.h /* ================ sha1.h ================ */ /* SHA-1 in C By Steve Reid <steve@edmweb.com> 100% Public Domain */ typedef struct { u_int32_t state[5]; u_int32_t count[2]; unsigned char buffer[64]; } SHA1_CTX; void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64]); vo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/sha1.h", "license": "bsd", "size": 470}
### File: src/slowlog.c #include "redis.h" #include "slowlog.h" /* Slowlog implements a system that is able to remember the latest N * queries that took more than M microseconds to execute. * * The execution time to reach to be logged in the slow log is set * using the 'slowlog-log-slower-than' config directive, t...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/slowlog.c", "license": "bsd", "size": 3911}
### File: src/slowlog.h /* This structure defines an entry inside the slow log list */ typedef struct slowlogEntry { robj **argv; int argc; long long id; /* Unique entry identifier. */ long long duration; /* Time spent by the query, in nanoseconds. */ time_t time; /* Unix time at which ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/slowlog.h", "license": "bsd", "size": 519}
### File: src/solarisfixes.h /* Solaris specific fixes */ #if defined(__GNUC__) #include <math.h> #undef isnan #define isnan(x) \ __extension__({ __typeof (x) __x_a = (x); \ __builtin_expect(__x_a != __x_a, 0); }) #undef isfinite #define isfinite(x) \ __extension__ ({ __typeof (x) __x_f = (x); \ _...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/solarisfixes.h", "license": "bsd", "size": 553}
### File: src/sort.c #include "redis.h" #include "pqsort.h" /* Partial qsort for SORT+LIMIT */ redisSortOperation *createSortOperation(int type, robj *pattern) { redisSortOperation *so = zmalloc(sizeof(*so)); so->type = type; so->pattern = pattern; return so; } /* Return the value associated to the ke...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/sort.c", "license": "bsd", "size": 14204}
### File: src/syncio.c /* Synchronous socket and file I/O operations useful across the core. * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the fo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/syncio.c", "license": "bsd", "size": 5451}
### File: src/t_hash.c #include "redis.h" #include <math.h> /*----------------------------------------------------------------------------- * Hash type API *----------------------------------------------------------------------------*/ /* Check the length of a number of objects to see if we need to convert a * zi...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/t_hash.c", "license": "bsd", "size": 15061}
### File: src/t_list.c #include "redis.h" /*----------------------------------------------------------------------------- * List API *----------------------------------------------------------------------------*/ /* Check the argument length to see if it requires us to convert the ziplist * to a real list. Only ch...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/t_list.c", "license": "bsd", "size": 34313}
### File: src/t_set.c #include "redis.h" /*----------------------------------------------------------------------------- * Set Commands *----------------------------------------------------------------------------*/ /* Factory method to return a set that *can* hold "value". When the object has * an integer-encodab...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/t_set.c", "license": "bsd", "size": 20526}
### File: src/t_string.c #include "redis.h" /*----------------------------------------------------------------------------- * String Commands *----------------------------------------------------------------------------*/ static int checkStringLength(redisClient *c, long long size) { if (size > 512*1024*1024) {...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/t_string.c", "license": "bsd", "size": 12484}
### File: src/t_zset.c #include "redis.h" #include <math.h> /*----------------------------------------------------------------------------- * Sorted set API *----------------------------------------------------------------------------*/ /* ZSETs are ordered sets using two data structures to hold the same elements ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/t_zset.c", "license": "bsd", "size": 35763}
### File: src/testhelp.h /* This is a really minimal testing framework for C. * * Example: * * test_cond("Check if 1 == 1", 1==1) * test_cond("Check if 5 > 10", 5 > 10) * test_report() * * Copyright (c) 2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/testhelp.h", "license": "bsd", "size": 2324}
### File: src/util.c #include "redis.h" #include <ctype.h> #include <limits.h> #include <sys/time.h> /* Glob-style pattern matching. */ int stringmatchlen(const char *pattern, int patternLen, const char *string, int stringLen, int nocase) { while(patternLen) { switch(pattern[0]) { case '*':...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/util.c", "license": "bsd", "size": 7613}
### File: src/version.h #define REDIS_VERSION "2.2.15"
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/version.h", "license": "bsd", "size": 31}
### File: src/vm.c #include "redis.h" #include <fcntl.h> #include <pthread.h> #include <math.h> #include <signal.h> /* Virtual Memory is composed mainly of two subsystems: * - Blocking Virutal Memory * - Threaded Virtual Memory I/O * The two parts are not fully decoupled, but functions are split among two * diffe...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/vm.c", "license": "bsd", "size": 42194}
### File: src/ziplist.c /* The ziplist is a specially encoded dually linked list that is designed * to be very memory efficient. It stores both strings and integer values, * where integers are encoded as actual integers instead of a series of * characters. It allows push and pop operations on either side of the list...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ziplist.c", "license": "bsd", "size": 42824}
### File: src/ziplist.h #define ZIPLIST_HEAD 0 #define ZIPLIST_TAIL 1 unsigned char *ziplistNew(void); unsigned char *ziplistPush(unsigned char *zl, unsigned char *s, unsigned int slen, int where); unsigned char *ziplistIndex(unsigned char *zl, int index); unsigned char *ziplistNext(unsigned char *zl, unsigned char *p...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/ziplist.h", "license": "bsd", "size": 903}
### File: src/zipmap.c /* String -> String Map data structure optimized for size. * This file implements a data structure mapping strings to other strings * implementing an O(n) lookup data structure designed to be very memory * efficient. * * The Redis Hash type uses this data structure for hashes composed of a s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/zipmap.c", "license": "bsd", "size": 16470}
### File: src/zipmap.h /* String -> String Map data structure optimized for size. * * See zipmap.c for more info. * * -------------------------------------------------------------------------- * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/zipmap.h", "license": "bsd", "size": 2544}
### File: src/zmalloc.c /* zmalloc - total amount of allocated memory aware version of malloc() * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/zmalloc.c", "license": "bsd", "size": 7729}
### File: src/zmalloc.h /* zmalloc - total amount of allocated memory aware version of malloc() * * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/redis", "path": "src/zmalloc.h", "license": "bsd", "size": 2048}
### File: tests/integration/aof.tcl set defaults { appendonly {yes} appendfilename {appendonly.aof} } set server_path [tmpdir server.aof] set aof_path "$server_path/appendonly.aof" proc append_to_aof {str} { upvar fp fp puts -nonewline $fp $str } proc create_aof {code} { upvar fp fp aof_path aof_path ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/integration/aof.tcl", "license": "bsd", "size": 4037}
### File: tests/integration/redis-cli.tcl start_server {tags {"cli"}} { proc open_cli {} { set ::env(TERM) dumb set fd [open [format "|src/redis-cli -p %d -n 9" [srv port]] "r+"] fconfigure $fd -buffering none fconfigure $fd -blocking false fconfigure $fd -translation binary ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/integration/redis-cli.tcl", "license": "bsd", "size": 6018}
### File: tests/integration/replication.tcl start_server {tags {"repl"}} { start_server {} { test {First server should have role slave after SLAVEOF} { r -1 slaveof [srv 0 host] [srv 0 port] after 1000 s -1 role } {slave} test {BRPOPLPUSH replication, whe...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/integration/replication.tcl", "license": "bsd", "size": 3313}
### File: tests/support/redis.tcl # Tcl clinet library - used by test-redis.tcl script for now # Copyright (C) 2009 Salvatore Sanfilippo # Released under the BSD license like Redis itself # # Example usage: # # set r [redis 127.0.0.1 6379] # $r lpush mylist foo # $r lpush mylist bar # $r lrange mylist 0 -1 # $r close #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/support/redis.tcl", "license": "bsd", "size": 7332}
### File: tests/support/server.tcl set ::global_overrides {} set ::tags {} proc error_and_quit {config_file error} { puts "!!COULD NOT START REDIS-SERVER\n" puts "CONFIGURATION:" puts [exec cat $config_file] puts "\nERROR:" puts [string trim $error] exit 1 } proc check_valgrind_errors stderr {...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/support/server.tcl", "license": "bsd", "size": 8181}
### File: tests/support/test.tcl set ::num_tests 0 set ::num_passed 0 set ::num_failed 0 set ::tests_failed {} proc assert {condition} { if {![uplevel 1 expr $condition]} { error "assertion:Expected '$value' to be true" } } proc assert_match {pattern value} { if {![string match $pattern $value]} {...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/support/test.tcl", "license": "bsd", "size": 5173}
### File: tests/support/tmpfile.tcl set ::tmpcounter 0 set ::tmproot "./tests/tmp" file mkdir $::tmproot # returns a dirname unique to this process to write to proc tmpdir {basename} { set dir [file join $::tmproot $basename.[pid].[incr ::tmpcounter]] file mkdir $dir set _ $dir } # return a filename uniqu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/support/tmpfile.tcl", "license": "bsd", "size": 403}
### File: tests/support/util.tcl proc randstring {min max {type binary}} { set len [expr {$min+int(rand()*($max-$min+1))}] set output {} if {$type eq {binary}} { set minval 0 set maxval 255 } elseif {$type eq {alpha}} { set minval 48 set maxval 122 } elseif {$type eq ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/support/util.tcl", "license": "bsd", "size": 7851}
### File: tests/test_helper.tcl # Redis test suite. Copyright (C) 2009 Salvatore Sanfilippo antirez@gmail.com # This softare is released under the BSD License. See the COPYING file for # more information. set tcl_precision 17 source tests/support/redis.tcl source tests/support/server.tcl source tests/support/tmpfile.t...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/test_helper.tcl", "license": "bsd", "size": 6123}
### File: tests/unit/auth.tcl start_server {tags {"auth"} overrides {requirepass foobar}} { test {AUTH fails when a wrong password is given} { catch {r auth wrong!} err format $err } {ERR*invalid password} test {Arbitrary command gives an error when AUTH is required} { catch {r ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/auth.tcl", "license": "bsd", "size": 459}
### File: tests/unit/basic.tcl start_server {tags {"basic"}} { test {DEL all keys to start with a clean DB} { foreach key [r keys *] {r del $key} r dbsize } {0} test {SET and GET an item} { r set x foobar r get x } {foobar} test {SET and GET an empty item} { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/basic.tcl", "license": "bsd", "size": 17395}
### File: tests/unit/cas.tcl start_server {tags {"cas"}} { test {EXEC works on WATCHed key not modified} { r watch x y z r watch k r multi r ping r exec } {PONG} test {EXEC fail on WATCHed key modified (1 key of 1 watched)} { r set x 30 r watch x ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/cas.tcl", "license": "bsd", "size": 2593}
### File: tests/unit/expire.tcl start_server {tags {"expire"}} { test {EXPIRE - set timeouts multiple times} { r set x foobar set v1 [r expire x 5] set v2 [r ttl x] set v3 [r expire x 10] set v4 [r ttl x] r expire x 4 list $v1 $v2 $v3 $v4 } {1 5 1 10} ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/expire.tcl", "license": "bsd", "size": 1760}
### File: tests/unit/other.tcl start_server {tags {"other"}} { test {SAVE - make sure there are all the types as values} { # Wait for a background saving in progress to terminate waitForBgsave r r lpush mysavelist hello r lpush mysavelist world r set myemptykey {} r s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/other.tcl", "license": "bsd", "size": 6599}
### File: tests/unit/printver.tcl start_server {} { set i [r info] regexp {redis_version:(.*?)\r\n} $i - version regexp {redis_git_sha1:(.*?)\r\n} $i - sha1 puts "Testing Redis version $version ($sha1)" }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/printver.tcl", "license": "bsd", "size": 187}
### File: tests/unit/protocol.tcl start_server {tags {"protocol"}} { test "Handle an empty query" { reconnect r write "\r\n" r flush assert_equal "PONG" [r ping] } test "Negative multibulk length" { reconnect r write "*-10\r\n" r flush assert_...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/protocol.tcl", "license": "bsd", "size": 1631}
### File: tests/unit/pubsub.tcl start_server {tags {"pubsub"}} { proc __consume_subscribe_messages {client type channels} { set numsub -1 set counts {} for {set i [llength $channels]} {$i > 0} {incr i -1} { set msg [$client read] assert_equal $type [lindex $msg 0] ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/pubsub.tcl", "license": "bsd", "size": 6413}
### File: tests/unit/quit.tcl start_server {tags {"quit"}} { proc format_command {args} { set cmd "*[llength $args]\r\n" foreach a $args { append cmd "$[string length $a]\r\n$a\r\n" } set _ $cmd } test "QUIT returns OK" { reconnect assert_equal OK...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/quit.tcl", "license": "bsd", "size": 986}
### File: tests/unit/slowlog.tcl start_server {tags {"slowlog"}} { test {SLOWLOG - check that it starts with an empty log} { r slowlog len } {0} test {SLOWLOG - only logs commands taking more time than specified} { r config set slowlog-log-slower-than 100000 r ping assert_eq...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/slowlog.tcl", "license": "bsd", "size": 1209}
### File: tests/unit/sort.tcl start_server { tags {"sort"} overrides { "list-max-ziplist-value" 16 "list-max-ziplist-entries" 32 "set-max-intset-entries" 32 } } { proc create_random_dataset {num cmd} { set tosort {} set result {} array set seenrand {} ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/sort.tcl", "license": "bsd", "size": 6081}
### File: tests/unit/type/hash.tcl start_server {tags {"hash"}} { test {HSET/HLEN - Small hash creation} { array set smallhash {} for {set i 0} {$i < 8} {incr i} { set key [randstring 0 8 alpha] set val [randstring 0 8 alpha] if {[info exists smallhash($key)]} { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/type/hash.tcl", "license": "bsd", "size": 10061}
### File: tests/unit/type/list.tcl start_server { tags {"list"} overrides { "list-max-ziplist-value" 16 "list-max-ziplist-entries" 256 } } { # We need a value larger than list-max-ziplist-value to make sure # the list has the right encoding when it is swapped in again. array set ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/type/list.tcl", "license": "bsd", "size": 27614}
### File: tests/unit/type/set.tcl start_server { tags {"set"} overrides { "set-max-intset-entries" 512 } } { proc create_set {key entries} { r del $key foreach entry $entries { r sadd $key $entry } } test {SADD, SCARD, SISMEMBER, SMEMBERS basics - regular set} { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/type/set.tcl", "license": "bsd", "size": 11511}
### File: tests/unit/type/zset.tcl start_server {tags {"zset"}} { proc create_zset {key items} { r del $key foreach {score entry} $items { r zadd $key $score $entry } } test {ZSET basic ZADD and score update} { r zadd ztmp 10 x r zadd ztmp 20 y r ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "tests/unit/type/zset.tcl", "license": "bsd", "size": 20353}
### File: utils/build-static-symbols.tcl # Build a symbol table for static symbols of redis.c # Useful to get stack traces on segfault without a debugger. See redis.c # for more information. # # Copyright(C) 2009 Salvatore Sanfilippo, under the BSD license. set fd [open redis.c] set symlist {} while {[gets $fd line] !...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Tcl", "repo_name": "minhanghuang/redis", "path": "utils/build-static-symbols.tcl", "license": "bsd", "size": 593}
### File: utils/generate-command-help.rb #!/usr/bin/env ruby GROUPS = [ "generic", "string", "list", "set", "sorted_set", "hash", "pubsub", "transactions", "connection", "server" ].freeze GROUPS_BY_NAME = Hash[* GROUPS.each_with_index.map do |n,i| [n,i] end.flatten ].freeze def argument a...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Ruby", "repo_name": "minhanghuang/redis", "path": "utils/generate-command-help.rb", "license": "bsd", "size": 2072}
### File: utils/mktarball.sh #!/bin/sh if [ "$1" = "" ] then echo "Usage: mktarball.sh <git tag, branch or commit>" echo "Example: mktarball.sh 2.2-rc4" exit 1 fi PREFIX="redis-${1}/" TARBALL="/tmp/redis-${1}.tar.gz" git archive --format=tar --prefix=$PREFIX $1 | gzip -c > $TARBALL echo "File created: $TA...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/redis", "path": "utils/mktarball.sh", "license": "bsd", "size": 298}
### File: utils/redis-copy.rb # redis-copy.rb - Copyright (C) 2009-2010 Salvatore Sanfilippo # BSD license, See the COPYING file for more information. # # Copy the whole dataset from one Redis instance to another one # # WARNING: currently hashes and sorted sets are not supported! This # program should be upda...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Ruby", "repo_name": "minhanghuang/redis", "path": "utils/redis-copy.rb", "license": "bsd", "size": 2280}