File: frequent.h

package info (click to toggle)
cups-filters 1.28.7-1%2Bdeb11u2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,188 kB
  • sloc: ansic: 54,362; cpp: 6,990; sh: 6,390; makefile: 946; xml: 127; perl: 73; php: 28; python: 8
file content (17 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _FREQUENT_H
#define _FREQUENT_H

#include <stdint.h>

typedef struct _FREQUENT FREQUENT;

// size is the precision/return size: it will find at most >size elements (i.e. all, if there) with frequency > 1/(size+1)
FREQUENT *frequent_new(int size); // - just free() it

void frequent_add(FREQUENT *freq,intptr_t key);

// might return INTPTR_MIN, if not populated
// this is only an approximation!
intptr_t frequent_get(FREQUENT *freq,int pos); // 0 is "most frequent"

#endif