File: proto_parser_type.h

package info (click to toggle)
memcached 1.6.40-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,192 kB
  • sloc: ansic: 61,138; perl: 12,616; sh: 4,569; makefile: 471; python: 402; xml: 59
file content (24 lines) | stat: -rw-r--r-- 753 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef PROTO_PARSER_TYPE_H
#define PROTO_PARSER_TYPE_H

#include "vendor/mcmc/mcmc.h"
#include <stdbool.h>

typedef struct mcp_parser_s mcp_parser_t;

// Note that we must use offsets into request for tokens,
// as *request can change between parsing and later accessors.
struct mcp_parser_s {
    const char *request;
    void *vbuf; // temporary buffer for holding value lengths.
    mcmc_tokenizer_t tok; // tokenizer structure
    uint8_t command;
    uint8_t cmd_type; // command class.
    uint8_t keytoken; // because GAT. sigh. also cmds without a key.
    uint32_t reqlen; // full length of request buffer.
    int vlen;
    uint32_t klen; // length of key.
    bool noreply; // if quiet/noreply mode is set.
};

#endif // PROTO_PARSER_TYPE_H