1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-message-builder.c Build messages from text files for testing (internal to D-BUS implementation)
4 * Copyright (C) 2003 Red Hat, Inc.
6 * Licensed under the Academic Free License version 1.2
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifdef DBUS_BUILD_TESTS
24 #include "dbus-message-builder.h"
27 * @defgroup DBusMessageBuilder code for loading test message data
28 * @ingroup DBusInternals
29 * @brief code for loading up test data for unit tests
31 * The code in here is used for unit testing, it loads
32 * up message data from a description in a file.
38 * Reads the given filename, which should be in "message description
39 * language" (look at some examples), and builds up the message data
40 * from it. The message data may be invalid, or valid.
44 * ALIGN <N> aligns to the given value
45 * UNALIGN skips alignment for the next marshal
46 * BYTE <N> inserts the given integer in [0,255]
47 * SAVE_LENGTH <name> records the current length under the given name
48 * LENGTH <name> inserts the saved length of the same name
51 * Following commands insert aligned data unless
52 * preceded by "UNALIGN":
54 * INT32 <N> marshals an INT32
55 * UINT32 <N> marshals a UINT32
56 * DOUBLE <N> marshals a double
57 * STRING "Foo" marshals a string
60 * @param dest the string to append the message data to
61 * @param filename the filename to load
62 * @returns #TRUE on success
65 _dbus_message_data_load (DBusString *dest,
66 const DBusString *filename)
73 #endif /* DBUS_BUILD_TESTS */