Mercurial > pidgin
annotate sounds/au2h.c @ 243:3414ff74cb0f
[gaim-migrate @ 253]
Sat May 20 09:56:16 UTC 2000 EWarmenhoven
- That 2 second delay in updates is gone, and I think it's actually
faster than the TOC code now.
- I figured out why it was segfaulting. I'm stupid sometimes.
- I figured out why the idle times were appearing bizarrely. Once
again, I'm stupid sometimes.
- You can now be idle
- You can now get a user's info (sort of - use the debug window) (still
no away messages though....)
- You can now be away
- You can now set your info (but not your dir info - yet)
- I think it's almost at a point where it's ready for use.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 20 May 2000 10:03:16 +0000 |
parents | bc117fbcf527 |
children | 7ac742be351d |
rev | line source |
---|---|
1 | 1 #include <stdio.h> |
2 #if !(__GLIBC__ < 2) | |
3 #include <error.h> | |
4 #endif | |
5 #include <fcntl.h> | |
200
bc117fbcf527
[gaim-migrate @ 210]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
10
diff
changeset
|
6 #include <unistd.h> |
1 | 7 |
8 #define BUF_SIZE 10 | |
9 | |
10 int main(int argc, char *argv[]) | |
11 { | |
12 int fd; | |
13 FILE *f; | |
14 int res,x; | |
15 char buf[BUF_SIZE]; | |
16 | |
17 fd = open(argv[1], O_RDONLY); | |
18 if (fd < 0) { | |
19 perror("open"); | |
20 exit(1); | |
21 } | |
22 f = fopen(argv[2], "w+"); | |
23 if (!f) { | |
24 perror("fopen"); | |
25 exit(1); | |
26 } | |
27 argv[1][strlen(argv[1])-3]='\0'; | |
28 fprintf(f, "static unsigned char %s[] = {\n", argv[1]); | |
29 read(fd, buf, 8); /* id & offset */ | |
30 read(fd, buf, 8); /* len & encoding */ | |
31 read(fd, buf, 8); /* rate & count */ | |
32 /* no more click :) */ | |
33 | |
34 while((res = read(fd, buf, BUF_SIZE)) > 0) { | |
35 for (x=0;x<res;x++) | |
36 fprintf(f, "%#x, ", buf[x] & 0xff); | |
37 fprintf(f, "\n"); | |
38 } | |
39 fprintf(f,"};\n"); | |
10 | 40 fclose(f); |
1 | 41 return 0; |
42 } |