libdht
Public Types | Data Fields
bvalue Struct Reference

bencoding value. More...

#include <bencode.h>

Collaboration diagram for bvalue:
Collaboration graph
[legend]

Public Types

enum  { BVALUE_INTEGER, BVALUE_STRING, BVALUE_LIST, BVALUE_DICTIONARY }
 Type of the value contained.
 

Data Fields

enum bvalue:: { ... }  type
 Type of the value contained.
 
union {
   long long int   i
 Integer value.
 
   struct {
      unsigned char *   bytes
 string pointer (zero-terminated)
 
      size_t   len
 length of the string
 
   }   s
 String value.
 
   struct {
      struct bvalue **   array
 array of elements
 
      size_t   len
 number of elements
 
   }   l
 List value.
 
   struct {
      char **   key
 array of keys (in lexicographical order)
 
      struct bvalue **   val
 array of values
 
      size_t   len
 number of key-value pairs
 
   }   d
 Dictionary value.
 
}; 
 Type-specific data.
 

Detailed Description

bencoding value.

A bencoding value representation capable of holding one of 4 types: "integer", "string", "list", and "dictionary".

Field Documentation

size_t bvalue::len

length of the string

number of key-value pairs

number of elements


The documentation for this struct was generated from the following file: