1
0

plumb.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. /*
  10. * Message format:
  11. * source application\n
  12. * destination port\n
  13. * working directory\n
  14. * type\n
  15. * attributes\n
  16. * nbytes\n
  17. * n bytes of data
  18. */
  19. typedef struct Plumbattr Plumbattr;
  20. typedef struct Plumbmsg Plumbmsg;
  21. struct Plumbmsg
  22. {
  23. char *src;
  24. char *dst;
  25. char *wdir;
  26. char *type;
  27. Plumbattr *attr;
  28. int ndata;
  29. char *data;
  30. };
  31. struct Plumbattr
  32. {
  33. char *name;
  34. char *value;
  35. Plumbattr *next;
  36. };
  37. int plumbsend(int, Plumbmsg*);
  38. int plumbsendtext(int, char*, char*, char*,
  39. char*);
  40. Plumbmsg* plumbrecv(int);
  41. char* plumbpack(Plumbmsg*, int*);
  42. Plumbmsg* plumbunpack(char*, int);
  43. Plumbmsg* plumbunpackpartial(char*, int, int*);
  44. char* plumbpackattr(Plumbattr*);
  45. Plumbattr* plumbunpackattr(char*);
  46. Plumbattr* plumbaddattr(Plumbattr*, Plumbattr*);
  47. Plumbattr* plumbdelattr(Plumbattr*, char*);
  48. void plumbfree(Plumbmsg*);
  49. char* plumblookup(Plumbattr*, char*);
  50. int plumbopen(char*, int);
  51. int eplumb(int, char*);