X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Flib%2Fbackdoor.h;h=e9996792f4e07fa2ee373f158abbe3b8eaf10261;hp=8205aa32313b9c8687968bc07ccfbb0733a70ed1;hb=3fc16f6e9abc98a3bd5427eb210669860609a224;hpb=540641a18c65c05df757ced2f225ade578da15aa diff --git a/src/lib/backdoor.h b/src/lib/backdoor.h index 8205aa3..e999679 100644 --- a/src/lib/backdoor.h +++ b/src/lib/backdoor.h @@ -4,23 +4,31 @@ #include #include #include +#include -enum backdoor_error - { - BACKDOOR_OK = 0, - BACKDOOR_NOMEM = -100, - BACKDOOR_BAD_TYPE, - BACKDOOR_TYPE_MISMATCH, - BACKDOOR_STRING_MISMATCH, - BACKDOOR_NEGATIVE_SIZE, - BACKDOOR_UNEXPECTED_EOF - }; - -enum backdoor_error -backdoor_vmarshal (const char *types, va_list args, - void (*) (uint8_t, void *aux), void *aux); -enum backdoor_error -backdoor_vunmarshal (const char *types, va_list args, - bool (*) (uint8_t *, void *aux), void *aux); +#ifdef __cplusplus +extern "C" { +#endif + +void backdoor_put_int32 (int32_t value, + void (*out) (uint8_t, void *aux), void *aux); +void backdoor_put_uint32 (uint32_t value, + void (*out) (uint8_t, void *aux), void *aux); +void backdoor_put_bytes (const void *buffer, size_t cnt, + void (*out) (uint8_t, void *aux), void *aux); +void backdoor_put_string (const char *string, + void (*out) (uint8_t, void *aux), void *aux); +void backdoor_put_bool (bool b, + void (*out) (uint8_t, void *aux), void *aux); +int32_t backdoor_get_int32 (uint8_t (*in) (void *aux), void *aux); +uint32_t backdoor_get_uint32 (uint8_t (*in) (void *aux), void *aux); +char *backdoor_get_string (uint8_t (*in) (void *aux), void *aux); +void backdoor_get_bytes (void *buffer, size_t cnt, + uint8_t (*in) (void *aux), void *aux); +bool backdoor_get_bool (uint8_t (*in) (void *aux), void *aux); + +#ifdef __cplusplus +}; +#endif #endif /* backdoor.h */