~ubuntu-branches/ubuntu/wily/maradns/wily-proposed

« back to all changes in this revision

Viewing changes to deadwood-3.2.07/src/DwDict.h

  • Committer: Package Import Robot
  • Author(s): Dariusz Dwornikowski, Tomasz Buchert, Dariusz Dwornikowski
  • Date: 2015-03-27 18:34:08 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20150327183408-wnfachdkdjt96yu6
Tags: 2.0.11-1
[ Tomasz Buchert ]
* Imported Upstream version 2.0.11

[ Dariusz Dwornikowski ]
* d/patches: 
  - refreshed all patches for new deadwood version
  - removed generating of random prime on build (Closes: #785536) 
* d/rules: date taken from changelog (Closes: #785535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2009 Sam Trenholme
 
2
 *
 
3
 * TERMS
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 *
 
9
 * 1. Redistributions of source code must retain the above copyright
 
10
 *    notice, this list of conditions and the following disclaimer.
 
11
 * 2. Redistributions in binary form must reproduce the above copyright
 
12
 *    notice, this list of conditions and the following disclaimer in the
 
13
 *    documentation and/or other materials provided with the distribution.
 
14
 *
 
15
 * This software is provided 'as is' with no guarantees of correctness or
 
16
 * fitness for purpose.
 
17
 */
 
18
 
 
19
#include "DwHash.h"
 
20
#define dwd_dict dw_hash
 
21
 
 
22
/* Initialize a Deadwood dictionary store */
 
23
dwd_dict *dwd_init();
 
24
 
 
25
/* Add a dictionary key/value pair to the compiled list of MaraRC
 
26
 * parameters.
 
27
 *
 
28
 * Input: Number of MaraRC parameter to modify
 
29
 *        Dictionary key index to modify
 
30
 *        Value for said key index
 
31
 *
 
32
 * Output: Location of hash in memory after performing operation; this may
 
33
 *         move as we grow the dictionary to accommodate more data in the
 
34
 *         hash.  This *must* always be called like this:
 
35
 *
 
36
 *              hash = dwd_add(hash,key,value);
 
37
 *
 
38
 */
 
39
dwd_dict *dwd_add(dwd_dict *hash, dw_str *key, dw_str *value);
 
40
 
 
41
/* Fetch a value from a given dictionary variable (num is the number for
 
42
 * the dictionary variable we are seeking a given value for, given the
 
43
 * dictionary variable and the key inside that variable) */
 
44
dw_str *dwd_fetch(dwd_dict *hash, dw_str *key);
 
45
 
 
46
/* For a given dictionary variable, and a key, return (as a *copied* dw_str
 
47
 * object) the next key or 0 if we're at the last key.  If the key given to
 
48
 * this function is 0, return the first key. */
 
49
dw_str *dwd_nextkey(dwd_dict *hash, dw_str *key);
 
50