Language: C
Typedefs: foo_t
Functions: stuff_with_underscores()
Brackets: linux-style ('\n' before '{')
Language: C++
Typedefs for primtive types: foo_t
Class declarations: class FooBar ...
Functions: stuff_with_underscores()
Methods: stuff_with_underscores()
Brackets: linux-style ('\n' before '{')
Name:
Anonymous2010-07-31 13:55
anus.h:
#ifndef ANUS_H_
#define ANUS_H_
typedef struct Anus {
int is_dilated;
float relaxation_level;
time_t time_inserted;
} Anus;
// :TODO: If the buttplug is removed before the anus becomes dilated, the relaxation level should drop, taking into account the amount of time the buttplug was outside of the anus.
// The buttplug must remain inserted for 2 minutes for the anus to become dilated.
#define DILATION_TIME 120
void anus_insert_buttplug(Anus *anus) {
// :TODO: check to ensure that a buttplug has not already been inserted[i]![/i]
anus->time_inserted = time(NULL);
}
void anus_remove_buttplug(Anus *anus) {
time_t time_diff;
if (anus->time_inserted) {
time_diff = time(NULL) - anus->time_inserted;
anus->relaxation_level += time_diff / DILATION_TIME;
if (anus->relaxation_level >= 1.0) {
anus->is_dilated = 1;
}
} else {
printf("There is no buttplug to remove!\n");
}
}