faces.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. enum /* face strings */
  10. {
  11. Suser,
  12. Sdomain,
  13. Sshow,
  14. Sdigest,
  15. Nstring
  16. };
  17. enum
  18. {
  19. Facesize = 48,
  20. };
  21. typedef struct Face Face;
  22. typedef struct Facefile Facefile;
  23. struct Face
  24. {
  25. Image *bit; /* unless there's an error, this is file->image */
  26. Image *mask; /* unless there's an error, this is file->mask */
  27. char *str[Nstring];
  28. int recent;
  29. uint32_t time;
  30. Tm tm;
  31. int unknown;
  32. Facefile *file;
  33. };
  34. /*
  35. * Loading the files is slow enough on a dial-up line to be worth this trouble
  36. */
  37. struct Facefile
  38. {
  39. Image *image;
  40. Image *mask;
  41. uint32_t mtime;
  42. uint32_t rdtime;
  43. int ref;
  44. char *file;
  45. Facefile *next;
  46. };
  47. extern char date[];
  48. extern char *maildir;
  49. extern char **maildirs;
  50. extern int nmaildirs;
  51. Face* nextface(void);
  52. void findbit(Face*);
  53. void freeface(Face*);
  54. void initplumb(void);
  55. void killall(char*);
  56. void showmail(Face*);
  57. void delete(char*, char*);
  58. void freefacefile(Facefile*);
  59. Face* dirface(char*, char*);
  60. void resized(void);
  61. int alreadyseen(char*);
  62. uint32_t dirlen(char*);
  63. void *emalloc(uint32_t);
  64. void *erealloc(void*, uint32_t);
  65. char *estrdup(char*);
  66. char *findfile(Face*, char*, char*);
  67. void addmaildir(char*);