#ifndef _FUSES_H_53b531b4_ #define _FUSES_H_53b531b4_ /* * APIs exported by fuses.c. * * fuses.c implements fuses. A "fuse" is a way of representing "$THING * should happen at $TIME". * * Fuses have IDs. An ID is a small integer which represents the fuse * in the API (at this writing cancelfuse() is the only API taking * IDs). */ #include "structs.h" /* * Find the next-expiring fuse and make it expire, advancing time * correspondingly. */ extern void tick(void); /* * Initialize the FUSE system. Called once at startup. */ extern void initfuses(void); /* * Three variants of add-a-new-fuse. Each one takes a callback and two * arguments for it as its first three args. _abs takes an absolute * TIME at which the fuse shoukld expire; _rel takes a relative time; * and _rtu takes ticks and uticks as separate arguments. Each one * returns an ID for the new fuse. */ extern int addfuse_abs(void (*)(long int, void *), long int, void *, TIME); extern int addfuse_rel(void (*)(long int, void *), long int, void *, TIME); extern int addfuse_rtu(void (*)(long int, void *), long int, void *, unsigned long int, unsigned long int); /* * Cancel an existing fuse. Argument is the fuse ID. */ extern void cancelfuse(int); #endif