leget 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .TH LEGET 2
  2. le16get, le24get, le32get, le64get, le16put, le24put, le32put, le64put, be16get, be24get, be32get, be64get, be16put, be24put, be32put, be64put\- integer marshalling
  3. .SH SYNOPSIS
  4. .ta +\w'\fLuvlong 'u
  5. .PP
  6. .nf
  7. .B
  8. u16int le16get(uchar *t, uchar **r)
  9. .PP
  10. .nf
  11. .B
  12. u32int le24get(uchar *t, uchar **r)
  13. .PP
  14. .nf
  15. .B
  16. u32int le32get(uchar *t, uchar **r)
  17. .PP
  18. .nf
  19. .B
  20. u64int le64get(uchar *t, uchar **r)
  21. .PP
  22. .nf
  23. .B
  24. uchar* le16put(uchar *t, u16int i)
  25. .PP
  26. .nf
  27. .B
  28. uchar* le24put(uchar *t, u32int i)
  29. .PP
  30. .nf
  31. .B
  32. uchar* le32put(uchar *t, u32int i)
  33. .PP
  34. .nf
  35. .B
  36. uchar* le64put(uchar *t, u64int i)
  37. .PP
  38. .nf
  39. .B
  40. u16int be16get(uchar *t, uchar **r)
  41. .PP
  42. .nf
  43. .B
  44. u32int be24get(uchar *t, uchar **r)
  45. .PP
  46. .nf
  47. .B
  48. u32int be32get(uchar *t, uchar **r)
  49. .PP
  50. .nf
  51. .B
  52. u64int be64get(uchar *t, uchar **r)
  53. .PP
  54. .nf
  55. .B
  56. uchar* be16put(uchar *t, u16int i)
  57. .PP
  58. .nf
  59. .B
  60. uchar* be24put(uchar *t, u32int i)
  61. .PP
  62. .nf
  63. .B
  64. uchar* be32put(uchar *t, u32int i)
  65. .PP
  66. .nf
  67. .B
  68. uchar* be64put(uchar *t, u64int i)
  69. .PP
  70. .SH DESCRIPTION
  71. These functions marshal a 2- to 8-byte integer to
  72. or from little- or big-endian formats. The
  73. .I put
  74. functions return the
  75. pointer to the first byte after the integer. The
  76. .I get
  77. functions return the value, and if
  78. .B r
  79. is not
  80. .I nil
  81. they set
  82. .B *r
  83. to point at the first byte after the integer.
  84. .SH SOURCE
  85. .B /sys/src/libc/port/beget.c
  86. .br
  87. .B /sys/src/libc/port/leget.c
  88. .SH "SEE ALSO"
  89. .IR fcall (2),
  90. .IR ip (2)
  91. .SH BUGS
  92. .IR GBIT *
  93. and
  94. .IR PBIT *
  95. (from
  96. .IR fcall (2))
  97. provide similar functionality for little-endian integers.
  98. The
  99. .IR nhget *
  100. and
  101. .IR nhput *
  102. functions from
  103. .IR ip (2)
  104. provide similar functionality for big-endian integers.