media/mtransport/third_party/nrappkit/src/registry/registry_int.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 #if 0
michael@0 2 #define NR_LOG_REGISTRY BLAHBLAH()
michael@0 3 #define LOG_REGISTRY BLAHBLAH()
michael@0 4 static int BLAHBLAH() {
michael@0 5 int blahblah;
michael@0 6 r_log_register("registry",&blahblah);
michael@0 7 return blahblah;
michael@0 8 }
michael@0 9 #endif
michael@0 10
michael@0 11 /*
michael@0 12 *
michael@0 13 * registry_int.h
michael@0 14 *
michael@0 15 * $Source: /Users/ekr/tmp/nrappkit-dump/nrappkit/src/registry/registry_int.h,v $
michael@0 16 * $Revision: 1.3 $
michael@0 17 * $Date: 2007/06/26 22:37:51 $
michael@0 18 *
michael@0 19 * Callback-related functions
michael@0 20 *
michael@0 21 *
michael@0 22 * Copyright (C) 2005, Network Resonance, Inc.
michael@0 23 * Copyright (C) 2006, Network Resonance, Inc.
michael@0 24 * All Rights Reserved
michael@0 25 *
michael@0 26 * Redistribution and use in source and binary forms, with or without
michael@0 27 * modification, are permitted provided that the following conditions
michael@0 28 * are met:
michael@0 29 *
michael@0 30 * 1. Redistributions of source code must retain the above copyright
michael@0 31 * notice, this list of conditions and the following disclaimer.
michael@0 32 * 2. Redistributions in binary form must reproduce the above copyright
michael@0 33 * notice, this list of conditions and the following disclaimer in the
michael@0 34 * documentation and/or other materials provided with the distribution.
michael@0 35 * 3. Neither the name of Network Resonance, Inc. nor the name of any
michael@0 36 * contributors to this software may be used to endorse or promote
michael@0 37 * products derived from this software without specific prior written
michael@0 38 * permission.
michael@0 39 *
michael@0 40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
michael@0 41 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
michael@0 42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
michael@0 43 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
michael@0 44 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
michael@0 45 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
michael@0 46 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
michael@0 47 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
michael@0 48 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
michael@0 49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
michael@0 50 * POSSIBILITY OF SUCH DAMAGE.
michael@0 51 *
michael@0 52 *
michael@0 53 */
michael@0 54
michael@0 55 #ifndef __REGISTRY_INT_H__
michael@0 56 #define __REGISTRY_INT_H__
michael@0 57
michael@0 58 #include <sys/types.h>
michael@0 59 #include <r_types.h>
michael@0 60 #ifndef NO_REG_RPC
michael@0 61 #include <rpc/rpc.h>
michael@0 62 #endif
michael@0 63
michael@0 64 extern int NR_LOG_REGISTRY;
michael@0 65
michael@0 66 int nr_reg_is_valid(NR_registry name);
michael@0 67
michael@0 68 #define NR_REG_TYPE_CHAR 0
michael@0 69 #define NR_REG_TYPE_UCHAR 1
michael@0 70 #define NR_REG_TYPE_INT2 2
michael@0 71 #define NR_REG_TYPE_UINT2 3
michael@0 72 #define NR_REG_TYPE_INT4 4
michael@0 73 #define NR_REG_TYPE_UINT4 5
michael@0 74 #define NR_REG_TYPE_INT8 6
michael@0 75 #define NR_REG_TYPE_UINT8 7
michael@0 76 #define NR_REG_TYPE_DOUBLE 8
michael@0 77 #define NR_REG_TYPE_BYTES 9
michael@0 78 #define NR_REG_TYPE_STRING 10
michael@0 79 #define NR_REG_TYPE_REGISTRY 11
michael@0 80 char *nr_reg_type_name(int type);
michael@0 81 int nr_reg_compute_type(char *type_name, int *type);
michael@0 82
michael@0 83 char *nr_reg_action_name(int action);
michael@0 84
michael@0 85 int nr_reg_cb_init(void);
michael@0 86 int nr_reg_client_cb_init(void);
michael@0 87 int nr_reg_register_for_callbacks(int fd, int connect_to_port);
michael@0 88 int nr_reg_raise_event(NR_registry name, int action);
michael@0 89 #ifndef NO_REG_RPC
michael@0 90 int nr_reg_get_client(CLIENT **client);
michael@0 91 #endif
michael@0 92
michael@0 93 #define CALLBACK_SERVER_ADDR "127.0.0.1"
michael@0 94 #define CALLBACK_SERVER_PORT 8082
michael@0 95 #define CALLBACK_SERVER_BACKLOG 32
michael@0 96
michael@0 97 #endif

mercurial