2024-05-22 10:58:01 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
int strlen(char *s)
|
|
|
|
{
|
|
|
|
char *p = s;
|
|
|
|
while (*p != '\0')
|
|
|
|
p++;
|
|
|
|
return p - s;
|
|
|
|
}
|
|
|
|
|
|
|
|
void strcpy(char *s, char *t)
|
|
|
|
{
|
|
|
|
while (*s++ = *t++);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define ALLOCSIZE 10000
|
|
|
|
|
|
|
|
static char allocbuf[ALLOCSIZE];
|
|
|
|
static char *allocp = allocbuf;
|
|
|
|
|
|
|
|
char *alloc(int n)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (n % 4 != 0) {
|
|
|
|
n += 4 - (n % 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (allocbuf + ALLOCSIZE - allocp >= n) {
|
|
|
|
allocp += n;
|
|
|
|
return allocp - n;
|
|
|
|
} else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
|
|
|
|
2024-05-22 11:11:23 +00:00
|
|
|
struct key{
|
|
|
|
char *word;
|
|
|
|
int8_t count;
|
|
|
|
} keytab[10];
|
2024-05-22 10:58:01 +00:00
|
|
|
|
2024-05-22 11:11:23 +00:00
|
|
|
struct key * Ptr = (struct key *) alloc(100);
|
2024-05-22 10:58:01 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|