elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elkscmd
/
busyelks
/
lib
/
bsearch.c
File editor
#include "lib.h" #define ptr(base, size, i) ((const void *)(((unsigned char *)(base)) + ((i) * (size)))) void * bsearch(const void * key, const void * base, size_t nmemb, size_t size, int (* compar)(const void *, const void *)) { if(nmemb) { size_t i = nmemb >> 1; void const * p = ptr(base, size, i); int k = compar(key, p); if(k) { if(k < 0) return bsearch(key, base, i, size, compar); else return bsearch(key, ((unsigned char *)p) + size, nmemb - (i + 1), size, compar); } return (void *)p; } return NULL; }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history