media/mtransport/third_party/nrappkit/src/registry/c2ru.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.

     1 /*
     2  *
     3  *    c2ru.h
     4  *
     5  *    $Source: /Users/ekr/tmp/nrappkit-dump/nrappkit/src/registry/c2ru.h,v $
     6  *    $Revision: 1.2 $
     7  *    $Date: 2006/08/16 19:39:13 $
     8  *
     9  *    c2r utility methods
    10  *
    11  *
    12  *    Copyright (C) 2005, Network Resonance, Inc.
    13  *    Copyright (C) 2006, Network Resonance, Inc.
    14  *    All Rights Reserved
    15  *
    16  *    Redistribution and use in source and binary forms, with or without
    17  *    modification, are permitted provided that the following conditions
    18  *    are met:
    19  *
    20  *    1. Redistributions of source code must retain the above copyright
    21  *       notice, this list of conditions and the following disclaimer.
    22  *    2. Redistributions in binary form must reproduce the above copyright
    23  *       notice, this list of conditions and the following disclaimer in the
    24  *       documentation and/or other materials provided with the distribution.
    25  *    3. Neither the name of Network Resonance, Inc. nor the name of any
    26  *       contributors to this software may be used to endorse or promote
    27  *       products derived from this software without specific prior written
    28  *       permission.
    29  *
    30  *    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
    31  *    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    32  *    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    33  *    ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    34  *    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    35  *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    36  *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    37  *    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    38  *    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    39  *    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    40  *    POSSIBILITY OF SUCH DAMAGE.
    41  *
    42  *
    43  */
    45 #ifndef __C2RU_H__
    46 #define __C2RU_H__
    48 #include <sys/types.h>
    49 #include <r_types.h>
    50 #include <r_data.h>
    51 #include "registry_int.h"
    53 int nr_c2ru_get_char(NR_registry parent, char *child, char **out);
    54 int nr_c2ru_get_uchar(NR_registry parent, char *child, UCHAR **out);
    55 int nr_c2ru_get_int2(NR_registry parent, char *child, INT2 **out);
    56 int nr_c2ru_get_uint2(NR_registry parent, char *child, UINT2 **out);
    57 int nr_c2ru_get_int4(NR_registry parent, char *child, INT4 **out);
    58 int nr_c2ru_get_uint4(NR_registry parent, char *child, UINT4 **out);
    59 int nr_c2ru_get_int8(NR_registry parent, char *child, INT8 **out);
    60 int nr_c2ru_get_uint8(NR_registry parent, char *child, UINT8 **out);
    61 int nr_c2ru_get_double(NR_registry parent, char *child, double **out);
    62 int nr_c2ru_get_data(NR_registry parent, char *child, Data **out);
    63 int nr_c2ru_get_string(NR_registry parent, char *child, char ***out);
    65 int nr_c2ru_set_char(NR_registry parent, char *child, char *data);
    66 int nr_c2ru_set_uchar(NR_registry parent, char *child, UCHAR *data);
    67 int nr_c2ru_set_int2(NR_registry parent, char *child, INT2 *data);
    68 int nr_c2ru_set_uint2(NR_registry parent, char *child, UINT2 *data);
    69 int nr_c2ru_set_int4(NR_registry parent, char *child, INT4 *data);
    70 int nr_c2ru_set_uint4(NR_registry parent, char *child, UINT4 *data);
    71 int nr_c2ru_set_int8(NR_registry parent, char *child, INT8 *data);
    72 int nr_c2ru_set_uint8(NR_registry parent, char *child, UINT8 *data);
    73 int nr_c2ru_set_double(NR_registry parent, char *child, double *data);
    74 int nr_c2ru_set_registry(NR_registry parent, char *child);
    75 int nr_c2ru_set_data(NR_registry parent, char *child, Data *data);
    76 int nr_c2ru_set_string(NR_registry parent, char *child, char **data);
    78 int nr_c2ru_free_char(char *data);
    79 int nr_c2ru_free_uchar(UCHAR *data);
    80 int nr_c2ru_free_int2(INT2 *data);
    81 int nr_c2ru_free_uint2(UINT2 *data);
    82 int nr_c2ru_free_int4(INT4 *data);
    83 int nr_c2ru_free_uint4(UINT4 *data);
    84 int nr_c2ru_free_int8(INT8 *data);
    85 int nr_c2ru_free_uint8(UINT8 *data);
    86 int nr_c2ru_free_double(double *data);
    87 int nr_c2ru_free_data(Data *data);
    88 int nr_c2ru_free_string(char **data);
    90 int nr_c2ru_get_children(NR_registry parent, char *child, void *ptr, size_t size, int (*get)(NR_registry, void*));
    91 int nr_c2ru_set_children(NR_registry parent, char *child, void *ptr, int (*set)(NR_registry, void*), int (*label)(NR_registry, void*, char[NR_REG_MAX_NR_REGISTRY_LEN]));
    92 int nr_c2ru_free_children(void *ptr, int (*free)(void*));
    94 int nr_c2ru_make_registry(NR_registry parent, char *child, NR_registry out);
    96 #endif

mercurial