2003-01-26 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / dbus / dbus-message-builder.c
1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-message-builder.c Build messages from text files for testing (internal to D-BUS implementation)
3  * 
4  * Copyright (C) 2003 Red Hat, Inc.
5  *
6  * Licensed under the Academic Free License version 1.2
7  * 
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.
12  *
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.
17  * 
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
21  *
22  */
23 #ifdef DBUS_BUILD_TESTS
24 #include "dbus-message-builder.h"
25
26 /**
27  * @defgroup DBusMessageBuilder code for loading test message data
28  * @ingroup  DBusInternals
29  * @brief code for loading up test data for unit tests
30  *
31  * The code in here is used for unit testing, it loads
32  * up message data from a description in a file.
33  *
34  * @{
35  */
36
37 /**
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.
41  *
42  * The file format is:
43  * @code
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
49  * @endcode
50  * 
51  * Following commands insert aligned data unless
52  * preceded by "UNALIGN":
53  * @code
54  *   INT32 <N> marshals an INT32
55  *   UINT32 <N> marshals a UINT32
56  *   DOUBLE <N> marshals a double
57  *   STRING "Foo" marshals a string
58  * @endcode
59  * 
60  * @param dest the string to append the message data to
61  * @param filename the filename to load
62  * @returns #TRUE on success
63  */
64 dbus_bool_t
65 _dbus_message_data_load (DBusString       *dest,
66                          const DBusString *filename)
67 {
68   /* FIXME implement */
69   
70 }
71
72 /** @} */
73 #endif /* DBUS_BUILD_TESTS */