PATH:
usr
/
include
#ifdef __cplusplus extern "C" { #endif /* * gdcache.h * * Caches of pointers to user structs in which the least-recently-used * element is replaced in the event of a cache miss after the cache has * reached a given size. * * John Ellson (ellson@graphviz.org) Oct 31, 1997 * * Test this with: * gcc -o gdcache -g -Wall -DTEST gdcache.c * * The cache is implemented by a singly-linked list of elements * each containing a pointer to a user struct that is being managed by * the cache. * * The head structure has a pointer to the most-recently-used * element, and elements are moved to this position in the list each * time they are used. The head also contains pointers to three * user defined functions: * - a function to test if a cached userdata matches some keydata * - a function to provide a new userdata struct to the cache * if there has been a cache miss. * - a function to release a userdata struct when it is * no longer being managed by the cache * * In the event of a cache miss the cache is allowed to grow up to * a specified maximum size. After the maximum size is reached then * the least-recently-used element is discarded to make room for the * new. The most-recently-returned value is always left at the * beginning of the list after retrieval. * * In the current implementation the cache is traversed by a linear * search from most-recent to least-recent. This linear search * probably limits the usefulness of this implementation to cache * sizes of a few tens of elements. */ /*********************************************************/ /* header */ /*********************************************************/ #include <stdlib.h> #ifndef NULL # define NULL (void *)0 #endif /* user defined function templates */ typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); typedef void (*gdCacheReleaseFn_t)(void *userdata); /* element structure */ typedef struct gdCache_element_s gdCache_element_t; struct gdCache_element_s { gdCache_element_t *next; void *userdata; }; /* head structure */ typedef struct gdCache_head_s gdCache_head_t; struct gdCache_head_s { gdCache_element_t *mru; int size; char *error; gdCacheTestFn_t gdCacheTest; gdCacheFetchFn_t gdCacheFetch; gdCacheReleaseFn_t gdCacheRelease; }; /* function templates */ gdCache_head_t *gdCacheCreate(int size, gdCacheTestFn_t gdCacheTest, gdCacheFetchFn_t gdCacheFetch, gdCacheReleaseFn_t gdCacheRelease ); void gdCacheDelete(gdCache_head_t *head); void *gdCacheGet(gdCache_head_t *head, void *keydata); #ifdef __cplusplus } #endif
[+]
..
[-] kdb.h
[edit]
[+]
xcb
[-] jerror.h
[edit]
[-] krad.h
[edit]
[-] re_comp.h
[edit]
[-] gettext-po.h
[edit]
[+]
libexslt
[-] fts.h
[edit]
[-] png.h
[edit]
[-] time.h
[edit]
[+]
rpc
[-] zconf.h
[edit]
[+]
netax25
[+]
netatalk
[-] stdint.h
[edit]
[-] term_entry.h
[edit]
[+]
drm
[+]
finclude
[+]
event2
[+]
neteconet
[-] cursesf.h
[edit]
[-] iconv.h
[edit]
[-] tiffvers.h
[edit]
[-] stringprep.h
[edit]
[-] cursesapp.h
[edit]
[-] getopt.h
[edit]
[+]
c++
[-] cpuidle.h
[edit]
[+]
krb5
[+]
openssl
[+]
uuid
[-] grp.h
[edit]
[-] bzlib.h
[edit]
[-] ulimit.h
[edit]
[-] dirent.h
[edit]
[+]
gssapi
[-] a.out.h
[edit]
[-] panel.h
[edit]
[-] keyutils.h
[edit]
[-] tgmath.h
[edit]
[-] netdb.h
[edit]
[+]
et
[-] gssapi.h
[edit]
[+]
X11
[-] gdcache.h
[edit]
[-] fenv.h
[edit]
[-] gdfx.h
[edit]
[+]
arpa
[-] ar.h
[edit]
[-] monetary.h
[edit]
[+]
security
[-] locale.h
[edit]
[-] wait.h
[edit]
[-] idn-free.h
[edit]
[-] tic.h
[edit]
[+]
fstrm
[-] etip.h
[edit]
[-] features.h
[edit]
[-] expat_config.h
[edit]
[-] aio.h
[edit]
[-] argz.h
[edit]
[-] values.h
[edit]
[+]
asm-generic
[-] stdc-predef.h
[edit]
[-] form.h
[edit]
[-] gnu-versions.h
[edit]
[-] curses.h
[edit]
[-] tiffconf-64.h
[edit]
[-] ncurses_dll.h
[edit]
[-] evhttp.h
[edit]
[+]
perf
[-] uchar.h
[edit]
[-] tar.h
[edit]
[+]
asm
[+]
webp
[+]
netinet
[-] envz.h
[edit]
[+]
e2p
[+]
gnu
[+]
ncursesw
[-] sysexits.h
[edit]
[+]
bits
[-] jconfig-64.h
[edit]
[-] tiffio.h
[edit]
[-] tiffio.hxx
[edit]
[-] tld.h
[edit]
[-] pcre2.h
[edit]
[-] string.h
[edit]
[-] pr29.h
[edit]
[+]
sound
[+]
python3.6m
[-] termcap.h
[edit]
[-] link.h
[edit]
[-] inttypes.h
[edit]
[-] gd.h
[edit]
[-] signal.h
[edit]
[-] nc_tparm.h
[edit]
[+]
misc
[-] math.h
[edit]
[-] malloc.h
[edit]
[-] lastlog.h
[edit]
[+]
protobuf-c
[-] libaio.h
[edit]
[-] threads.h
[edit]
[-] syslog.h
[edit]
[-] utmpx.h
[edit]
[-] stab.h
[edit]
[-] shadow.h
[edit]
[-] termios.h
[edit]
[-] stdio_ext.h
[edit]
[-] term.h
[edit]
[+]
net
[+]
netiucv
[-] gnumake.h
[edit]
[-] jpegint.h
[edit]
[-] cursslk.h
[edit]
[-] idn-int.h
[edit]
[-] gdfontl.h
[edit]
[-] pwd.h
[edit]
[-] gdfonts.h
[edit]
[-] pnglibconf.h
[edit]
[+]
kadm5
[-] elf.h
[edit]
[-] ctype.h
[edit]
[-] printf.h
[edit]
[-] profile.h
[edit]
[+]
libpng16
[-] strings.h
[edit]
[+]
nfs
[+]
gdbm
[-] sgtty.h
[edit]
[-] eti.h
[edit]
[-] err.h
[edit]
[-] mqueue.h
[edit]
[+]
rdma
[-] evrpc.h
[edit]
[-] alloca.h
[edit]
[-] gpg-error.h
[edit]
[-] com_err.h
[edit]
[-] gdbm.h
[edit]
[-] memory.h
[edit]
[+]
sys
[-] wctype.h
[edit]
[-] search.h
[edit]
[+]
mtd
[-] errno.h
[edit]
[-] endian.h
[edit]
[-] pcre2posix.h
[edit]
[-] punycode.h
[edit]
[-] jconfig.h
[edit]
[-] dbm.h
[edit]
[+]
python3.12
[-] evutil.h
[edit]
[-] stdio.h
[edit]
[-] entities.h
[edit]
[+]
GL
[-] gd_errors.h
[edit]
[+]
gssrpc
[+]
mysql
[-] gd_color_map.h
[edit]
[+]
netrom
[-] FlexLexer.h
[edit]
[-] gcrypt.h
[edit]
[-] gdfontg.h
[edit]
[-] paths.h
[edit]
[-] gd_io.h
[edit]
[+]
ncurses
[-] mntent.h
[edit]
[-] aliases.h
[edit]
[-] gshadow.h
[edit]
[-] error.h
[edit]
[-] ndbm.h
[edit]
[-] syscall.h
[edit]
[-] pngconf.h
[edit]
[+]
sepol
[-] menu.h
[edit]
[+]
ext2fs
[-] setjmp.h
[edit]
[+]
video
[-] limits.h
[edit]
[+]
netpacket
[-] ucontext.h
[edit]
[+]
xen
[-] proc_service.h
[edit]
[-] gconv.h
[edit]
[+]
netash
[-] regex.h
[edit]
[-] thread_db.h
[edit]
[+]
google
[-] assert.h
[edit]
[+]
netrose
[-] unistd.h
[edit]
[-] poll.h
[edit]
[-] tiff.h
[edit]
[-] pthread.h
[edit]
[-] nss.h
[edit]
[-] ieee754.h
[edit]
[-] byteswap.h
[edit]
[-] complex.h
[edit]
[-] libintl.h
[edit]
[+]
json-c
[-] pty.h
[edit]
[-] jpeglib.h
[edit]
[-] krb5.h
[edit]
[-] verto.h
[edit]
[-] cursesp.h
[edit]
[-] ftw.h
[edit]
[-] ttyent.h
[edit]
[+]
linux
[-] gdfontmb.h
[edit]
[+]
netipx
[-] lzma.h
[edit]
[-] argp.h
[edit]
[-] expat.h
[edit]
[-] langinfo.h
[edit]
[+]
freetype2
[-] fcntl.h
[edit]
[-] utmp.h
[edit]
[-] execinfo.h
[edit]
[+]
libxslt
[-] wchar.h
[edit]
[+]
scsi
[-] resolv.h
[edit]
[-] fpu_control.h
[edit]
[-] ifaddrs.h
[edit]
[-] mcheck.h
[edit]
[-] gpgrt.h
[edit]
[-] gdfontt.h
[edit]
[-] utime.h
[edit]
[-] cursesm.h
[edit]
[-] unctrl.h
[edit]
[-] sched.h
[edit]
[-] verto-module.h
[edit]
[-] ncurses.h
[edit]
[-] idna.h
[edit]
[-] fstrm.h
[edit]
[+]
bind9
[-] gdpp.h
[edit]
[-] glob.h
[edit]
[+]
selinux
[-] cpio.h
[edit]
[-] event.h
[edit]
[-] wordexp.h
[edit]
[-] fmtmsg.h
[edit]
[-] ltdl.h
[edit]
[-] crypt.h
[edit]
[-] termio.h
[edit]
[-] jmorecfg.h
[edit]
[-] evdns.h
[edit]
[-] regexp.h
[edit]
[-] autosprintf.h
[edit]
[+]
libltdl
[-] cursesw.h
[edit]
[+]
protocols
[+]
fontconfig
[-] zlib.h
[edit]
[-] expat_external.h
[edit]
[-] semaphore.h
[edit]
[-] fstab.h
[edit]
[+]
libxml2
[-] dlfcn.h
[edit]
[-] nl_types.h
[edit]
[-] spawn.h
[edit]
[-] stdlib.h
[edit]
[-] tiffconf.h
[edit]
[+]
lzma
[-] fnmatch.h
[edit]
[-] obstack.h
[edit]
[-] libgen.h
[edit]