33 lines
545 B
C
33 lines
545 B
C
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
|
|
int eprintf(const char format[], ...) {
|
|
va_list args;
|
|
va_start(args, format);
|
|
int ret = vfprintf(stderr, format, args);
|
|
va_end(args);
|
|
return ret;
|
|
}
|
|
|
|
void ungetchar(int ch) {
|
|
ungetc(ch, stdin);
|
|
}
|
|
|
|
int eof() {
|
|
return feof(stdin);
|
|
}
|
|
|
|
int CA_get(char array[], int index) {
|
|
return array[index];
|
|
}
|
|
|
|
void CA_set(char array[], int index, int value) {
|
|
array[index] = value;
|
|
}
|
|
|
|
// this may be unnecessary
|
|
char* CA_offset(char array[], int offset) {
|
|
return array + offset;
|
|
}
|