OverviewFilesCommitsIssuesDocsReleasesPeers

hyperswarm-peer / swarmd / schema / hrpc.h

41 lines · c ref:
// This file is autogenerated by hrpc-c
// !!DO NOT EDIT!!
#ifndef HRPC_H
#define HRPC_H

#include <stddef.h>
#include <stdint.h>
#include <utf.h>

#include "utf/string.h"

// Error reply / error stream-frame payload. On decode the views point
// into the inbound frame; copy out anything kept past the read loop.
typedef struct {
  utf8_string_view_t message;
  utf8_string_view_t code;
  int64_t status;
} hrpc_error_t;

// <command>_decode_<name>_response result
enum {
  hrpc_ok = 0,
  hrpc_error_response = 1,
};

// <target>_dispatch result (>= 0)
enum {
  hrpc_dispatch_reply = 0,
  hrpc_dispatch_no_reply = 1,
  hrpc_dispatch_stream = 2,
};

// error codes (< 0), distinct from librpc rpc_error / rpc_partial
enum {
  hrpc_err_alloc = -1,
  hrpc_err_decode = -2,
  hrpc_err_unknown = -3,
};

#endif // HRPC_H