plumb.h 989 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma lib "libplumb.a"
  2. #pragma src "/sys/src/libplumb"
  3. /*
  4. * Message format:
  5. * source application\n
  6. * destination port\n
  7. * working directory\n
  8. * type\n
  9. * attributes\n
  10. * nbytes\n
  11. * n bytes of data
  12. */
  13. typedef struct Plumbattr Plumbattr;
  14. typedef struct Plumbmsg Plumbmsg;
  15. struct Plumbmsg
  16. {
  17. char *src;
  18. char *dst;
  19. char *wdir;
  20. char *type;
  21. Plumbattr *attr;
  22. int ndata;
  23. char *data;
  24. };
  25. struct Plumbattr
  26. {
  27. char *name;
  28. char *value;
  29. Plumbattr *next;
  30. };
  31. int plumbsend(int, Plumbmsg*);
  32. int plumbsendtext(int, char*, char*, char*, char*);
  33. Plumbmsg* plumbrecv(int);
  34. char* plumbpack(Plumbmsg*, int*);
  35. Plumbmsg* plumbunpack(char*, int);
  36. Plumbmsg* plumbunpackpartial(char*, int, int*);
  37. char* plumbpackattr(Plumbattr*);
  38. Plumbattr* plumbunpackattr(char*);
  39. Plumbattr* plumbaddattr(Plumbattr*, Plumbattr*);
  40. Plumbattr* plumbdelattr(Plumbattr*, char*);
  41. void plumbfree(Plumbmsg*);
  42. char* plumblookup(Plumbattr*, char*);
  43. int plumbopen(char*, int);
  44. int eplumb(int, char*);