123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #ifndef ARPCWRITE_SOURCE
- #define ARPCWRITE_SOURCE
- #include <stdio.h>
- #include "../tools/types.h"
- #include "../tools/endian.h"
- #include "../tools/memory.h"
- #include "../tools/number.h"
- #include "../mme/mme.h"
- void ARPCWrite (signed fd, void const * memory, size_t extent)
- {
- #if 0
- #ifndef __GNUC__
- #pragma pack (push,1)
- #endif
- struct __packed vs_arpc_data
- {
- uint32_t BYPASS;
- uint16_t ARPCID;
- uint16_t DATALENGTH;
- uint8_t DATAOFFSET;
- uint8_t RESERVED [3];
- uint16_t ARGOFFSET;
- uint16_t STROFFSET;
- uint16_t ARGLENGTH;
- uint16_t STRLENGTH;
- uint8_t LIST [1];
- }
- * data = (struct vs_arpc_data *)(memory);
- #ifndef __GNUC__
- #pragma pack (pop)
- #endif
- #endif
- uint16_t length = (uint16_t)(extent);
- if (isatty (fd))
- {
- hexwrite (fd, &length, sizeof (length));
- hexwrite (fd, memory, length);
- #if defined (_WIN32)
- write (fd, "\r", sizeof (char));
- #endif
- write (fd, "\n", sizeof (char));
- }
- else
- {
- write (fd, &length, sizeof (length));
- write (fd, memory, length);
- }
- return;
- }
- #endif
|