mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-08 14:58:04 +02:00
2003-03-07 Anders Carlsson <andersca@codefactory.se>
* dbus/Makefile.am: Add dbus-dict.[ch] * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new), (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains), (dbus_dict_remove), (dbus_dict_get_value_type), (dbus_dict_get_keys), (dbus_dict_put_boolean), (dbus_dict_put_int32), (dbus_dict_put_uint32), (dbus_dict_put_double), (dbus_dict_put_string), (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array), (dbus_dict_put_uint32_array), (dbus_dict_put_double_array), (dbus_dict_put_string_array), (dbus_dict_get_boolean), (dbus_dict_get_int32), (dbus_dict_get_uint32), (dbus_dict_get_double), (dbus_dict_get_string), (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array), (dbus_dict_get_uint32_array), (dbus_dict_get_double_array), (dbus_dict_get_string_array), (_dbus_dict_test): * dbus/dbus-dict.h: Add DBusDict implementation * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests): * dbus/dbus-test.h: Add _dbus_dict_test.
This commit is contained in:
parent
7e050c8871
commit
ee09dbf058
6 changed files with 1341 additions and 5 deletions
26
ChangeLog
26
ChangeLog
|
|
@ -1,3 +1,29 @@
|
||||||
|
2003-03-07 Anders Carlsson <andersca@codefactory.se>
|
||||||
|
|
||||||
|
* dbus/Makefile.am:
|
||||||
|
Add dbus-dict.[ch]
|
||||||
|
|
||||||
|
* dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
|
||||||
|
(dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
|
||||||
|
(dbus_dict_remove), (dbus_dict_get_value_type),
|
||||||
|
(dbus_dict_get_keys), (dbus_dict_put_boolean),
|
||||||
|
(dbus_dict_put_int32), (dbus_dict_put_uint32),
|
||||||
|
(dbus_dict_put_double), (dbus_dict_put_string),
|
||||||
|
(dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
|
||||||
|
(dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
|
||||||
|
(dbus_dict_put_string_array), (dbus_dict_get_boolean),
|
||||||
|
(dbus_dict_get_int32), (dbus_dict_get_uint32),
|
||||||
|
(dbus_dict_get_double), (dbus_dict_get_string),
|
||||||
|
(dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
|
||||||
|
(dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
|
||||||
|
(dbus_dict_get_string_array), (_dbus_dict_test):
|
||||||
|
* dbus/dbus-dict.h:
|
||||||
|
Add DBusDict implementation
|
||||||
|
|
||||||
|
* dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
|
||||||
|
* dbus/dbus-test.h:
|
||||||
|
Add _dbus_dict_test
|
||||||
|
|
||||||
2003-03-04 Havoc Pennington <hp@pobox.com>
|
2003-03-04 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
* test/data/auth/*: adapt to changes
|
* test/data/auth/*: adapt to changes
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ dbusinclude_HEADERS= \
|
||||||
dbus-address.h \
|
dbus-address.h \
|
||||||
dbus-bus.h \
|
dbus-bus.h \
|
||||||
dbus-connection.h \
|
dbus-connection.h \
|
||||||
|
dbus-dict.h \
|
||||||
dbus-errors.h \
|
dbus-errors.h \
|
||||||
dbus-macros.h \
|
dbus-macros.h \
|
||||||
dbus-memory.h \
|
dbus-memory.h \
|
||||||
|
|
@ -29,6 +30,7 @@ libdbus_1_la_SOURCES= \
|
||||||
dbus-bus.c \
|
dbus-bus.c \
|
||||||
dbus-connection.c \
|
dbus-connection.c \
|
||||||
dbus-connection-internal.h \
|
dbus-connection-internal.h \
|
||||||
|
dbus-dict.c \
|
||||||
dbus-errors.c \
|
dbus-errors.c \
|
||||||
dbus-keyring.c \
|
dbus-keyring.c \
|
||||||
dbus-keyring.h \
|
dbus-keyring.h \
|
||||||
|
|
@ -97,7 +99,7 @@ libdbus_convenience_la_SOURCES= \
|
||||||
libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS) libdbus-convenience.la
|
libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS) libdbus-convenience.la
|
||||||
## don't export symbols that start with "_" (we use this
|
## don't export symbols that start with "_" (we use this
|
||||||
## convention for internal symbols)
|
## convention for internal symbols)
|
||||||
libdbus_1_la_LDFLAGS= -export-symbols-regex "^[^_].*"
|
#libdbus_1_la_LDFLAGS= -export-symbols-regex "^[^_].*"
|
||||||
|
|
||||||
## FIXME it would be less annoying when hacking if we didn't have
|
## FIXME it would be less annoying when hacking if we didn't have
|
||||||
## to relink these test binaries, so moving them to the test/*
|
## to relink these test binaries, so moving them to the test/*
|
||||||
|
|
|
||||||
1172
dbus/dbus-dict.c
Normal file
1172
dbus/dbus-dict.c
Normal file
File diff suppressed because it is too large
Load diff
131
dbus/dbus-dict.h
Normal file
131
dbus/dbus-dict.h
Normal file
|
|
@ -0,0 +1,131 @@
|
||||||
|
/* -*- mode: C; c-file-style: "gnu" -*- */
|
||||||
|
/* dbus-dict.h Dict object for key-value data.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 CodeFactory AB
|
||||||
|
*
|
||||||
|
* Licensed under the Academic Free License version 1.2
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
|
||||||
|
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DBUS_DICT_H
|
||||||
|
#define DBUS_DICT_H
|
||||||
|
|
||||||
|
#include <dbus/dbus-macros.h>
|
||||||
|
#include <dbus/dbus-types.h>
|
||||||
|
|
||||||
|
DBUS_BEGIN_DECLS;
|
||||||
|
|
||||||
|
typedef struct DBusDict DBusDict;
|
||||||
|
|
||||||
|
DBusDict * dbus_dict_new (void);
|
||||||
|
void dbus_dict_ref (DBusDict *dict);
|
||||||
|
void dbus_dict_unref (DBusDict *dict);
|
||||||
|
dbus_bool_t dbus_dict_contains (DBusDict *dict,
|
||||||
|
const char *key);
|
||||||
|
dbus_bool_t dbus_dict_remove (DBusDict *dict,
|
||||||
|
const char *key);
|
||||||
|
int dbus_dict_get_value_type (DBusDict *dict,
|
||||||
|
const char *key);
|
||||||
|
dbus_bool_t dbus_dict_get_keys (DBusDict *dict,
|
||||||
|
char ***keys,
|
||||||
|
int *len);
|
||||||
|
|
||||||
|
dbus_bool_t dbus_dict_put_boolean (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
dbus_bool_t value);
|
||||||
|
dbus_bool_t dbus_dict_put_int32 (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
dbus_int32_t value);
|
||||||
|
dbus_bool_t dbus_dict_put_uint32 (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
dbus_uint32_t value);
|
||||||
|
dbus_bool_t dbus_dict_put_double (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
double value);
|
||||||
|
dbus_bool_t dbus_dict_put_string (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const char *value);
|
||||||
|
dbus_bool_t dbus_dict_put_boolean_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
unsigned const char *value,
|
||||||
|
int len);
|
||||||
|
dbus_bool_t dbus_dict_put_int32_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const dbus_int32_t *value,
|
||||||
|
int len);
|
||||||
|
dbus_bool_t dbus_dict_put_uint32_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const dbus_uint32_t *value,
|
||||||
|
int len);
|
||||||
|
dbus_bool_t dbus_dict_put_double_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const double *value,
|
||||||
|
int len);
|
||||||
|
dbus_bool_t dbus_dict_put_byte_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
unsigned const char *value,
|
||||||
|
int len);
|
||||||
|
dbus_bool_t dbus_dict_put_string_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const char **value,
|
||||||
|
int len);
|
||||||
|
|
||||||
|
dbus_bool_t dbus_dict_get_boolean (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
dbus_bool_t *value);
|
||||||
|
dbus_bool_t dbus_dict_get_int32 (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
dbus_int32_t *value);
|
||||||
|
dbus_bool_t dbus_dict_get_uint32 (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
dbus_uint32_t *value);
|
||||||
|
dbus_bool_t dbus_dict_get_double (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
double *value);
|
||||||
|
dbus_bool_t dbus_dict_get_string (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const char **value);
|
||||||
|
dbus_bool_t dbus_dict_get_boolean_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
unsigned const char **value,
|
||||||
|
int *len);
|
||||||
|
dbus_bool_t dbus_dict_get_int32_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const dbus_int32_t **value,
|
||||||
|
int *len);
|
||||||
|
dbus_bool_t dbus_dict_get_uint32_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const dbus_uint32_t **value,
|
||||||
|
int *len);
|
||||||
|
dbus_bool_t dbus_dict_get_double_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const double **value,
|
||||||
|
int *len);
|
||||||
|
dbus_bool_t dbus_dict_get_byte_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
unsigned const char **value,
|
||||||
|
int *len);
|
||||||
|
dbus_bool_t dbus_dict_get_string_array (DBusDict *dict,
|
||||||
|
const char *key,
|
||||||
|
const char ***value,
|
||||||
|
int *len);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* DBUS_DICT_H */
|
||||||
|
|
@ -105,6 +105,10 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir)
|
||||||
if (!_dbus_hash_test ())
|
if (!_dbus_hash_test ())
|
||||||
die ("hash tables");
|
die ("hash tables");
|
||||||
|
|
||||||
|
printf ("%s: running dict tests\n", "dbus-test");
|
||||||
|
if (!_dbus_dict_test ())
|
||||||
|
die ("dicts");
|
||||||
|
|
||||||
printf ("%s: completed successfully\n", "dbus-test");
|
printf ("%s: completed successfully\n", "dbus-test");
|
||||||
#else
|
#else
|
||||||
printf ("Not compiled with unit tests, not running any\n");
|
printf ("Not compiled with unit tests, not running any\n");
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ typedef enum
|
||||||
} DBusMessageValidity;
|
} DBusMessageValidity;
|
||||||
|
|
||||||
dbus_bool_t _dbus_hash_test (void);
|
dbus_bool_t _dbus_hash_test (void);
|
||||||
|
dbus_bool_t _dbus_dict_test (void);
|
||||||
dbus_bool_t _dbus_list_test (void);
|
dbus_bool_t _dbus_list_test (void);
|
||||||
dbus_bool_t _dbus_marshal_test (void);
|
dbus_bool_t _dbus_marshal_test (void);
|
||||||
dbus_bool_t _dbus_mem_pool_test (void);
|
dbus_bool_t _dbus_mem_pool_test (void);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue