Scott James Remnant | 1662a83 | 2009-10-14 05:31:01 +0100 | [diff] [blame] | 1 | 2009-10-03 Scott James Remnant <scott@netsplit.com> |
| 2 | |
| 3 | * m4/libs.m4 (NIH_LIB_DBUS): Allow an external nih-dbus-tool to |
| 4 | be used by setting NIH_DBUS_TOOL when calling configure; when |
| 5 | cross-compiling, if this is not set, look for it in the PATH and |
| 6 | warn if we fall back to using our built copy. |
| 7 | * nih-dbus-tool/Makefile.am ($(com_netsplit_Nih_Test_object_OUTPUTS)): |
| 8 | ($(com_netsplit_Nih_Test_proxy_OUTPUTS)): Use an externally built |
| 9 | nih-dbus-tool for the tests if given, not strictly right but the |
| 10 | best we can do when cross-compiling (when we probably won't run |
| 11 | "make check" anyway) |
| 12 | |
Scott James Remnant | 981b64e | 2009-10-14 05:33:21 +0100 | [diff] [blame] | 13 | * nih/file.c (nih_dir_walk_sort): Add static function to replace |
| 14 | alphasort() which we can't call anymore. It would be deeply ironic |
| 15 | to bitch about glibc breaking API in the libnih changelog. |
| 16 | (nih_dir_walk_scan): Replace alphasort() with nih_dir_walk_sort() |
| 17 | |
Scott James Remnant | 4c9097b | 2009-10-14 05:32:26 +0100 | [diff] [blame] | 18 | 2009-08-11 Johan Kiviniemi <johan@kiviniemi.name> |
| 19 | |
| 20 | * nih/logging.c: Expose the glibc-internal __abort_msg symbol |
| 21 | so that we can set it. |
| 22 | (nih_log_message): Save a copy of any fatal or higher log message |
| 23 | into this variable; assuming that abort() is the next function call |
| 24 | as is the case for nih_assert() |
| 25 | |
Scott James Remnant | 6d1b13a | 2009-08-03 22:58:09 +0100 | [diff] [blame] | 26 | 2009-08-02 Scott James Remnant <scott@netsplit.com> |
| 27 | |
| 28 | * NEWS: Release 0.3.2 |
| 29 | |
| 30 | 2009-07-29 Michael Biebl <mbiebl@gmail.com> |
| 31 | |
| 32 | * nih/child.h: Remove unnecessary sys/ptrace.h and linux/ptrace.h |
| 33 | headers, that prevent compilation on ia64. |
| 34 | |
| 35 | 2009-07-22 Michael Biebl <mbiebl@gmail.com> |
| 36 | |
| 37 | * nih-dbus-tool/Makefile.am (dist_man_MANS): Don't install the |
| 38 | manpages unless INSTALL_NIH, take care to make sure they're still |
| 39 | distributed. |
| 40 | |
Scott James Remnant | 9fdee1a | 2009-07-16 18:12:16 +0100 | [diff] [blame] | 41 | 2009-07-15 Scott James Remnant <scott@netsplit.com> |
| 42 | |
| 43 | * m4/libs.m4 (NIH_LIB_DBUS): Now that D-Bus 1.2.16 proper has been |
| 44 | released, update our version requirements to that. |
| 45 | * README: Update documentation. |
| 46 | |
| 47 | 2009-07-14 Scott James Remnant <scott@netsplit.com> |
| 48 | |
| 49 | * nih/tests/test_main.c (test_init): Add a test for being called |
| 50 | as a login shell. |
| 51 | * nih/main.c (nih_main_init_full): Check for and skip initial dash. |
| 52 | |
| 53 | 2009-07-11 Scott James Remnant <scott@netsplit.com> |
| 54 | |
| 55 | * configure.ac: Bump version to 0.3.2 |
| 56 | * NEWS: Begin new release |
| 57 | |
Scott James Remnant | b1c1647 | 2009-07-09 00:11:10 +0100 | [diff] [blame] | 58 | 2009-07-09 Scott James Remnant <scott@netsplit.com> |
| 59 | |
Scott James Remnant | 812f918 | 2009-07-09 17:18:13 +0100 | [diff] [blame] | 60 | * NEWS: Release 0.3.1 |
| 61 | |
Scott James Remnant | 20f1e00 | 2009-07-09 16:26:46 +0100 | [diff] [blame] | 62 | * m4/libs.m4 (NIH_LIB_DBUS): Increase D-Bus dependency to current |
| 63 | GIT HEAD (1.2.15) |
| 64 | * README: Update documentation. |
| 65 | * NEWS: Note the change. |
| 66 | |
Scott James Remnant | 280a8d8 | 2009-07-09 14:07:52 +0100 | [diff] [blame] | 67 | * nih-dbus-tool/demarshal.c (demarshal_array): Always initialise |
| 68 | all arrays to NULL first, and then only allocate the arrays after |
| 69 | to avoid gcc's uninitialised warnings. |
| 70 | * nih-dbus-tool/tests/test_demarshal.c (test_demarshal): Update |
| 71 | expected output to match |
| 72 | * nih-dbus-tool/tests/expected/test_method_proxy_notify_function_standard.c, |
| 73 | * nih-dbus-tool/tests/expected/test_method_proxy_notify_function_array.c, |
| 74 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_standard.c, |
| 75 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_no_input.c: |
| 76 | Update the method tests expected output too |
| 77 | |
Scott James Remnant | d3c3225 | 2009-07-09 12:50:09 +0100 | [diff] [blame] | 78 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c (test_new_struct_array) |
| 79 | (test_new_dict_entry_array): Initialise alloc-safe variables to |
| 80 | NULL to avoid gcc warning |
| 81 | |
Scott James Remnant | ad3dc2b | 2009-07-09 10:02:01 +0100 | [diff] [blame] | 82 | * nih-dbus/dbus_connection.c (nih_dbus_timeout_toggled): Use the |
| 83 | monotonic clock to recalculate the timer |
| 84 | * nih-dbus/Makefile.am (libnih_dbus_la_LIBS): Rename to _LIBADD |
| 85 | (libnih_dbus_la_LIBADD): Link with librt |
| 86 | |
Scott James Remnant | f1a7d51 | 2009-07-09 09:55:02 +0100 | [diff] [blame] | 87 | * nih/timer.c (nih_timer_add_timeout, nih_timer_add_periodic) |
| 88 | (nih_timer_poll): Use a monotonic clock for timers, not the realtime |
| 89 | clock. |
| 90 | * nih/main.c (nih_main_loop): Calculate select time based on the |
| 91 | monotonic clock. |
| 92 | * nih/Makefile.am (libnih_la_LIBADD): Link with librt |
| 93 | |
Scott James Remnant | b1c1647 | 2009-07-09 00:11:10 +0100 | [diff] [blame] | 94 | * README: Bump the recommended D-Bus |
| 95 | |
Scott James Remnant | 27827f2 | 2009-07-08 21:40:57 +0100 | [diff] [blame] | 96 | 2009-07-08 Scott James Remnant <scott@netsplit.com> |
| 97 | |
Scott James Remnant | 2ffa871 | 2009-07-08 22:00:07 +0100 | [diff] [blame] | 98 | * nih/file.c (nih_dir_walk_scan): Should compare against DT_DIR |
| 99 | not use S_ISDIR |
| 100 | |
Scott James Remnant | d1dc698 | 2009-07-08 21:41:49 +0100 | [diff] [blame] | 101 | * NEWS: Update. |
| 102 | |
Scott James Remnant | 27827f2 | 2009-07-08 21:40:57 +0100 | [diff] [blame] | 103 | * nih/file.h (NihFileFilter): Add an is_dir argument |
| 104 | * nih/file.c (nih_dir_walk_scan): Pass the new argument |
| 105 | * nih/watch.c (nih_watch_handle): Pass the extra argument |
| 106 | * nih/tests/test_file.c (my_filter): Add the extra argument but |
| 107 | ignore |
| 108 | * nih/tests/test_watch.c (my_filter): Add here too |
| 109 | |
Scott James Remnant | 276f5fc | 2009-07-03 12:49:13 +0100 | [diff] [blame] | 110 | 2009-07-03 Scott James Remnant <scott@netsplit.com> |
| 111 | |
| 112 | * nih/error.h (NihError): Declare this a slightly odd way to |
| 113 | permit the members to be directly embedded in sub-classes rather |
| 114 | than referring back through an accessor variable. |
| 115 | * nih-dbus/dbus_error.h (nih_dbus_error): Embed the NihError |
| 116 | members directly using the new macro. |
| 117 | * nih-dbus/dbus_error.c (nih_dbus_error_raise) |
| 118 | (nih_dbus_error_raise_printf): Just set number and message directly; |
| 119 | cast before raising. |
| 120 | * nih-dbus/dbus_object.c (nih_dbus_object_property_get) |
| 121 | (nih_dbus_object_property_get_all, nih_dbus_object_property_set): |
| 122 | Access message through the dbus_err cast. |
| 123 | * nih-dbus/tests/test_dbus_error.c (test_error_raise) |
| 124 | (test_error_raise_printf): Test directly accessing the number |
| 125 | and message. |
| 126 | |
Scott James Remnant | d76fec9 | 2009-07-02 13:45:15 +0100 | [diff] [blame] | 127 | 2009-07-02 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | 95ccf34 | 2009-07-02 13:53:12 +0100 | [diff] [blame] | 128 | |
Scott James Remnant | 27e37cc | 2009-07-02 17:52:16 +0100 | [diff] [blame] | 129 | * nih-dbus/tests/test_dbus_proxy.c (test_connect): We can end up |
| 130 | with a lot of stray signals with these tests, so open and close |
| 131 | the connections for each one. |
| 132 | |
Scott James Remnant | 269262c | 2009-07-02 17:50:16 +0100 | [diff] [blame] | 133 | * NEWS: Update. |
| 134 | * TODO: Update. |
| 135 | |
Scott James Remnant | 3b10811 | 2009-07-02 17:29:08 +0100 | [diff] [blame] | 136 | * nih-dbus-tool/interface.c (interface_proxy_get_all_function) |
| 137 | (interface_proxy_get_all_sync_function), |
| 138 | * nih-dbus-tool/method.c (method_proxy_function) |
| 139 | (method_proxy_sync_function), |
| 140 | * nih-dbus-tool/property.c (property_proxy_get_function) |
| 141 | (property_proxy_set_function, property_proxy_get_sync_function) |
| 142 | (property_proxy_set_sync_function): Set the auto_start flag in |
| 143 | new method calls that we create. |
| 144 | * tests/expected/test_interface_proxy_get_all_function_standard.c, |
| 145 | * tests/expected/test_interface_proxy_get_all_sync_function_standard.c, |
| 146 | * tests/expected/test_interface_proxy_get_all_sync_function_structure.c, |
| 147 | * tests/expected/test_method_proxy_function_array.c, |
| 148 | * tests/expected/test_method_proxy_function_deprecated.c, |
| 149 | * tests/expected/test_method_proxy_function_no_args.c, |
| 150 | * tests/expected/test_method_proxy_function_standard.c, |
| 151 | * tests/expected/test_method_proxy_function_structure.c, |
| 152 | * tests/expected/test_method_proxy_sync_function_array_input.c, |
| 153 | * tests/expected/test_method_proxy_sync_function_deprecated.c, |
| 154 | * tests/expected/test_method_proxy_sync_function_no_args.c, |
| 155 | * tests/expected/test_method_proxy_sync_function_no_input.c, |
| 156 | * tests/expected/test_method_proxy_sync_function_no_output.c, |
| 157 | * tests/expected/test_method_proxy_sync_function_standard.c, |
| 158 | * tests/expected/test_method_proxy_sync_function_structure_input.c, |
| 159 | * tests/expected/test_method_proxy_sync_function_structure_output.c, |
| 160 | * tests/expected/test_property_proxy_get_function_standard.c, |
| 161 | * tests/expected/test_property_proxy_get_function_deprecated.c, |
| 162 | * tests/expected/test_property_proxy_get_sync_function_standard.c, |
| 163 | * tests/expected/test_property_proxy_get_sync_function_structure.c, |
| 164 | * tests/expected/test_property_proxy_get_sync_function_deprecated.c, |
| 165 | * tests/expected/test_property_proxy_set_function_standard.c, |
| 166 | * tests/expected/test_property_proxy_set_function_structure.c, |
| 167 | * tests/expected/test_property_proxy_set_function_array.c, |
| 168 | * tests/expected/test_property_proxy_set_function_deprecated.c, |
| 169 | * tests/expected/test_property_proxy_set_sync_function_standard.c, |
| 170 | * tests/expected/test_property_proxy_set_sync_function_structure.c, |
| 171 | * tests/expected/test_property_proxy_set_sync_function_array.c, |
| 172 | * tests/expected/test_property_proxy_set_sync_function_deprecated.c, |
| 173 | * tests/expected/test_node_proxy_functions_standard.c, |
| 174 | * tests/expected/test_node_proxy_functions_no_methods.c, |
| 175 | * tests/expected/test_node_proxy_functions_no_signals.c, |
| 176 | * tests/expected/test_node_proxy_functions_no_properties.c, |
| 177 | * tests/expected/test_node_proxy_functions_only_properties.c, |
| 178 | * tests/expected/test_node_proxy_functions_structure.c, |
| 179 | * tests/expected/test_output_proxy_standard.c: |
| 180 | Update expected output. |
| 181 | |
Scott James Remnant | e3dc9c1 | 2009-07-02 17:18:00 +0100 | [diff] [blame] | 182 | * nih-dbus/dbus_proxy.h (NihDBusProxy): Add an auto_start member |
| 183 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_new): Initialise auto_start |
| 184 | member to TRUE (the D-Bus default). |
| 185 | * nih-dbus/tests/test_dbus_proxy.c (test_new): Add checks for |
| 186 | auto-start being TRUE. |
Scott James Remnant | aad726e | 2009-07-02 16:55:01 +0100 | [diff] [blame] | 187 | * nih-dbus-tool/signal.c (signal_proxy_function): Look up connection |
| 188 | and path through the proxy object; if the proxy object has a name, |
| 189 | compare the signal sender against the OWNER of that name, not the |
| 190 | name. |
Scott James Remnant | eff3a5a | 2009-07-02 16:34:17 +0100 | [diff] [blame] | 191 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Drop |
Scott James Remnant | aad726e | 2009-07-02 16:55:01 +0100 | [diff] [blame] | 192 | parent argument from calls to nih_dbus_proxy_connect. Add test |
| 193 | cases for signal catching on peer-to-peer and well-known name (we |
| 194 | were previously just using unique). |
Scott James Remnant | eff3a5a | 2009-07-02 16:34:17 +0100 | [diff] [blame] | 195 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c (test_new_byte) |
| 196 | (test_new_boolean, test_new_int16, test_new_uint16) |
| 197 | (test_new_int32, test_new_uint32, test_new_int64) |
| 198 | (test_new_uint64, test_new_double, test_new_string) |
| 199 | (test_new_object_path, test_new_signature, test_new_struct) |
| 200 | (test_new_int32_array, test_new_str_array) |
| 201 | (test_new_int32_array_array, test_new_struct_array) |
| 202 | (test_new_dict_entry_array): Drop the parent argument from calls |
| 203 | to nih_dbus_proxy_connect |
Scott James Remnant | aad726e | 2009-07-02 16:55:01 +0100 | [diff] [blame] | 204 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_standard.c, |
| 205 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_no_args.c, |
| 206 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_structure.c, |
| 207 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_deprecated.c, |
| 208 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_standard.c, |
| 209 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_methods.c, |
| 210 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_properties.c, |
| 211 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_structure.c, |
| 212 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.c: |
| 213 | Update expected output |
Scott James Remnant | eff3a5a | 2009-07-02 16:34:17 +0100 | [diff] [blame] | 214 | |
Scott James Remnant | b2a492d | 2009-07-02 15:58:53 +0100 | [diff] [blame] | 215 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_new): Track the name whenever |
| 216 | one is given, not just when we have a lost handler. |
| 217 | (nih_dbus_proxy_name_track): lost_handler is not compulsory |
| 218 | (nih_dbus_proxy_name_owner_changed): Make the lost handler optional |
| 219 | (nih_dbus_proxy_destroy): name tracking must be cleaned up when |
| 220 | there's a name, not a lost handler |
| 221 | * nih-dbus/tests/test_dbus_proxy.c (test_name_owner_changed): Add |
| 222 | tests for both well-known and unique names with both being tracked. |
| 223 | (test_name_owner_changed): Add a test case for tracking a unique |
| 224 | name. |
| 225 | |
Scott James Remnant | 04d181a | 2009-07-02 15:47:11 +0100 | [diff] [blame] | 226 | * nih-dbus/dbus_proxy.h (NihDBusProxySignal): Go back to just |
| 227 | holding a reference to the proxy in the connected signal, we need |
| 228 | its name owner tracking. |
| 229 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_connect): Keep a reference |
| 230 | to the proxy, don't copy the members in; be allocated as a child |
| 231 | of the proxy. |
| 232 | |
| 233 | * nih-dbus/tests/test_dbus_proxy.c (test_connect): Add a test |
| 234 | case for connecting to a signal by well-known name, rather than |
| 235 | just unique name |
| 236 | |
Scott James Remnant | 0a07493 | 2009-07-02 15:05:15 +0100 | [diff] [blame] | 237 | * nih-dbus-tool/output.c (output): Don't know where the word |
| 238 | "Forward" came from in this comment, delete it. |
| 239 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.c, |
| 240 | * nih-dbus-tool/tests/expected/test_output_object_standard.c: |
| 241 | Delete from the expected output as well. |
| 242 | |
Scott James Remnant | fe6d033 | 2009-07-02 14:46:08 +0100 | [diff] [blame] | 243 | * nih-dbus-tool/main.c: Add a --default-interface argument that |
| 244 | takes the place of setting the Symbol annotation to "". This is |
| 245 | much cleaner, and allows the user of the code to decide, not the |
| 246 | author of the interface. |
| 247 | |
Scott James Remnant | 09826fa | 2009-07-02 14:39:37 +0100 | [diff] [blame] | 248 | * nih-dbus-tool/interface.c (interface_annotation): Don't allow |
| 249 | the symbol annotation to be empty again. |
| 250 | (interface_end_tag): Which means that the symbol can never be |
| 251 | empty when we get to here. |
| 252 | * nih-dbus-tool/tests/test_interface.c (test_annotation): Drop the |
| 253 | test case for the empty annotation. |
| 254 | (test_end_tag): And drop the empty string test case. |
| 255 | |
Scott James Remnant | 98a4bbe | 2009-07-02 14:17:41 +0100 | [diff] [blame] | 256 | * nih-dbus/tests/test_dbus_object.c (test_object_property_get) |
Scott James Remnant | 1156e43 | 2009-07-02 14:32:11 +0100 | [diff] [blame] | 257 | (test_object_property_set): We actually want "Access Denied" returned |
| 258 | instead of "No Such Method". |
| 259 | * nih-dbus/dbus_object.c (nih_dbus_object_property_get) |
| 260 | (nih_dbus_object_property_set): Rework so that we can return |
| 261 | "access denied". |
| 262 | |
| 263 | * nih-dbus/tests/test_dbus_object.c (test_object_property_get) |
Scott James Remnant | 98a4bbe | 2009-07-02 14:17:41 +0100 | [diff] [blame] | 264 | (test_object_property_set, test_object_property_get): Add some test |
| 265 | cases for property access. |
| 266 | |
Scott James Remnant | 505e31a | 2009-07-02 13:56:18 +0100 | [diff] [blame] | 267 | * TODO: Update. |
| 268 | |
Scott James Remnant | 95ccf34 | 2009-07-02 13:53:12 +0100 | [diff] [blame] | 269 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c (test_get_all) |
| 270 | (test_get_all_sync): End-to-end test of the proxy get_all functions. |
| 271 | |
Scott James Remnant | d76fec9 | 2009-07-02 13:45:15 +0100 | [diff] [blame] | 272 | * nih-dbus-tool/interface.c (interface_proxy_get_all_notify_function) |
| 273 | (interface_proxy_get_all_sync_function): We can't use continue to |
| 274 | repeat the loop, because there might be inner loops. Use the |
| 275 | local label trick. |
| 276 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_notify_function_standard.c, |
| 277 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_notify_function_structure.c, |
| 278 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_sync_function_standard.c, |
| 279 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_sync_function_structure.c, |
| 280 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_standard.c, |
| 281 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_methods.c, |
| 282 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_signals.c, |
| 283 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_only_properties.c, |
| 284 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.c: Update |
| 285 | expected output for test cases |
| 286 | |
Scott James Remnant | 40c78fa | 2009-07-01 11:49:55 +0100 | [diff] [blame] | 287 | 2009-07-01 Scott James Remnant <scott@netsplit.com> |
| 288 | |
Scott James Remnant | d3d305e | 2009-07-01 23:38:55 +0100 | [diff] [blame] | 289 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c (test_struct_to_str) |
| 290 | (test_struct_to_str_sync, test_str_to_struct) |
| 291 | (test_str_to_struct_sync, test_struct_array_to_str) |
| 292 | (test_struct_array_to_str_sync, test_str_to_struct_array) |
| 293 | (test_str_to_struct_array_sync, test_dict_entry_array_to_str) |
| 294 | (test_dict_entry_array_to_str_sync) |
| 295 | (test_str_to_dict_entry_array) |
| 296 | (test_str_to_dict_entry_array_sync, test_new_struct) |
| 297 | (test_new_struct_array, test_new_dict_entry_array) |
| 298 | (test_get_structure, test_get_structure_sync) |
| 299 | (test_set_structure, test_set_structure_sync) |
| 300 | (test_get_struct_array, test_get_struct_array_sync) |
| 301 | (test_set_struct_array, test_set_struct_array_sync) |
| 302 | (test_get_dict_entry_array, test_get_dict_entry_array_sync) |
| 303 | (test_set_dict_entry_array, test_set_dict_entry_array_sync): Proxy |
| 304 | test functions for structures, arrays of structures, and arrays |
| 305 | of dictionary entries in converstion, signal and property get/set |
| 306 | form. |
| 307 | |
Scott James Remnant | a66da9b | 2009-07-01 23:30:21 +0100 | [diff] [blame] | 308 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c (my_test_get_struct_array) |
| 309 | (my_test_get_dict_entry_array): Be consistent about what generates |
| 310 | a D-Bus error and what generates a generic error. |
| 311 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c (test_get_struct_array) |
| 312 | (test_get_dict_entry_array): Update to match. |
| 313 | |
Scott James Remnant | 40c78fa | 2009-07-01 11:49:55 +0100 | [diff] [blame] | 314 | * nih-dbus-tool/tests/com.netsplit.Nih.Test.xml: Add methods, signals |
| 315 | and properties that take a structure, an array of structures and an |
| 316 | array of dictionary entries to the tests. |
| 317 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.h: Add structure |
| 318 | definition for the property we store behind the scenes, add extern |
| 319 | variables for the structure and structure/dictionary array properties |
| 320 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c (my_test_struct_to_str) |
| 321 | (my_test_str_to_struct, my_test_struct_array_to_str) |
| 322 | (my_test_str_to_struct_array, my_test_dict_entry_array_to_str) |
| 323 | (my_test_str_to_dict_entry_array, my_test_get_structure) |
| 324 | (my_test_set_structure, my_test_get_struct_array) |
| 325 | (my_test_set_struct_array, my_test_get_dict_entry_array) |
| 326 | (my_test_set_dict_entry_array): Add implementation for the structure |
| 327 | and structure/dictionary array conversion functions and property |
| 328 | get/set functions. Signal emission is implemented entirely by the |
| 329 | binding tool. |
| 330 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c (test_struct_to_str) |
| 331 | (test_str_to_struct, test_struct_array_to_str) |
| 332 | (test_str_to_struct_array, test_dict_entry_array_to_str) |
| 333 | (test_str_to_dict_entry_array, test_new_struct) |
| 334 | (test_new_struct_array, test_new_dict_entry_array) |
| 335 | (test_get_structure, test_set_structure, test_get_struct_array) |
| 336 | (test_set_struct_array, test_get_dict_entry_array) |
| 337 | (test_set_dict_entry_array): Add new test cases for structures, |
| 338 | structure arrays and dictionaries. |
| 339 | |
Scott James Remnant | 16030c9 | 2009-06-30 11:46:35 +0100 | [diff] [blame] | 340 | 2009-06-30 Scott James Remnant <scott@netsplit.com> |
| 341 | |
Scott James Remnant | 1ce132a | 2009-06-30 13:14:02 +0100 | [diff] [blame] | 342 | * nih-dbus-tool/tests/test_node.c (test_proxy_functions): Structures |
| 343 | of readable properties come after all writable ones |
| 344 | |
Scott James Remnant | e6579fc | 2009-06-30 13:05:56 +0100 | [diff] [blame] | 345 | * nih-dbus-tool/tests/com.netsplit.Nih.Test.xml: Can't just call the |
| 346 | property "double" now it ends up in a structure, apply an annotation |
| 347 | to change the symbol. |
| 348 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c (my_test_get_double) |
| 349 | (my_test_set_double): Rename |
| 350 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c (test_get_double) |
| 351 | (test_get_double_sync, test_set_double, test_set_double_sync): Call |
| 352 | the renamed functions. |
| 353 | |
Scott James Remnant | b88af28 | 2009-06-30 12:54:20 +0100 | [diff] [blame] | 354 | * nih-dbus-tool/tests/test_marshal.c (test_marshal): Add missing test |
| 355 | cases for arrays of dictionary entries. |
| 356 | * nih-dbus-tool/tests/marshal_factory.c: Generate a dict entry test |
| 357 | * nih-dbus-tool/tests/marshal_code.h: Add the expected structure type |
| 358 | and prototypes. |
| 359 | * nih-dbus-tool/tests/test_demarshal.c (test_demarshal): Add missing |
| 360 | test cases for arrays of dictionary entries. |
| 361 | * nih-dbus-tool/tests/demarshal_code.h: Add the expected structure |
| 362 | type and prototypes. |
| 363 | * nih-dbus-tool/tests/demarshal_factory.c: Generate a dict entry test |
| 364 | |
Scott James Remnant | e9bac43 | 2009-06-30 12:41:47 +0100 | [diff] [blame] | 365 | * nih-dbus-tool/marshal.c, nih-dbus-tool/demarshal.c, |
| 366 | * nih-dbus-tool/node.c, nih-dbus-tool/method.c, nih-dbus-tool/signal.c, |
| 367 | * nih-dbus-tool/property.c: Add missing mention of @structs in |
| 368 | function documentation. |
| 369 | |
Scott James Remnant | f93535a | 2009-06-30 12:29:51 +0100 | [diff] [blame] | 370 | * nih-dbus-tool/tests/test_interface.c (test_proxy_get_all_function) |
| 371 | (test_proxy_get_all_notify_function) |
| 372 | (test_proxy_get_all_sync_function): Include a mix of readwrite, read |
| 373 | and writable properties in the test - only the first two should |
| 374 | appear in the output. |
| 375 | |
Scott James Remnant | d50de32 | 2009-06-30 12:26:26 +0100 | [diff] [blame] | 376 | * nih-dbus-tool/output.c (output): Source should include string.h and |
| 377 | stdint.h for the following code, header should include stdint.h |
| 378 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.c: |
| 379 | Add the headers and the get_all functions to the expected output |
| 380 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.h: |
| 381 | Add the headers, properties structure and get_all function prototypes |
| 382 | to the expected output |
| 383 | * nih-dbus-tool/tests/expected/test_output_object_standard.c, |
| 384 | * nih-dbus-tool/tests/expected/test_output_object_standard.h, |
| 385 | * nih-dbus-tool/tests/expected/test_output_object_no_interfaces.c, |
| 386 | * nih-dbus-tool/tests/expected/test_output_object_no_interfaces.h, |
| 387 | * nih-dbus-tool/tests/expected/test_output_proxy_no_interfaces.c: |
| 388 | * nih-dbus-tool/tests/expected/test_output_proxy_no_interfaces.h: |
| 389 | Add the headers to the expected output |
| 390 | |
Scott James Remnant | ae2b2b1 | 2009-06-30 11:49:15 +0100 | [diff] [blame] | 391 | * nih/test_files.h (TEST_EXPECTED_STR): Don't just compare the start |
| 392 | of the string, make sure we compare the whole string - easiest way |
| 393 | is to check the length first |
| 394 | (TEST_EXPECTED_FILE): Make sure the files are the same length |
| 395 | |
Scott James Remnant | 16030c9 | 2009-06-30 11:46:35 +0100 | [diff] [blame] | 396 | * nih-dbus-tool/node.c (node_proxy_functions): If there are |
| 397 | properties, include the async and sync versions of the get_all |
| 398 | function. These define all the property structs, so the only ones |
| 399 | we need are the write-only ones. |
| 400 | * nih-dbus-tool/tests/test_node.c (test_proxy_functions): Add |
| 401 | the expected externs, prototypes, typedefs and structs for the |
| 402 | get_all function. |
| 403 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_standard.c, |
| 404 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_methods.c, |
| 405 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_signals.c, |
| 406 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_only_properties.c, |
| 407 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_structure.c: |
| 408 | Add the "get_all" function expected output. |
| 409 | |
Scott James Remnant | 42891f5 | 2009-06-29 20:29:09 +0100 | [diff] [blame] | 410 | 2009-06-29 Scott James Remnant <scott@netsplit.com> |
| 411 | |
Scott James Remnant | 9b543fe | 2009-06-29 20:29:41 +0100 | [diff] [blame] | 412 | * nih/test_files.h (TEST_EXPECTED_STR): Display the full original |
| 413 | string, not just the first part. |
| 414 | |
Scott James Remnant | 42891f5 | 2009-06-29 20:29:09 +0100 | [diff] [blame] | 415 | * nih-dbus-tool/interface.c (interface_proxy_get_all_function) |
| 416 | (interface_proxy_get_all_notify_function) |
| 417 | (interface_proxy_get_all_sync_function): Add functions to generate |
| 418 | proxy methods that get all of the properties of the given interface, |
| 419 | returned as members of a structure. |
| 420 | * nih-dbus-tool/interface.h: Add prototypes. |
| 421 | * nih-dbus-tool/tests/interface_factory.c: Call the new functions |
| 422 | to generate other functions that we can test |
| 423 | * nih-dbus-tool/tests/interface_code.h: Expected structure definitions, |
| 424 | typedefs and prototypes for generated code. |
| 425 | * nih-dbus-tool/tests/test_interface.c (test_proxy_get_all_function) |
| 426 | (test_proxy_get_all_notify_function) |
| 427 | (test_proxy_get_all_sync_function): Test both the generator functions |
| 428 | themselves and the code that they generate. |
| 429 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_function_standard.c, |
| 430 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_notify_function_standard.c, |
| 431 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_notify_function_structure.c, |
| 432 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_sync_function_standard.c, |
| 433 | * nih-dbus-tool/tests/expected/test_interface_proxy_get_all_sync_function_structure.c: |
| 434 | Expected output from generators |
| 435 | * nih-dbus-tool/Makefile.am (check_PROGRAMS): Build the interface |
| 436 | factory binary |
| 437 | (test_interface_SOURCES): Depend on the header file |
| 438 | (nodist_test_interface_SOURCES): Build and link the generated source |
| 439 | (test_interface_LDADD): Need to link to libnih-dbus.la |
| 440 | (interface_factory_SOURCES, interface_factory_LDFLAGS) |
| 441 | (interface_factory_LDADD, tests/interface_code.c): Details to build |
| 442 | interface factory binary |
| 443 | (CLEANFILES): Make sure we clean up |
| 444 | (EXTRA_DIST): Distribute expected files |
| 445 | |
Scott James Remnant | 48f98e9 | 2009-06-28 15:00:11 +0100 | [diff] [blame] | 446 | 2009-06-28 Scott James Remnant <scott@netsplit.com> |
| 447 | |
Scott James Remnant | a69dd97 | 2009-06-28 17:17:42 +0100 | [diff] [blame] | 448 | * nih/test_files.h (TEST_EXPECTED_STR, TEST_EXPECTED_FILE): It's |
| 449 | getting increasingly annoying to have very large strings containing |
| 450 | C source which we compare, add a couple of macros to let us compare |
| 451 | a string or file against the contents of a file under tests/expected |
| 452 | * nih-dbus-tool/tests/test_method.c, |
| 453 | * nih-dbus-tool/tests/test_signal.c, |
| 454 | * nih-dbus-tool/tests/test_property.c, |
| 455 | * nih-dbus-tool/tests/test_node.c, |
| 456 | * nih-dbus-tool/tests/test_output.c: Cut out the embedded C source |
| 457 | into separate files |
| 458 | * nih-dbus-tool/tests/expected/test_method_object_function_standard.c, |
| 459 | * nih-dbus-tool/tests/expected/test_method_object_function_no_input.c, |
| 460 | * nih-dbus-tool/tests/expected/test_method_object_function_no_output.c, |
| 461 | * nih-dbus-tool/tests/expected/test_method_object_function_structure_input.c, |
| 462 | * nih-dbus-tool/tests/expected/test_method_object_function_structure_output.c, |
| 463 | * nih-dbus-tool/tests/expected/test_method_object_function_no_args.c, |
| 464 | * nih-dbus-tool/tests/expected/test_method_object_function_async.c, |
| 465 | * nih-dbus-tool/tests/expected/test_method_object_function_deprecated.c, |
| 466 | * nih-dbus-tool/tests/expected/test_method_reply_function_standard.c, |
| 467 | * nih-dbus-tool/tests/expected/test_method_reply_function_no_args.c, |
| 468 | * nih-dbus-tool/tests/expected/test_method_reply_function_structure.c, |
| 469 | * nih-dbus-tool/tests/expected/test_method_reply_function_array.c, |
| 470 | * nih-dbus-tool/tests/expected/test_method_reply_function_deprecated.c, |
| 471 | * nih-dbus-tool/tests/expected/test_method_proxy_function_standard.c, |
| 472 | * nih-dbus-tool/tests/expected/test_method_proxy_function_no_args.c, |
| 473 | * nih-dbus-tool/tests/expected/test_method_proxy_function_structure.c, |
| 474 | * nih-dbus-tool/tests/expected/test_method_proxy_function_array.c, |
| 475 | * nih-dbus-tool/tests/expected/test_method_proxy_function_deprecated.c, |
| 476 | * nih-dbus-tool/tests/expected/test_method_proxy_notify_function_standard.c, |
| 477 | * nih-dbus-tool/tests/expected/test_method_proxy_notify_function_no_args.c, |
| 478 | * nih-dbus-tool/tests/expected/test_method_proxy_notify_function_structure.c, |
| 479 | * nih-dbus-tool/tests/expected/test_method_proxy_notify_function_array.c, |
| 480 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_standard.c, |
| 481 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_no_input.c, |
| 482 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_no_output.c, |
| 483 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_no_args.c, |
| 484 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_structure_input.c, |
| 485 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_structure_output.c, |
| 486 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_array_input.c, |
| 487 | * nih-dbus-tool/tests/expected/test_method_proxy_sync_function_deprecated.c, |
| 488 | * nih-dbus-tool/tests/expected/test_signal_object_function_standard.c, |
| 489 | * nih-dbus-tool/tests/expected/test_signal_object_function_no_args.c, |
| 490 | * nih-dbus-tool/tests/expected/test_signal_object_function_structure.c, |
| 491 | * nih-dbus-tool/tests/expected/test_signal_object_function_array.c, |
| 492 | * nih-dbus-tool/tests/expected/test_signal_object_function_deprecated.c, |
| 493 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_standard.c, |
| 494 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_no_args.c, |
| 495 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_structure.c, |
| 496 | * nih-dbus-tool/tests/expected/test_signal_proxy_function_deprecated.c, |
| 497 | * nih-dbus-tool/tests/expected/test_property_object_get_function_standard.c, |
| 498 | * nih-dbus-tool/tests/expected/test_property_object_get_function_structure.c, |
| 499 | * nih-dbus-tool/tests/expected/test_property_object_get_function_deprecated.c, |
| 500 | * nih-dbus-tool/tests/expected/test_property_object_set_function_standard.c, |
| 501 | * nih-dbus-tool/tests/expected/test_property_object_set_function_structure.c, |
| 502 | * nih-dbus-tool/tests/expected/test_property_object_set_function_deprecated.c, |
| 503 | * nih-dbus-tool/tests/expected/test_property_proxy_get_function_standard.c, |
| 504 | * nih-dbus-tool/tests/expected/test_property_proxy_get_function_deprecated.c, |
| 505 | * nih-dbus-tool/tests/expected/test_property_proxy_get_notify_function_standard.c, |
| 506 | * nih-dbus-tool/tests/expected/test_property_proxy_get_notify_function_structure.c, |
| 507 | * nih-dbus-tool/tests/expected/test_property_proxy_get_notify_function_deprecated.c, |
| 508 | * nih-dbus-tool/tests/expected/test_property_proxy_set_function_standard.c, |
| 509 | * nih-dbus-tool/tests/expected/test_property_proxy_set_function_structure.c, |
| 510 | * nih-dbus-tool/tests/expected/test_property_proxy_set_function_array.c, |
| 511 | * nih-dbus-tool/tests/expected/test_property_proxy_set_function_deprecated.c, |
| 512 | * nih-dbus-tool/tests/expected/test_property_proxy_set_notify_function_standard.c, |
| 513 | * nih-dbus-tool/tests/expected/test_property_proxy_set_notify_function_deprecated.c, |
| 514 | * nih-dbus-tool/tests/expected/test_property_proxy_get_sync_function_standard.c, |
| 515 | * nih-dbus-tool/tests/expected/test_property_proxy_get_sync_function_structure.c, |
| 516 | * nih-dbus-tool/tests/expected/test_property_proxy_get_sync_function_deprecated.c, |
| 517 | * nih-dbus-tool/tests/expected/test_property_proxy_set_sync_function_standard.c, |
| 518 | * nih-dbus-tool/tests/expected/test_property_proxy_set_sync_function_structure.c, |
| 519 | * nih-dbus-tool/tests/expected/test_property_proxy_set_sync_function_array.c, |
| 520 | * nih-dbus-tool/tests/expected/test_property_proxy_set_sync_function_deprecated.c, |
| 521 | * nih-dbus-tool/tests/expected/test_node_interfaces_array_object.c, |
| 522 | * nih-dbus-tool/tests/expected/test_node_interfaces_array_proxy.c, |
| 523 | * nih-dbus-tool/tests/expected/test_node_interfaces_array_none.c, |
| 524 | * nih-dbus-tool/tests/expected/test_node_object_functions_standard.c, |
| 525 | * nih-dbus-tool/tests/expected/test_node_object_functions_no_methods.c, |
| 526 | * nih-dbus-tool/tests/expected/test_node_object_functions_no_signals.c, |
| 527 | * nih-dbus-tool/tests/expected/test_node_object_functions_no_properties.c, |
| 528 | * nih-dbus-tool/tests/expected/test_node_object_functions_only_properties.c, |
| 529 | * nih-dbus-tool/tests/expected/test_node_object_functions_structure.c, |
| 530 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_standard.c, |
| 531 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_methods.c, |
| 532 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_signals.c, |
| 533 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_no_properties.c, |
| 534 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_only_properties.c, |
| 535 | * nih-dbus-tool/tests/expected/test_node_proxy_functions_structure.c, |
| 536 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.c, |
| 537 | * nih-dbus-tool/tests/expected/test_output_proxy_standard.h, |
| 538 | * nih-dbus-tool/tests/expected/test_output_proxy_no_interfaces.c, |
| 539 | * nih-dbus-tool/tests/expected/test_output_proxy_no_interfaces.h, |
| 540 | * nih-dbus-tool/tests/expected/test_output_object_standard.c, |
| 541 | * nih-dbus-tool/tests/expected/test_output_object_standard.h, |
| 542 | * nih-dbus-tool/tests/expected/test_output_object_no_interfaces.c, |
| 543 | * nih-dbus-tool/tests/expected/test_output_object_no_interfaces.h: |
| 544 | Expected output texts |
| 545 | * nih-dbus-tool/Makefile.am (EXTRA_DIST): Distribute the expected |
| 546 | source files |
| 547 | |
Scott James Remnant | c2739f2 | 2009-06-28 15:41:59 +0100 | [diff] [blame] | 548 | * nih-dbus-tool/output.c (output): Pass a structs list to calls to |
| 549 | node_output_functions() and node_proxy_functions() and place the |
| 550 | formatted output in the header file before the typedefs. |
| 551 | * nih-dbus-tool/tests/test_output.c (test_output): Make sure we |
| 552 | test having a structure in both proxy and object mode. |
| 553 | |
Scott James Remnant | 48f98e9 | 2009-06-28 15:00:11 +0100 | [diff] [blame] | 554 | * nih-dbus-tool/node.c (node_object_functions) |
| 555 | (node_proxy_functions): Call the various function generators with |
| 556 | a structs list, which we copy up into our own new structs argument. |
| 557 | * nih-dbus-tool/node.h: Add structs arguments to prototypes |
| 558 | * nih-dbus-tool/tests/test_node.c (test_object_functions) |
| 559 | (test_proxy_functions): Pass the structs argument in; make sure the |
| 560 | structures are passed back as well without duplicating the definitions |
| 561 | when we have multiple functions that declare them. |
| 562 | |
Scott James Remnant | a08582e | 2009-06-26 11:39:10 +0100 | [diff] [blame] | 563 | 2009-06-26 Scott James Remnant <scott@netsplit.com> |
| 564 | |
Scott James Remnant | 8a60bcf | 2009-06-26 18:28:13 +0100 | [diff] [blame] | 565 | * nih-dbus-tool/property.c (property_object_get_function) |
| 566 | (property_object_set_function) |
| 567 | (property_proxy_get_notify_function) |
| 568 | (property_proxy_set_function, property_proxy_get_sync_function) |
| 569 | (property_proxy_set_sync_function): Call marshal() and demarshal() |
| 570 | with the extra arguments, obtaining most of them from our arguments |
| 571 | including the Interface and Property structures. Copy back the list |
| 572 | of structures returned into a new structs argument that these |
| 573 | functions accept. |
| 574 | (property_proxy_get_function) |
| 575 | (property_proxy_set_notify_function): Add the extra structs argument |
| 576 | for consistency, though we don't do anything with it |
| 577 | * nih-dbus-tool/property.h: Update prototypes to add new argument |
| 578 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 579 | (test_object_set_function, test_proxy_get_notify_function) |
| 580 | (test_proxy_set_function, test_proxy_get_sync_function) |
| 581 | (test_proxy_set_sync_function): Pass in the structs array, add tests |
| 582 | to make sure that members of this array are passed back when the |
| 583 | property is a structure |
| 584 | (test_proxy_get_function, test_proxy_set_notify_function): Pass in |
| 585 | the structs array, no need to tests passing back because none ever |
| 586 | will be, |
| 587 | * nih-dbus-tool/tests/property_factory.c: Pass expected structs |
| 588 | list when generating the code. |
| 589 | |
Scott James Remnant | 88202be | 2009-06-26 17:31:59 +0100 | [diff] [blame] | 590 | * nih-dbus-tool/symbol.c (symbol_typedef): Allow the postfix to |
| 591 | be NULL (property structures) |
| 592 | * nih-dbus-tool/tests/test_symbol.c (test_typedef): Add tests for |
| 593 | without postfix with/without other arguments. |
| 594 | |
Scott James Remnant | adf7111 | 2009-06-26 16:55:15 +0100 | [diff] [blame] | 595 | * nih-dbus-tool/signal.c (signal_object_function) |
| 596 | (signal_proxy_function): Call marshal() and demarshal() with the |
| 597 | extra arguments, obtaining most of them from our arguments including |
| 598 | the Interface and Signal structures. Copy back the list of |
| 599 | structures returned into a new structs argument that these functions |
| 600 | accept. |
| 601 | * nih-dbus-tool/signal.h: Update prototypes to add new argument |
| 602 | * nih-dbus-tool/tests/test_signal.c (test_object_function) |
| 603 | (test_proxy_function): Pass in the structs array, add tests to |
| 604 | make sure that members of this array are passed back when the signal |
| 605 | has structure arguments |
| 606 | * nih-dbus-tool/tests/signal_factory.c: Pass expected structs list |
| 607 | when generating the code. |
| 608 | |
Scott James Remnant | 1e49a87 | 2009-06-26 16:38:49 +0100 | [diff] [blame] | 609 | * nih-dbus-tool/method.c (method_object_function) |
| 610 | (method_reply_function, method_proxy_function) |
| 611 | (method_proxy_notify_function, method_proxy_sync_function): Call |
| 612 | marshal() and demarshal() with the extra arguments, obtaining most |
| 613 | of them from our arguments including the Interface and Method |
| 614 | structures. Copy back the list of structures returned into a new |
| 615 | structs argument that these functions accept. |
| 616 | * nih-dbus-tool/method.h: Update prototypes to add new argument |
| 617 | * nih-dbus-tool/tests/test_method.c (test_object_function) |
| 618 | (test_reply_function, test_proxy_function) |
| 619 | (test_proxy_notify_function, test_proxy_sync_function): Pass in the |
| 620 | structs array, add tests to make sure that members of this array |
| 621 | are passed back when the method has array arguments |
| 622 | * nih-dbus-tool/tests/method_factory.c: Pass expected structs list |
| 623 | when generating the code. |
| 624 | |
Scott James Remnant | 3274678 | 2009-06-26 13:54:59 +0100 | [diff] [blame] | 625 | * nih-dbus-tool/demarshal.c (demarshal_struct): Generate the structure |
| 626 | name using symbol_typedef() rather than expecting type_of() to do |
| 627 | it for us. To do this we need extra arguments giving us the |
| 628 | interface, member and variable symbol names. Create a TypeStruct |
| 629 | for it, adding members as we go, and return it via the extra structs |
| 630 | list. |
| 631 | (demarshal_array): Take the same extra arguments as demarshal_struct() |
| 632 | so we can support arrays of structures, pass them to our recursive |
| 633 | demarshal() call and make sure we pass structs back up. Create a |
| 634 | custom symbol for the structure array, so that it becomes |
| 635 | "PrefixInterfaceMemberArgElement". |
| 636 | (demarshal_basic): Take the extra arguments for consistency, though |
| 637 | we don't do anything with them. |
| 638 | (demarshal): Take the extra arguments, pass down to the static |
| 639 | functions. |
| 640 | * nih-dbus-tool/demarshal.h: Update prototypes. |
| 641 | * nih-dbus-tool/tests/test_demarshal.c (test_demarshal): Pass in |
| 642 | strings and structs list, check the structs list contents on the |
| 643 | way out |
| 644 | * nih-dbus-tool/tests/demarshal_factory.c (demarshal_function): Pass |
| 645 | expected structs and structs list when generating the code. |
| 646 | * nih-dbus-tool/tests/demarshal_code.h: Changes required in the name |
| 647 | of the expected structures |
| 648 | * nih-dbus-tool/Makefile.am (demarshal_factory_LDADD): Link to symbol |
| 649 | |
Scott James Remnant | 17f8a6a | 2009-06-26 13:29:08 +0100 | [diff] [blame] | 650 | * nih-dbus-tool/marshal.c (marshal_struct): Generate the structure |
| 651 | name using symbol_typedef() rather than expecting type_of() to do |
| 652 | it for us. To do this we need extra arguments giving us the |
| 653 | interface, member and variable symbol names. Create a TypeStruct |
| 654 | for it, adding members as we go, and return it via the extra structs |
| 655 | list. |
| 656 | (marshal_array): Take the same extra arguments as marshal_struct() |
| 657 | so we can support arrays of structures, pass them to our recursive |
| 658 | marshal() call and make sure we pass structs back up. Create a |
| 659 | custom symbol for the structure array, so that it becomes |
| 660 | "PrefixInterfaceMemberArgElement". |
| 661 | (marshal_basic): Take the extra arguments for consistency, though |
| 662 | we don't do anything with them. |
| 663 | (marshal): Take the extra arguments, pass down to the static |
| 664 | functions. |
| 665 | * nih-dbus-tool/marshal.h: Update prototypes. |
| 666 | * nih-dbus-tool/tests/test_marshal.c (test_marshal): Pass in strings |
| 667 | and structs list, check the structs list contents on the way out |
| 668 | * nih-dbus-tool/tests/marshal_factory.c (marshal_function): Pass |
| 669 | expected structs and structs list when generating the code. |
| 670 | * nih-dbus-tool/tests/marshal_code.h: Changes required in the name |
| 671 | of the expected structures |
| 672 | * nih-dbus-tool/Makefile.am (marshal_factory_LDADD): Link to symbol |
| 673 | |
Scott James Remnant | c54d03d | 2009-06-26 11:59:18 +0100 | [diff] [blame] | 674 | * nih-dbus-tool/type.c (type_of): Simplify type_of() so that it |
| 675 | only works for basic types. |
| 676 | * nih-dbus-tool/tests/test_type.c (test_of): Remove complex types |
| 677 | |
Scott James Remnant | 2324a29 | 2009-06-26 11:56:34 +0100 | [diff] [blame] | 678 | * nih-dbus-tool/type.h (TypeStruct): Add another type for structure |
| 679 | definitions, we need to know the name and a list of members. |
| 680 | * nih-dbus-tool/type.c (type_struct_new, type_struct_to_string): |
| 681 | Function to allocate the new type and convert it to a string |
| 682 | definition. |
| 683 | * nih-dbus-tool/tests/test_type.c (test_struct_new) |
| 684 | (test_struct_to_string): Add tests for the two new functions. |
| 685 | * nih-dbus-tool/Makefile.am (test_type_LDADD): Link to indent & symbol |
| 686 | (test_marshal_LDADD, test_demarshal_LDADD): These need to link to |
| 687 | symbol as well. |
| 688 | |
Scott James Remnant | a08582e | 2009-06-26 11:39:10 +0100 | [diff] [blame] | 689 | * nih-dbus/dbus_proxy.h: Since we use INT_MAX in a macro, we need |
| 690 | to include limits.h |
| 691 | |
Scott James Remnant | ca5cdd3 | 2009-06-23 10:29:37 +0100 | [diff] [blame] | 692 | 2009-06-23 Scott James Remnant <scott@netsplit.com> |
| 693 | |
| 694 | * COPYING: Change licence to version 2 of the GNU GPL. |
| 695 | All files have been updated to reflect this. |
| 696 | |
Scott James Remnant | 9da4215 | 2009-06-21 17:18:41 +0100 | [diff] [blame] | 697 | 2009-06-21 Scott James Remnant <scott@netsplit.com> |
| 698 | |
| 699 | * configure.ac: Bump version to 0.3.1 |
| 700 | * NEWS: Begin new release. |
| 701 | |
Scott James Remnant | e41f91d | 2009-06-17 10:07:06 +0100 | [diff] [blame] | 702 | 2009-06-17 Scott James Remnant <scott@netsplit.com> |
| 703 | |
Scott James Remnant | 4d1b3c6 | 2009-06-17 19:04:26 +0100 | [diff] [blame] | 704 | * NEWS: Release 0.3.0 |
| 705 | |
Scott James Remnant | 6e8dff9 | 2009-06-17 14:23:11 +0100 | [diff] [blame] | 706 | * nih-dbus-tool/tests/test_interface.c (test_annotation): Add test |
| 707 | case for an empty symbol annotation |
| 708 | * nih-dbus-tool/interface.c (interface_annotation): Explicitly allow |
| 709 | the symbol to be empty |
| 710 | |
Scott James Remnant | 7e8c65b | 2009-06-17 14:22:22 +0100 | [diff] [blame] | 711 | * configure.ac: Bump version up to 0.3.0, I think the nih-dbus-tool |
| 712 | changes are enough to warrant it |
| 713 | |
Scott James Remnant | 944a7f3 | 2009-06-17 11:59:57 +0100 | [diff] [blame] | 714 | * nih/tests/test_error.c (test_pop_context): Initialise pid to avoid |
| 715 | gcc issue where it believes the value can be uninitialised |
| 716 | (test_raise_error): Initialise errors and pid. |
| 717 | * nih-dbus/tests/test_dbus_connection.c (test_connect): Initialise |
| 718 | variables allocated inside test constructs. |
| 719 | * nih-dbus/tests/test_dbus_message.c (test_message_error): Initialise |
| 720 | variables |
| 721 | * nih-dbus/tests/test_dbus_proxy.c (test_name_owner_changed): More |
| 722 | initialisation |
| 723 | * nih-dbus-tool/tests/test_main.c (test_mode_option): Have to |
| 724 | initialise ret. |
| 725 | * nih-dbus-tool/tests/test_node.c (test_start_tag): And another |
| 726 | * nih-dbus-tool/tests/test_interface.c (test_start_tag): One more |
| 727 | * nih-dbus-tool/tests/test_method.c (test_start_tag) |
| 728 | (test_end_tag, test_annotation): Bunch more ret initialises. |
| 729 | (test_object_function, test_reply_function, test_proxy_function) |
| 730 | (test_proxy_notify_function): Various other variables |
| 731 | * nih-dbus-tool/tests/test_signal.c (test_start_tag): Another ret |
| 732 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 733 | (test_object_set_function, test_proxy_get_notify_function) |
| 734 | (test_proxy_set_notify_function): More miscellaneous ones |
| 735 | * nih-dbus-tool/tests/test_argument.c (test_start_tag): Another ret |
| 736 | * nih-dbus-tool/tests/test_annotation.c (test_start_tag): Yet another |
| 737 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c: Even more |
| 738 | in this one. |
| 739 | |
Scott James Remnant | 81fe240 | 2009-06-17 11:34:24 +0100 | [diff] [blame] | 740 | * nih-dbus-tool/method.c (method_object_function): Don't translate |
| 741 | the string we return to the caller. |
| 742 | * nih-dbus-tool/property.c (property_object_set_function): Likewise |
| 743 | don't translate. |
| 744 | * nih-dbus-tool/tests/test_method.c (test_object_function): Update |
| 745 | expected output in tests. |
| 746 | * nih-dbus-tool/tests/test_property.c (test_object_set_function): |
| 747 | Likewise |
| 748 | * nih-dbus-tool/tests/test_node.c (test_object_functions): Likewise |
| 749 | * nih-dbus-tool/tests/test_output.c (test_output): Likewise. |
Scott James Remnant | 944a7f3 | 2009-06-17 11:59:57 +0100 | [diff] [blame] | 750 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c: Too many |
| 751 | to count in this source file |
Scott James Remnant | 81fe240 | 2009-06-17 11:34:24 +0100 | [diff] [blame] | 752 | |
Scott James Remnant | f94da72 | 2009-06-17 11:11:42 +0100 | [diff] [blame] | 753 | * nih-dbus-tool/Makefile.am (test_com_netsplit_Nih_Test_object_SOURCES) |
| 754 | (test_com_netsplit_Nih_Test_proxy_SOURCES): Finally decided that we're |
| 755 | not going to ship these built sources, we'd just regenerate them every |
| 756 | build anyway because nih-dbus-tool will have changed. Make them |
| 757 | nodist. |
| 758 | (AM_CPPFLAGS): Which means we also need to include files from the |
| 759 | build directory, as well as the source directory |
| 760 | (BUILT_SOURCES): Change explanation of why it's in built sources |
| 761 | (CLEANFILES): Clean after build. |
| 762 | |
Scott James Remnant | e49db67 | 2009-06-17 10:41:30 +0100 | [diff] [blame] | 763 | * nih/tests/test_error.c (test_raise_error, test_pop_context): Unlink |
| 764 | the core file after the assert tests. |
| 765 | |
Scott James Remnant | cd10f1f | 2009-06-17 10:33:47 +0100 | [diff] [blame] | 766 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c, |
| 767 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c, |
| 768 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c: #include |
| 769 | quoted paths will only look in the source directory or current |
| 770 | working directory, for out of tree builds the current working |
| 771 | directory won't contain the header so we need to prefix with tests/ |
| 772 | so we can lookup from the source directory |
| 773 | * nih-dbus-tool/tests/marshal_factory.c, |
| 774 | * nih-dbus-tool/tests/demarshal_factory.c, |
| 775 | * nih-dbus-tool/tests/method_factory.c, |
| 776 | * nih-dbus-tool/tests/signal_factory.c, |
| 777 | * nih-dbus-tool/tests/property_factory.c: Update generated code to |
| 778 | prefix includes with tests/ |
| 779 | |
Scott James Remnant | e41f91d | 2009-06-17 10:07:06 +0100 | [diff] [blame] | 780 | * nih/tests/test_error.c (test_raise_error, test_pop_context): |
| 781 | Make sure we don't expect the filename to be always relative, |
| 782 | e.g. out-of-tree builds. |
| 783 | |
Scott James Remnant | 4951aa9 | 2009-06-16 10:38:38 +0100 | [diff] [blame] | 784 | 2009-06-16 Scott James Remnant <scott@netsplit.com> |
| 785 | |
Scott James Remnant | dd1455c | 2009-06-17 00:04:49 +0100 | [diff] [blame] | 786 | * nih-dbus-tool/marshal.c (marshal_array, marshal_struct): In the |
| 787 | array of structures situation, we can't just close the container |
| 788 | because it's not been completed - instead we use the new abandon |
| 789 | function to free the resources while hosing the message. |
| 790 | * nih-dbus-tool/property.c (property_object_get_function) |
| 791 | (property_proxy_set_function, property_proxy_set_sync_function): |
| 792 | Likewise abandon the variant container, strictly speaking probably |
| 793 | not required but worthwhile for consistenc |
| 794 | * nih-dbus-tool/tests/test_marshal.c (test_marshal): Update the |
| 795 | output checks to match |
| 796 | * nih-dbus-tool/tests/test_method.c (test_object_function) |
| 797 | (test_proxy_function, test_proxy_sync_function): More output updates |
| 798 | * nih-dbus-tool/tests/test_signal.c (test_object_function): Update |
| 799 | the output check |
| 800 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 801 | (test_proxy_set_function, test_proxy_set_sync_function): Yet more |
| 802 | * nih-dbus-tool/tests/test_node.c (test_object_functions) |
| 803 | (test_proxy_functions): More output updates. |
| 804 | * nih-dbus-tool/tests/test_output.c (test_output): Also update the |
| 805 | top-level output |
| 806 | |
Scott James Remnant | 6a22ed9 | 2009-06-16 22:45:18 +0100 | [diff] [blame] | 807 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c: Update the |
| 808 | property functions to raise the no memory error where appropriate, |
| 809 | also include code to return D-Bus and generic errors for testing. |
| 810 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c (test_get_byte) |
| 811 | (test_get_boolean, test_get_int16, test_get_uint16) |
| 812 | (test_get_int32, test_get_uint32, test_get_int64) |
| 813 | (test_get_uint64, test_get_string, test_get_object_path) |
| 814 | (test_get_signature, test_get_int32_array, test_get_str_array) |
| 815 | (test_get_int32_array_array): Add tests for the get function returning |
| 816 | an D-Bus error and a generic error. |
| 817 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c (test_get_byte) |
| 818 | (test_get_boolean, test_get_int16, test_get_uint16, test_get_int32) |
| 819 | (test_get_uint32, test_get_int64, test_get_uint64, test_get_double) |
| 820 | (test_get_string, test_get_object_path, test_get_signature) |
| 821 | (test_get_int32_array, test_get_int32_array_array): Add D-Bus error |
| 822 | and generic error test cases to the async functions, making sure that |
| 823 | the error handler is raised. |
| 824 | (test_get_byte_sync, test_get_boolean_sync, test_get_int16_sync) |
| 825 | (test_get_uint16_sync, test_get_int32_sync) |
| 826 | (test_get_uint32_sync, test_get_int64_sync) |
| 827 | (test_get_uint64_sync, test_get_double_sync, test_get_string_sync) |
| 828 | (test_get_object_path_sync, test_get_signature_sync) |
| 829 | (test_get_int32_array_sync, test_get_str_array_sync) |
| 830 | (test_get_int32_array_array_sync): Also add D-Bus and generic error |
| 831 | test cases to the sync functions, which are slightly harder to test |
| 832 | because of the need for a separate server process; still, this tests |
| 833 | the error return code. |
| 834 | |
Scott James Remnant | b8d2f71 | 2009-06-16 17:41:34 +0100 | [diff] [blame] | 835 | * nih-dbus-tool/tests/test_node.c (test_object_functions): Update the |
| 836 | output tests to expect the error raises. |
| 837 | * nih-dbus-tool/tests/test_output.c (test_output): Update the output |
| 838 | tests to match as well. |
| 839 | |
Scott James Remnant | aba77f8 | 2009-06-16 17:26:02 +0100 | [diff] [blame] | 840 | * nih-dbus-tool/property.c (property_object_get_function): Raise the |
| 841 | no memory error when we return. |
| 842 | * nih-dbus-tool/tests/test_property.c (test_object_get_function): Make |
| 843 | sure that the output matches, and test the generated function with |
| 844 | normal output, out of memory, dbus error and generic error returns. |
| 845 | |
Scott James Remnant | 98485a7 | 2009-06-16 17:08:34 +0100 | [diff] [blame] | 846 | * nih-dbus/dbus_object.c (nih_dbus_object_property_get): It makes |
| 847 | sense to be able to return an error when getting a property, at the |
| 848 | very least it might be a PolicyKit authorisation error. |
| 849 | (nih_dbus_object_property_get_all): If we get an error while getting |
| 850 | any property, we have to return that error to the user, such is the |
| 851 | manner in which D-Bus messages have to be built. |
| 852 | * nih-dbus/tests/test_dbus_object.c (test_object_property_get): |
| 853 | Update function to test for property getter functions returning |
| 854 | errors. |
| 855 | (test_object_property_get_all): Include a couple of test cases |
| 856 | here too. |
| 857 | |
Scott James Remnant | fc03f1f | 2009-06-16 14:18:58 +0100 | [diff] [blame] | 858 | * TODO (dbus): Update on no_reply, still not completely clear what |
| 859 | we should do with this annotation as the results are surprising |
| 860 | |
Scott James Remnant | 5cdbeb5 | 2009-06-16 13:32:47 +0100 | [diff] [blame] | 861 | * nih-dbus-tool/method.c (method_end_tag): Ignore the NoReply |
| 862 | annotation if the method has output arguments; ignore the Async |
| 863 | annotation if the method is NoReply. |
| 864 | * nih-dbus-tool/tests/test_method.c (test_end_tag): Make sure the |
| 865 | annotations are amended and warnings emitted as appropriate. |
| 866 | |
Scott James Remnant | ad1606d | 2009-06-16 13:14:38 +0100 | [diff] [blame] | 867 | * nih-dbus-tool/node.c (node_object_functions): Don't generate reply |
| 868 | functions for non-async method implementations |
| 869 | * nih-dbus-tool/tests/test_node.c (test_object_functions): Make the |
| 870 | peek method async so that's the only one that should have a reply |
| 871 | function. Also add an output value to another method to check |
| 872 | ordinary return values. |
| 873 | * nih-dbus-tool/tests/test_output.c (test_output): Apply the same |
| 874 | changes to this test as well. |
| 875 | |
Scott James Remnant | 1355b77 | 2009-06-16 10:48:01 +0100 | [diff] [blame] | 876 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c: Turns out |
| 877 | I was using the wrong timeout value everywhere, this is why macros are |
| 878 | useful -- replace the wrong "0" with NIH_DBUS_TIMEOUT_DEFAULT |
| 879 | |
Scott James Remnant | f85e27f | 2009-06-16 10:42:35 +0100 | [diff] [blame] | 880 | * nih-dbus/dbus_proxy.h (NIH_DBUS_TIMEOUT_DEFAULT) |
| 881 | (NIH_DBUS_TIMEOUT_NEVER): Add macros so we don't have to remember |
| 882 | what the timeout magic numbers are |
| 883 | |
Scott James Remnant | 4951aa9 | 2009-06-16 10:38:38 +0100 | [diff] [blame] | 884 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c: Use |
| 885 | TEST_FUNCTION with proper function names instead of TEST_GROUP |
| 886 | |
Scott James Remnant | 33675f3 | 2009-06-15 17:32:38 +0100 | [diff] [blame] | 887 | 2009-06-15 Scott James Remnant <scott@netsplit.com> |
| 888 | |
Scott James Remnant | ae1fe32 | 2009-06-15 21:23:19 +0100 | [diff] [blame] | 889 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.h, |
| 890 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c, |
| 891 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_object.c, |
| 892 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c: Completely |
| 893 | rewrite these tests using TEST_DBUS, making sure we test as much of the |
| 894 | newly generated code as possible. |
| 895 | |
Scott James Remnant | 77ac80b | 2009-06-15 21:22:08 +0100 | [diff] [blame] | 896 | * nih-dbus-tool/tests/com.netsplit.Nih.Test.xml: Various slight |
| 897 | updates to better test the newer code; add arrays of arrays to the |
| 898 | tests; rename "data" to "value" to avoid clash with data argument; |
| 899 | remove the glue we won't use it anymore. |
| 900 | |
Scott James Remnant | dcaff11 | 2009-06-15 21:20:52 +0100 | [diff] [blame] | 901 | * nih-dbus-tool/Makefile.am ($(com_netsplit_Nih_Test_proxy_OUTPUTS)): |
| 902 | Use "proxy" as the prefix again, "your" just looks silly. |
| 903 | |
Scott James Remnant | 231ec01 | 2009-06-15 19:00:19 +0100 | [diff] [blame] | 904 | * nih-dbus-tool/type.c (type_strcat_assert): And now the other |
| 905 | corner case we found, size arrays can be NULL if the first element |
| 906 | of the array is NULL. |
| 907 | * nih-dbus-tool/tests/test_type.c (test_strcat_assert): Add tests |
| 908 | * nih-dbus-tool/method.c (method_reply_function) |
| 909 | (method_proxy_function, method_proxy_sync_function), |
| 910 | * nih-dbus-tool/signal.c (signal_object_function), |
| 911 | * nih-dbus-tool/property.c (property_proxy_set_function) |
| 912 | (property_proxy_set_sync_function): Think-o, we can't look at the |
| 913 | previous iterated we have to look at the last function argument |
| 914 | |
Scott James Remnant | b51c3d6 | 2009-06-15 18:48:28 +0100 | [diff] [blame] | 915 | * nih-dbus-tool/type.c (type_strcat_assert): We're starting to get |
| 916 | a lot of corner cases in that simple assert block, separate it out |
| 917 | so we don't have to repeatedly get it wrong. |
| 918 | * nih-dbus-tool/type.h: Add prototype |
| 919 | * nih-dbus-tool/tests/test_type.c (test_strcat_assert): The all |
| 920 | important tests. |
| 921 | * nih-dbus-tool/method.c (method_reply_function) |
| 922 | (method_proxy_function, method_proxy_sync_function): Use the new |
| 923 | function. |
| 924 | * nih-dbus-tool/signal.c (signal_object_function): Likewise. |
| 925 | * nih-dbus-tool/property.c (property_proxy_set_function) |
| 926 | (property_proxy_set_sync_function): Likewise. |
| 927 | |
Scott James Remnant | 33675f3 | 2009-06-15 17:32:38 +0100 | [diff] [blame] | 928 | * nih-dbus-tool/method.c (method_reply_function) |
| 929 | (method_proxy_function, method_proxy_sync_function): Input array |
| 930 | arguments of basic types (those with a size_t argument following) |
| 931 | may be NULL if that size_t argument is zero. Check for this when |
| 932 | adding asserts. |
| 933 | * nih-dbus-tool/tests/test_method.c (test_reply_function) |
| 934 | (test_proxy_function, test_proxy_sync_function): Add test cases for |
| 935 | an array input argument to make sure we generate the right assert |
| 936 | * nih-dbus-tool/signal.c (signal_object_function): Needs exactly |
| 937 | the same patch |
| 938 | * nih-dbus-tool/tests/test_signal.c (test_object_function): Add |
| 939 | the test case for this one too. |
| 940 | * nih-dbus-tool/property.c (property_proxy_set_function) |
| 941 | (property_proxy_set_sync_function): We also need the same patch |
| 942 | for this one too. |
| 943 | * nih-dbus-tool/tests/test_property.c (test_proxy_set_function) |
| 944 | (test_proxy_set_sync_function): And test as well |
| 945 | |
Scott James Remnant | fcf9eb9 | 2009-06-14 12:50:25 +0100 | [diff] [blame] | 946 | 2009-06-14 Scott James Remnant <scott@netsplit.com> |
| 947 | |
| 948 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_connect): Total thinko with |
| 949 | the API; I'd expected the signal structures to be public, but we |
| 950 | don't generally want that. Better just to take a signal name. |
| 951 | * nih-dbus/dbus_proxy.h: Update prototype. |
| 952 | * nih-dbus/tests/test_dbus_proxy.c (test_connect): Update tests |
| 953 | (test_signal_destroy): Also update this one |
| 954 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Also update |
| 955 | |
Scott James Remnant | 9f706dd | 2009-06-13 17:18:03 +0100 | [diff] [blame] | 956 | 2009-06-13 Scott James Remnant <scott@netsplit.com> |
| 957 | |
| 958 | * nih-dbus-tool/output.c (output): Need dbus_pending_data.h in the |
| 959 | header too for the error handler typedef. |
| 960 | * nih-dbus-tool/tests/test_output.c (test_output): Add to tests |
| 961 | |
Scott James Remnant | 78a5bac | 2009-06-11 11:48:09 +0100 | [diff] [blame] | 962 | 2009-06-11 Scott James Remnant <scott@netsplit.com> |
| 963 | |
Scott James Remnant | 3e377ec | 2009-06-11 12:00:32 +0100 | [diff] [blame] | 964 | * nih-dbus-tool/tests/test_output.c (test_output): We want an extra |
| 965 | line between extern variables and functions, but only when there are |
| 966 | both. |
| 967 | * nih-dbus-tool/output.c (output): Adjust the code to make that so |
| 968 | |
Scott James Remnant | 8fd39c7 | 2009-06-11 11:52:46 +0100 | [diff] [blame] | 969 | * nih/child.h, |
| 970 | * nih/io.h, |
| 971 | * nih/logging.h, |
| 972 | * nih/main.h, |
| 973 | * nih/signal.h: Make sure we prefix variables with "extern" |
| 974 | |
Scott James Remnant | 78a5bac | 2009-06-11 11:48:09 +0100 | [diff] [blame] | 975 | * nih-dbus-tool/node.c (node_interfaces_array): Make the structure |
| 976 | prototypes that we export "extern", since they go in the header |
| 977 | file. |
| 978 | * nih-dbus-tool/tests/test_node.c (test_interfaces_array): Make sure |
| 979 | that the returned variable types all include "extern" in the lists, |
| 980 | but not in the output. |
| 981 | * nih-dbus-tool/tests/test_output.c (test_output): Update the output |
| 982 | checks of the headers to expect extern in front of variables. |
| 983 | |
Scott James Remnant | 20faf46 | 2009-06-10 12:08:43 +0100 | [diff] [blame] | 984 | 2009-06-10 Scott James Remnant <scott@netsplit.com> |
| 985 | |
Scott James Remnant | fd54d86 | 2009-06-10 22:16:04 +0100 | [diff] [blame] | 986 | * nih-dbus-tool/signal.c (signal_proxy_function): Eliminate the |
| 987 | proxy passthrough and use proxied members directly. |
| 988 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Update |
| 989 | expected output of tests to match. |
| 990 | * nih-dbus-tool/tests/test_node.c (test_proxy_functions): Update |
| 991 | expected output. |
| 992 | * nih-dbus-tool/tests/test_output.c (test_output): Update as well |
| 993 | |
Scott James Remnant | 57a23c8 | 2009-06-10 22:08:14 +0100 | [diff] [blame] | 994 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Pass |
| 995 | the extra arguments to nih_dbus_proxy_connect(), which means we |
| 996 | actually move the data pointer to the connect call now. |
| 997 | |
Scott James Remnant | cffc688 | 2009-06-10 22:01:56 +0100 | [diff] [blame] | 998 | * nih-dbus/dbus_proxy.h (NihDBusProxySignal): Rather than reference |
| 999 | the proxy itself, copy the members that we want out of it. |
| 1000 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_connect): Accept a parent |
| 1001 | argument, as well as a separate data argument, copy the members |
| 1002 | from proxy into the object, taking a reference to the connection |
| 1003 | as we do so. |
| 1004 | (nih_dbus_proxy_signal_destroy): Don't forget to unref the connection |
| 1005 | (nih_dbus_proxy_signal_rule): Take members directly |
| 1006 | * nih-dbus/tests/test_dbus_proxy.c (test_connect): Call the function |
| 1007 | with the two new arguments, update tests to check for the new members |
| 1008 | (test_signal_destroy): Call with the two new arguments. |
| 1009 | |
Scott James Remnant | 66e467b | 2009-06-10 21:38:03 +0100 | [diff] [blame] | 1010 | * nih-dbus-tool/property.c (property_proxy_set_sync_function): Add |
| 1011 | a parent argument to the methods, even though we never use it; |
| 1012 | otherwise it's irritatingly inconsistent with methods and property |
| 1013 | get functions. |
| 1014 | * nih-dbus-tool/tests/property_code.h: Adjust the expected prototype |
| 1015 | * nih-dbus-tool/tests/test_property.c (test_proxy_set_sync_function): |
| 1016 | Adjust expected output to include the parent argument |
| 1017 | * nih-dbus-tool/tests/test_node.c (test_proxy_functions): Update |
| 1018 | expected output to match |
| 1019 | * nih-dbus-tool/tests/test_output.c (test_output): Update as well |
| 1020 | |
Scott James Remnant | e8ab033 | 2009-06-10 21:26:01 +0100 | [diff] [blame] | 1021 | * nih-dbus/dbus_proxy.h (NihDBusSignalhandler): Remove the proxy |
| 1022 | argument. |
| 1023 | * nih-dbus/tests/test_dbus_proxy.c (my_signal_handler): Remove the |
| 1024 | argument from here too |
| 1025 | |
Scott James Remnant | b0905ca | 2009-06-10 21:24:22 +0100 | [diff] [blame] | 1026 | * nih-dbus-tool/signal.c (signal_proxy_function): Don't pass the |
| 1027 | proxy to the signal handler function; we don't pass it for method |
| 1028 | or property reply handlers because we don't have it, it's inconsitent |
| 1029 | to pass it here as well - we can always make a new proxy for the origin |
| 1030 | after all. |
| 1031 | * nih-dbus-tool/tests/signal_code.h: Update typedef |
| 1032 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Update |
| 1033 | the tests |
| 1034 | * nih-dbus-tool/tests/test_node.c (test_proxy_functions): Update |
| 1035 | expected output |
| 1036 | * nih-dbus-tool/tests/test_output.c (test_output): Update expected |
| 1037 | output. |
| 1038 | |
Scott James Remnant | 50ac1f8 | 2009-06-10 20:45:08 +0100 | [diff] [blame] | 1039 | * nih-dbus-tool/method.c (method_proxy_notify_function): Symbol |
| 1040 | name for a notify function should be implementation, it's static |
| 1041 | (method_proxy_function): Call with the implementation name |
| 1042 | * nih-dbus-tool/tests/method_code.h: Update name of notify function |
| 1043 | we expect to be generated |
| 1044 | * nih-dbus-tool/tests/method_factory.c: Updadate the name of the |
| 1045 | notify function we'll supply in the test |
| 1046 | * nih-dbus-tool/tests/test_method.c (test_proxy_notify_function): |
| 1047 | Rename notify function in output and when we call it |
| 1048 | (test_proxy_function): Rename notify function in output |
| 1049 | * nih-dbus-tool/tests/test_node.c (test_proxy_functions): Update |
| 1050 | expected output |
| 1051 | * nih-dbus-tool/tests/test_output.c (test_output): Update expected |
| 1052 | output |
| 1053 | |
Scott James Remnant | 8946955 | 2009-06-10 19:20:10 +0100 | [diff] [blame] | 1054 | * NEWS: Update |
| 1055 | * TODO: Update |
| 1056 | |
Scott James Remnant | 6ec0006 | 2009-06-10 18:56:57 +0100 | [diff] [blame] | 1057 | * nih-dbus-tool/tests/com.netsplit.Nih.Test.xml: Update to newer |
| 1058 | XML format, using annotations instead of namespaces. Add a couple |
| 1059 | of extra tests cases, and in particular add properties. |
| 1060 | * nih-dbus-tool/Makefile.am ($(com_netsplit_Nih_Test_object_OUTPUTS)): |
| 1061 | ($(com_netsplit_Nih_Test_proxy_OUTPUTS)): Use the C version of the |
| 1062 | nih-dbus-tool to generate the output; currently not compatible with |
| 1063 | the tests, but should generate good code. Be sure to make the |
| 1064 | output directory first (out of tree builds) |
| 1065 | (nodist_test_marshal_SOURCES, nodist_test_demarshal_SOURCES) |
| 1066 | (nodist_test_method_SOURCES, nodist_test_signal_SOURCES) |
| 1067 | (nodist_test_property_SOURCES): We don't want to distribute the |
| 1068 | *_code.c files so move them into a nodist prefixed |
| 1069 | (MAINTAINERCLEANFILES): BUILT_SOURCES are always maintainer-clean, |
| 1070 | so drop this |
| 1071 | (EXTRA_DIST): Sources are always distributed, so drop the outputs |
| 1072 | from this leaving only the XML |
| 1073 | (tests/marshal_code.c, tests/demarshal_code.c) |
| 1074 | (tests/method_code.c, tests/signal_code.c) |
| 1075 | (tests/property_code.c): Drop the temporary output, no need for it |
| 1076 | (CLEANFILES): Specify by expanding the nodist_*_SOURCES variables |
| 1077 | |
Scott James Remnant | f4fe21d | 2009-06-10 17:27:39 +0100 | [diff] [blame] | 1078 | * nih-dbus-tool/nih_dbus_tool.py: Drop the python version |
| 1079 | |
Scott James Remnant | 9cf5dbb | 2009-06-10 17:24:27 +0100 | [diff] [blame] | 1080 | * TODO: Update. |
| 1081 | |
Scott James Remnant | 2933a69 | 2009-06-10 17:16:11 +0100 | [diff] [blame] | 1082 | * nih-dbus-tool/main.c: Actually output the source and header files |
| 1083 | |
Scott James Remnant | 7a2c91e | 2009-06-10 17:15:29 +0100 | [diff] [blame] | 1084 | * nih-dbus-tool/main.c: Generate the source and header paths earlier, |
| 1085 | using an nih_local string so we don't have to free. Make sure we |
| 1086 | close the input file descriptor. Don't put meaningless content into |
| 1087 | the errors we output. |
| 1088 | |
Scott James Remnant | dff41ba | 2009-06-10 17:10:33 +0100 | [diff] [blame] | 1089 | * nih-dbus-tool/main.c (mode_option): Rather than set a random enum, |
| 1090 | just use TRUE/FALSE as the output and node methods do. |
| 1091 | * nih-dbus-tool/tests/test_main.c (test_mode_option): Update. |
| 1092 | |
Scott James Remnant | 0538136 | 2009-06-10 17:05:21 +0100 | [diff] [blame] | 1093 | * nih-dbus-tool/man/nih-dbus-tool.1: Make a start on a man page for |
| 1094 | the tool. |
| 1095 | |
Scott James Remnant | f0fa725 | 2009-06-10 17:05:10 +0100 | [diff] [blame] | 1096 | * nih-dbus-tool/output.c (output): Primary function to output C |
| 1097 | source and header files for a node in either object or proxy mode. |
| 1098 | (output_preamble): Support function to generate the preamble comment |
| 1099 | (output_sentinel): Support function to generate the header sentinel |
| 1100 | (output_write): Support file to write out to the file descriptor |
| 1101 | * nih-dbus-tool/output.h: Headers |
| 1102 | * nih-dbus-tool/tests/test_output.c: Tests for the code |
| 1103 | * nih-dbus-tool/Makefile.am (nih_dbus_tool_SOURCES): Compile and link |
| 1104 | the new source file |
| 1105 | (TESTS): Run the new tests |
| 1106 | (test_output_SOURCES, test_output_LDFLAGS, test_output_LDADD): Details |
| 1107 | for the new tests |
| 1108 | |
Scott James Remnant | 2d98dae | 2009-06-10 12:14:50 +0100 | [diff] [blame] | 1109 | * nih-dbus-tool/type.c (type_func_to_typedef, type_func_layout): |
| 1110 | Use type_var_to_string instead of doing things by hand. |
| 1111 | |
Scott James Remnant | 873898f | 2009-06-10 12:12:13 +0100 | [diff] [blame] | 1112 | * nih-dbus-tool/tests/test_type.c (test_func_layout): Noticed that |
| 1113 | I have no test cases for no arguments or returning void, extend the |
| 1114 | existing cases. |
| 1115 | * nih-dbus-tool/type.c (type_func_layout): Glad I did that - I didn't |
| 1116 | cope with no arguments. |
| 1117 | |
Scott James Remnant | 20faf46 | 2009-06-10 12:08:43 +0100 | [diff] [blame] | 1118 | * nih-dbus-tool/type.c (type_func_to_typedef): We need to be able to |
| 1119 | lay typedefs out individually, thus add this function. |
| 1120 | * nih-dbus-tool/type.h: Add prototype |
| 1121 | * nih-dbus-tool/tests/test_type.c (test_func_to_typedef): Add tests |
| 1122 | |
Scott James Remnant | 24f0dc8 | 2009-06-09 22:46:51 +0100 | [diff] [blame] | 1123 | 2009-06-09 Scott James Remnant <scott@netsplit.com> |
| 1124 | |
| 1125 | * nih-dbus-tool/node.c (node_object_functions) |
| 1126 | (node_proxy_functions): Implement functions that call all the |
| 1127 | necessary other functions to return C code for a node's object or |
| 1128 | proxy implementations. |
| 1129 | * nih-dbus-tool/node.h: Add prototypes. |
| 1130 | * nih-dbus-tool/tests/test_node.c (test_object_functions) |
| 1131 | (test_proxy_functions): Test cases for the functions. |
| 1132 | |
Scott James Remnant | a90f7ed | 2009-06-04 13:19:27 +0100 | [diff] [blame] | 1133 | 2009-06-04 Scott James Remnant <scott@netsplit.com> |
| 1134 | |
Scott James Remnant | fe3cf79 | 2009-06-04 18:47:03 +0100 | [diff] [blame] | 1135 | * nih-dbus-tool/main.c: Change the default output mode to proxy, |
| 1136 | which makes a bit more sense for the majority case. |
| 1137 | |
Scott James Remnant | de8bfa1 | 2009-06-04 17:51:42 +0100 | [diff] [blame] | 1138 | * nih-dbus-tool/signal.c (signal_proxy_function): Name the signal |
| 1139 | functions _signal to match _method |
| 1140 | * nih-dbus-tool/tests/signal_code.h: Update to match |
| 1141 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Update |
| 1142 | |
Scott James Remnant | 9b0dab5 | 2009-06-04 17:50:42 +0100 | [diff] [blame] | 1143 | * nih-dbus-tool/node.c (node_interfaces_array): The last member |
| 1144 | should be just NULL, it's an array of pointers. |
| 1145 | * nih-dbus-tool/tests/test_node.c (test_interfaces_array): Adjust |
| 1146 | test case output to match. |
| 1147 | |
Scott James Remnant | 0168e25 | 2009-06-04 16:22:01 +0100 | [diff] [blame] | 1148 | * nih-dbus/dbus_object.c (nih_dbus_object_introspect): Cope with |
| 1149 | name-less arguments. |
| 1150 | * nih-dbus/tests/test_dbus_object.c (test_object_introspect): Update |
| 1151 | input and expected return string. |
| 1152 | |
Scott James Remnant | 6bf2777 | 2009-06-04 16:17:53 +0100 | [diff] [blame] | 1153 | * nih-dbus-tool/interface.c (interface_end_tag): If the symbol is |
| 1154 | given as "", set it to NULL. |
| 1155 | * nih-dbus-tool/tests/test_interface.c (test_end_tag): Add a test |
| 1156 | case for the empty symbol. |
| 1157 | |
Scott James Remnant | 35afaea | 2009-06-04 15:18:45 +0100 | [diff] [blame] | 1158 | * nih-dbus-tool/node.c (node_interfaces_array): Generate the array |
| 1159 | of interfaces for a given node. |
| 1160 | * nih-dbus-tool/node.h: Add prototype. |
| 1161 | * nih-dbus-tool/tests/test_node.c (test_interfaces_array): Add tests |
| 1162 | for the new function |
| 1163 | |
Scott James Remnant | f8a172e | 2009-06-04 14:21:03 +0100 | [diff] [blame] | 1164 | * nih-dbus-tool/interface.c (interface_methods_array) |
Scott James Remnant | de70ec9 | 2009-06-04 14:46:11 +0100 | [diff] [blame] | 1165 | (interface_signals_array, interface_properties_array): Return the |
| 1166 | prototype with the name set, and thus don't return a static argument |
| 1167 | array. |
| 1168 | (interface_struct): Rewrite to reuse the name and insert the static |
| 1169 | * nih-dbus-tool/interface.h: Update prototypes |
| 1170 | * nih-dbus-tool/tests/test_interface.c (test_methods_array) |
| 1171 | (test_signals_array, test_properties_array): Adjust to match |
| 1172 | |
| 1173 | * nih-dbus-tool/interface.c (interface_methods_array) |
Scott James Remnant | f8a172e | 2009-06-04 14:21:03 +0100 | [diff] [blame] | 1174 | (interface_signals_array): Restructure to expect prototypes to be |
| 1175 | returned from the args array functions, using that to get the name |
| 1176 | of those and generally making things a bit more readable. Make |
| 1177 | static along the way too. |
| 1178 | |
Scott James Remnant | 886461f | 2009-06-04 14:19:56 +0100 | [diff] [blame] | 1179 | * nih-dbus-tool/tests/test_interface.c (test_struct): Make sure the |
| 1180 | returned items aren't arrays. |
| 1181 | |
Scott James Remnant | 48358d2 | 2009-06-04 13:42:25 +0100 | [diff] [blame] | 1182 | * nih-dbus-tool/signal.c (signal_args_array): Return the prototype |
| 1183 | with the name set, and thus don't return a static argument array. |
| 1184 | * nih-dbus-tool/signal.h: Update prototype |
| 1185 | * nih-dbus-tool/tests/test_signal.c (test_args_array): Adjust to match |
| 1186 | |
Scott James Remnant | e4a61d7 | 2009-06-04 13:38:23 +0100 | [diff] [blame] | 1187 | * nih-dbus-tool/method.c (method_args_array): Return the prototype |
| 1188 | with the name set, and thus don't return a static argument array. |
| 1189 | * nih-dbus-tool/method.h: Update prototype |
| 1190 | * nih-dbus-tool/tests/test_method.c (test_args_array): Adjust to match |
| 1191 | |
Scott James Remnant | 5dcac19 | 2009-06-04 13:32:44 +0100 | [diff] [blame] | 1192 | * nih-dbus-tool/type.h (type_var): Add an array member. |
| 1193 | * nih-dbus-tool/type.c (type_var_new): Initialise array to FALSE. |
| 1194 | (type_var_to_string, type_var_layout): Append [] if the var is an |
| 1195 | array |
| 1196 | * nih-dbus-tool/tests/test_type.c (test_var_new): Check array is FALSE |
| 1197 | (test_var_to_string, test_var_layout): Add checks for array |
| 1198 | |
Scott James Remnant | a90f7ed | 2009-06-04 13:19:27 +0100 | [diff] [blame] | 1199 | * nih-dbus-tool/interface.c (interface_struct): Generate a structure |
| 1200 | variable for an interface, along with the members code. |
| 1201 | * nih-dbus-tool/interface.h: Add prototype |
| 1202 | * nih-dbus-tool/tests/test_interface.c (test_struct): Tests. |
| 1203 | |
Scott James Remnant | 699fa73 | 2009-06-03 12:59:36 +0100 | [diff] [blame] | 1204 | 2009-06-03 Scott James Remnant <scott@netsplit.com> |
| 1205 | |
Scott James Remnant | b96d188 | 2009-06-03 16:34:13 +0100 | [diff] [blame] | 1206 | * nih-dbus-tool/method.c (method_args_array): Add missing NihDBusArg |
| 1207 | * nih-dbus-tool/tests/test_method.c (test_args_array): Update |
| 1208 | expected test output |
| 1209 | * nih-dbus-tool/signal.c (signal_args_array): Add missing NihDBusArg |
| 1210 | * nih-dbus-tool/tests/test_signal.c (test_args_array): Update |
| 1211 | expected test output |
| 1212 | * nih-dbus-tool/interface.c (interface_methods_array) |
| 1213 | (interface_signals_array, interface_properties_array): Add missing |
| 1214 | NihDBusMethod, NihDBusSignal and NihDBusProperty type names. |
| 1215 | * nih-dbus-tool/tests/test_interface.c (test_methods_array) |
| 1216 | (test_signals_array, test_properties_array): Update expected |
| 1217 | test output |
| 1218 | |
Scott James Remnant | 71f7104 | 2009-06-03 15:20:18 +0100 | [diff] [blame] | 1219 | * nih-dbus-tool/interface.c (interface_properties_array): Generate |
| 1220 | the array of properties for an interface |
| 1221 | * nih-dbus-tool/interface.h: Add prototype |
| 1222 | * nih-dbus-tool/tests/test_interface.c (test_properties_array): Tests |
| 1223 | |
Scott James Remnant | 6ab1fc1 | 2009-06-03 13:44:28 +0100 | [diff] [blame] | 1224 | * nih-dbus-tool/method.c (method_args_array): Use method_args instead |
| 1225 | of args to distinguish from signals. |
| 1226 | * nih-dbus-tool/tests/test_method.c (test_args_array): Update. |
| 1227 | * nih-dbus-tool/signal.c (signal_args_array): Use signal_args instead |
| 1228 | of args to distinguish from methods. |
| 1229 | * nih-dbus-tool/tests/test_signal.c (test_args_array): Update. |
| 1230 | * nih-dbus-tool/interface.c (interface_methods_array) |
| 1231 | (interface_signals_array): Update to match |
| 1232 | * nih-dbus-tool/tests/test_interface.c (test_methods_array) |
| 1233 | (test_signals_array): Also update. |
| 1234 | |
Scott James Remnant | 8890d32 | 2009-06-03 13:40:45 +0100 | [diff] [blame] | 1235 | * nih-dbus-tool/interface.c (interface_signals_array): Generate the |
| 1236 | array of signals for an interface, including the arguments. |
| 1237 | * nih-dbus-tool/interface.h: Add prototype |
| 1238 | * nih-dbus-tool/tests/test_interface.c (test_signals_array): Tests. |
| 1239 | |
Scott James Remnant | 1916d6e | 2009-06-03 13:34:39 +0100 | [diff] [blame] | 1240 | * nih-dbus-tool/interface.c (interface_methods_array): Generate the |
| 1241 | array of methods for an interface, including the arguments. |
| 1242 | * nih-dbus-tool/interface.h: Add prototype |
| 1243 | * nih-dbus-tool/tests/test_interface.c (test_methods_array): Tests. |
| 1244 | |
Scott James Remnant | e4f4861 | 2009-06-03 13:02:57 +0100 | [diff] [blame] | 1245 | * nih-dbus-tool/signal.c (signal_args_array): Generate the array |
| 1246 | of arguments for a signal. |
| 1247 | * nih-dbus-tool/signal.h: Add prototype. |
| 1248 | * nih-dbus-tool/tests/test_signal.c (test_args_array): Tests. |
| 1249 | |
Scott James Remnant | aa370be | 2009-06-03 12:59:42 +0100 | [diff] [blame] | 1250 | * nih-dbus-tool/method.c (method_args_array): Generate the array |
| 1251 | of arguments for a method. |
| 1252 | * nih-dbus-tool/method.h: Add prototype. |
| 1253 | * nih-dbus-tool/tests/test_method.c (test_args_array): Tests. |
| 1254 | |
Scott James Remnant | 699fa73 | 2009-06-03 12:59:36 +0100 | [diff] [blame] | 1255 | * nih-dbus-tool/symbol.c (symbol_impl): Allow the symbol name and |
| 1256 | postfix to be NULL, as is the case for structure definitions. |
| 1257 | * nih-dbus-tool/tests/test_symbol.c (test_impl): Extend test cases |
| 1258 | to cover new cases. |
| 1259 | |
Scott James Remnant | 8824343 | 2009-06-02 11:29:19 +0100 | [diff] [blame] | 1260 | 2009-06-02 Scott James Remnant <scott@netsplit.com> |
| 1261 | |
Scott James Remnant | 1ac29f5 | 2009-06-02 21:46:22 +0100 | [diff] [blame] | 1262 | * nih-dbus-tool/property.c (property_object_get_function) |
| 1263 | (property_object_set_function, property_proxy_get_function) |
| 1264 | (property_proxy_get_notify_function) |
| 1265 | (property_proxy_set_function) |
| 1266 | (property_proxy_set_notify_function) |
| 1267 | (property_proxy_get_sync_function) |
| 1268 | (property_proxy_set_sync_function): Rather than accepting precanned |
| 1269 | names, accept prefix, interface and property and generate them every |
| 1270 | time. |
| 1271 | * nih-dbus-tool/property.h: Update prototypes. |
| 1272 | * nih-dbus-tool/tests/property_factory.c: Create an interface and |
| 1273 | pass it to the functions. |
| 1274 | * nih-dbus-tool/tests/property_code.h: Prototypes all change |
| 1275 | * nih-dbus-tool/tests/test_property.c: Update tests. |
| 1276 | |
Scott James Remnant | ec98e36 | 2009-06-02 20:42:45 +0100 | [diff] [blame] | 1277 | * nih-dbus-tool/signal.c (signal_object_function) |
| 1278 | (signal_proxy_function): Rather than accepting precanned names, accept |
| 1279 | prefix, interface and signal and generate them every time |
| 1280 | * nih-dbus-tool/signal.h: Update prototypes. |
| 1281 | * nih-dbus-tool/tests/signal_factory.c: Create an interface and |
| 1282 | pass it to the functions |
| 1283 | * nih-dbus-tool/tests/signal_code.h: Filter function name changes |
| 1284 | as a result. |
| 1285 | * nih-dbus-tool/tests/test_signal.c: Update tests. |
| 1286 | |
Scott James Remnant | 6b4de1c | 2009-06-02 20:30:08 +0100 | [diff] [blame] | 1287 | * nih-dbus-tool/method.c (method_object_function) |
| 1288 | (method_reply_function, method_proxy_function) |
| 1289 | (method_proxy_notify_function, method_proxy_sync_function): Rather |
| 1290 | than accepting precanned names, accept prefix, interface and method |
| 1291 | and generate them every time. |
| 1292 | * nih-dbus-tool/method.h: Update prototypes. |
| 1293 | * nih-dbus-tool/tests/method_factory.c: Create an interface and pass |
| 1294 | it to the functions |
| 1295 | * nih-dbus-tool/tests/method_code.h: A couple of names of generated |
| 1296 | functions change as a result (becoming proper) |
| 1297 | * nih-dbus-tool/tests/test_method.c: Update tests |
| 1298 | |
Scott James Remnant | 47e0650 | 2009-06-02 18:13:07 +0100 | [diff] [blame] | 1299 | * nih-dbus-tool/interface.c (interface_lookup_method): Move to method.c |
| 1300 | (interface_lookup_signal): Move to signal.c |
| 1301 | (interface_lookup_property): Move to property.c |
| 1302 | * nih-dbus-tool/interface.h: Also move prototypes |
| 1303 | * nih-dbus-tool/tests/test_interface.c: Also move test cases |
| 1304 | * nih-dbus-tool/method.c (interface_lookup_method): Rename |
| 1305 | to method_lookup |
| 1306 | * nih-dbus-tool/method.h: Update prototype. |
| 1307 | * nih-dbus-tool/tests/test_method.c (test_lookup_method): Rename |
| 1308 | to test_lookup |
| 1309 | * nih-dbus-tool/signal.c (interface_lookup_signal): Rename |
| 1310 | to signal_lookup |
| 1311 | * nih-dbus-tool/signal.h: Update prototype. |
| 1312 | * nih-dbus-tool/tests/test_signal.c (test_lookup_signal): Rename |
| 1313 | to test_lookup |
| 1314 | * nih-dbus-tool/property.c (interface_lookup_property): Rename |
| 1315 | to property_lookup |
| 1316 | * nih-dbus-tool/property.h: Update prototype |
| 1317 | * nih-dbus-tool/tests/test_property.c (test_lookup_property): Rename |
| 1318 | to test_lookup |
| 1319 | |
Scott James Remnant | 8824343 | 2009-06-02 11:29:19 +0100 | [diff] [blame] | 1320 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_name_owner_changed): Add |
| 1321 | missing DBUS_TYPE_INVALID sentinel to the dbus_message_get_args() |
| 1322 | call. |
| 1323 | |
Scott James Remnant | 62129ea | 2009-05-29 12:52:58 +0200 | [diff] [blame] | 1324 | 2009-05-29 Scott James Remnant <scott@netsplit.com> |
| 1325 | |
Scott James Remnant | 5012104 | 2009-05-29 13:00:04 +0200 | [diff] [blame] | 1326 | * nih-dbus-tool/tests/test_node.c (test_lookup_interface): Extend |
| 1327 | test case to look for NULL |
| 1328 | * nih-dbus-tool/node.c (node_lookup_interface): Allow NULL symbol |
| 1329 | lookup, which returns an Interface with a NULL symbol (ie. the |
| 1330 | default). |
| 1331 | |
Scott James Remnant | 62129ea | 2009-05-29 12:52:58 +0200 | [diff] [blame] | 1332 | * nih-dbus-tool/symbol.c (symbol_impl, symbol_extern) |
| 1333 | (symbol_typedef): Name generation functions |
| 1334 | (symbol_strcat_interface, symbol_strcat_title): Utility functions |
| 1335 | used for the above |
| 1336 | * nih-dbus-tool/symbol.h: Add prototypes |
| 1337 | * nih-dbus-tool/tests/test_symbol.c (test_impl, test_extern) |
| 1338 | (test_typedef): Test cases for the new functions |
| 1339 | |
Scott James Remnant | 9e13d51 | 2009-05-27 01:15:41 +0200 | [diff] [blame] | 1340 | 2009-05-27 Scott James Remnant <scott@netsplit.com> |
| 1341 | |
Scott James Remnant | 3180b68 | 2009-05-29 12:46:49 +0200 | [diff] [blame] | 1342 | * nih-dbus-tool/method.c (method_proxy_sync_function): sync function |
| 1343 | returns an integer, so should not be malloc |
| 1344 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): |
| 1345 | Remove from tests as well |
| 1346 | |
Scott James Remnant | 9e13d51 | 2009-05-27 01:15:41 +0200 | [diff] [blame] | 1347 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): |
| 1348 | Do the child process stuff before creating the proxy, otherwise |
| 1349 | it holds a reference to the connection. |
| 1350 | * nih-dbus-tool/tests/test_property.c (test_proxy_get_sync_function) |
| 1351 | (test_proxy_set_sync_function): Likewise. |
| 1352 | |
Scott James Remnant | eda0758 | 2009-05-26 22:11:33 +0200 | [diff] [blame] | 1353 | 2009-05-26 Scott James Remnant <scott@netsplit.com> |
| 1354 | |
Scott James Remnant | 0f0ab2b | 2009-05-26 23:22:53 +0200 | [diff] [blame] | 1355 | * nih-dbus-tool/nih_dbus_tool.py: Rename conn to connection |
| 1356 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c: Update conn |
| 1357 | to connection here too |
| 1358 | |
Scott James Remnant | d75ddb4 | 2009-05-26 23:22:31 +0200 | [diff] [blame] | 1359 | * nih-dbus-tool/tests/test_method.c, |
| 1360 | * nih-dbus-tool/tests/test_signal.c, |
| 1361 | * nih-dbus-tool/tests/test_property.c: Update variable names in |
| 1362 | test cases too |
| 1363 | |
Scott James Remnant | 223f434 | 2009-05-26 23:17:12 +0200 | [diff] [blame] | 1364 | * nih-dbus-tool/method.c, |
| 1365 | * nih-dbus-tool/signal.c, |
| 1366 | * nih-dbus-tool/property.c: Update accessor of message, proxy and |
| 1367 | object functions |
| 1368 | |
Scott James Remnant | 0704a63 | 2009-05-26 23:11:16 +0200 | [diff] [blame] | 1369 | * nih-dbus/tests/test_dbus_message.c, |
| 1370 | * nih-dbus/tests/test_dbus_object.c, |
| 1371 | * nih-dbus/tests/test_dbus_pending_data.c, |
| 1372 | * nih-dbus/tests/test_dbus_proxy.c: Update to match conn/connection |
| 1373 | |
Scott James Remnant | 8fa35ea | 2009-05-26 23:08:23 +0200 | [diff] [blame] | 1374 | * nih-dbus/dbus_proxy.c: rename conn to connection |
| 1375 | * nih-dbus/dbus_proxy.h (NihDBusProxy): rename conn to connection |
| 1376 | |
Scott James Remnant | 37fed62 | 2009-05-26 23:06:13 +0200 | [diff] [blame] | 1377 | * nih-dbus/dbus_object.c: rename conn to connection |
| 1378 | * nih-dbus/dbus_object.h (NihDBusObject): rename conn to connection |
| 1379 | |
Scott James Remnant | 19fde44 | 2009-05-26 23:02:09 +0200 | [diff] [blame] | 1380 | * nih-dbus/dbus_pending_data.c: rename conn to connection |
| 1381 | * nih-dbus/dbus_pending_data.h (NihDBusPendingData): rename conn |
| 1382 | to connection |
| 1383 | |
Scott James Remnant | 9038397 | 2009-05-26 22:59:56 +0200 | [diff] [blame] | 1384 | * nih-dbus/dbus_message.c: rename conn to connection |
| 1385 | * nih-dbus/dbus_message.h (NihDBusMessage): rename conn to connection |
| 1386 | |
Scott James Remnant | 3c05bf4 | 2009-05-26 22:57:07 +0200 | [diff] [blame] | 1387 | * nih-dbus/dbus_interface.h: Rename conn arguments to connection. |
| 1388 | |
Scott James Remnant | c385a70 | 2009-05-26 22:56:14 +0200 | [diff] [blame] | 1389 | * nih-dbus/dbus_connection.c: Rename conn arguments/variables to |
| 1390 | connection, for style-wise stuff |
| 1391 | * nih-dbus/dbus_connection.h: Update prototypes |
| 1392 | |
Scott James Remnant | c99ae23 | 2009-05-26 22:13:32 +0200 | [diff] [blame] | 1393 | * nih-dbus-tool/signal.c (signal_proxy_function): Function to |
| 1394 | generate D-Bus connection filter functions to catch signal |
| 1395 | messages and pass them to a handler |
| 1396 | * nih-dbus-tool/signal.h: Add prototype |
| 1397 | * nih-dbus-tool/tests/signal_factory.c: Call the function to |
| 1398 | generate a filter function for testing |
| 1399 | * nih-dbus-tool/tests/signal_code.h: Expected prototype for |
| 1400 | generated function, and the typedef it casts handler functions to |
| 1401 | * nih-dbus-tool/tests/test_signal.c (test_proxy_function): Test |
| 1402 | cases for the function and the generated function |
| 1403 | |
Scott James Remnant | eda0758 | 2009-05-26 22:11:33 +0200 | [diff] [blame] | 1404 | * nih-dbus/dbus_interface.h (NihDBusSignalFilter): Rename the |
| 1405 | message argument to signal, since we use message for the context |
| 1406 | |
Scott James Remnant | 6d7b512 | 2009-05-25 22:12:51 +0200 | [diff] [blame] | 1407 | 2009-05-25 Scott James Remnant <scott@netsplit.com> |
| 1408 | |
Scott James Remnant | 2f161e3 | 2009-05-25 22:18:21 +0200 | [diff] [blame] | 1409 | * nih-dbus/dbus_interface.h (NihDBusSignal): Add filter function |
| 1410 | member, which is a D-Bus connection filter that will call a proxied |
| 1411 | handler function. |
| 1412 | (NihDBusProxySignal): add advanced typedef |
| 1413 | (NihDBusSignalFilter): typedef for signal filter function |
| 1414 | |
| 1415 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_connect): Function to |
| 1416 | connect a signal handler to a proxy using the filter function |
| 1417 | defined in the NihDBusSignal structure. |
| 1418 | (nih_dbus_proxy_signal_destroy): Destructor for a proxied signal |
| 1419 | that removes the match on the bus daemon and the filter |
| 1420 | (nih_dbus_proxy_signal_rule): Function to generate signal rule |
| 1421 | * nih-dbus/dbus_proxy.h (NihDBusProxySignal): Structure with the |
| 1422 | information we need about a connected signal. |
| 1423 | (NihDBusSignalHandler): Typedef for signal handler function we |
| 1424 | accept for nih_dbus_proxy_connect() |
| 1425 | * nih-dbus/tests/test_dbus_proxy.c (test_connect) |
| 1426 | (test_signal_destroy): Test the new functions |
| 1427 | |
Scott James Remnant | 6d7b512 | 2009-05-25 22:12:51 +0200 | [diff] [blame] | 1428 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_destroy) |
| 1429 | (nih_dbus_proxy_name_track): If we don't pass a DBusError to |
| 1430 | dbus_bus_remove_match() then it won't wait for the reply, which |
| 1431 | leaks a method call reply elsewhere. |
| 1432 | |
Scott James Remnant | 830a758 | 2009-05-24 01:27:34 +0200 | [diff] [blame] | 1433 | 2009-05-24 Scott James Remnant <scott@netsplit.com> |
| 1434 | |
Scott James Remnant | c86a5a6 | 2009-05-24 01:42:42 +0200 | [diff] [blame] | 1435 | * nih-dbus-tool/tests/test_method.c (test_proxy_function) |
| 1436 | (test_proxy_sync_function), |
| 1437 | * nih-dbus-tool/tests/test_property.c (test_proxy_get_function) |
| 1438 | (test_proxy_set_function, test_proxy_get_sync_function) |
| 1439 | (test_proxy_set_sync_function), |
| 1440 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c (test_method_dispatch): |
| 1441 | Update arguments to nih_dbus_proxy_new() calls |
| 1442 | |
Scott James Remnant | 830a758 | 2009-05-24 01:27:34 +0200 | [diff] [blame] | 1443 | * nih-dbus/dbus_proxy.h (NihDBusProxy): Add owner member to |
| 1444 | store the unique name of the proxied object, also add a handler |
| 1445 | function for the owner dropping off the bus and a data pointer to |
| 1446 | pass to it. |
| 1447 | (NihDBusLostHandler): typedef for lost handler function |
| 1448 | * nih-dbus/dbus_proxy.c (nih_dbus_proxy_new): Accept the lost handler |
| 1449 | and data members, setting in the function. If the lost handler is |
| 1450 | passed (which may only be passed if name is not NULL) then we'll |
| 1451 | track that name on the bus. |
| 1452 | (nih_dbus_proxy_destroy): We need a destructor to tear down and |
| 1453 | remove bus matches and connection filters, and also unreference the |
| 1454 | connection. |
| 1455 | (nih_dbus_proxy_name_track): Set up tracking for a name, which is |
| 1456 | far more complicated than it needs to be; arranges for the |
| 1457 | NameOwnerChanged signal to be received, and obtains the current owner |
| 1458 | of the name. |
| 1459 | (nih_dbus_proxy_name_rule): Function to generate the match rule |
| 1460 | used for the NameOwnerChanged signal. |
| 1461 | (nih_dbus_proxy_name_owner_changed): Handle the NameOwnerChanged |
| 1462 | rule, updating the owner member of the proxy and calling the lost |
| 1463 | handler if the name becomes NULL. |
| 1464 | * nih-dbus/dbus_interface.h: Add a pre-declaration for the |
| 1465 | NihDBusProxy typedef since we'll need to pass this to signal filter |
| 1466 | functions defined here later on |
| 1467 | |
Scott James Remnant | 45585d0 | 2009-05-22 11:38:43 +0200 | [diff] [blame] | 1468 | 2009-05-22 Scott James Remnant <scott@netsplit.com> |
| 1469 | |
Scott James Remnant | a20a91c | 2009-05-22 15:17:35 +0200 | [diff] [blame] | 1470 | * nih/inotify.h: Remove this wrapper, we require a libc with |
| 1471 | inotify support. |
| 1472 | * m4/misc.m4 (NIH_INIT): Remove the check for sys/inotify.h |
| 1473 | * nih/watch.c, |
| 1474 | * nih/watch.h, |
| 1475 | * nih/tests/test_watch.c: Update includes. |
| 1476 | * nih/Makefile.am (nihinclude_HEADERS): Remove inotify.h |
| 1477 | |
Scott James Remnant | 45585d0 | 2009-05-22 11:38:43 +0200 | [diff] [blame] | 1478 | * COPYING: Change licence from GPL-2+ to MIT. |
| 1479 | All files have been updated to reflect this. |
| 1480 | |
Scott James Remnant | 1a43003 | 2009-05-21 11:21:31 +0200 | [diff] [blame] | 1481 | 2009-05-21 Scott James Remnant <scott@netsplit.com> |
| 1482 | |
| 1483 | * nih-dbus/dbus_object.h: Separate out the actual structure |
| 1484 | definitions for an interface, the overlap is getting difficult |
| 1485 | to manage and they're shared with proxies anyway. |
| 1486 | * nih-dbus/dbus_interface.h: File for the separated out interfaces |
| 1487 | * nih-dbus/libnih-dbus.h: Include new header |
| 1488 | * nih-dbus/Makefile.am (nihdbusinclude_HEADERS): Ship and install it |
| 1489 | |
Scott James Remnant | 0287d02 | 2009-05-19 02:17:15 +0200 | [diff] [blame] | 1490 | 2009-05-19 Scott James Remnant <scott@netsplit.com> |
| 1491 | |
Scott James Remnant | 8d54d13 | 2009-05-19 03:13:46 +0200 | [diff] [blame] | 1492 | * nih-dbus-tool/signal.c (signal_emit_function): Rename to |
| 1493 | signal_object_function for consistency |
| 1494 | * nih-dbus-tool/signal.h: Update header |
| 1495 | * nih-dbus-tool/tests/signal_factory.c: Update. |
Scott James Remnant | 8e0cd06 | 2009-05-19 10:05:05 +0200 | [diff] [blame] | 1496 | * nih-dbus-tool/tests/test_signal.c (test_emit_function): Rename to |
| 1497 | test_object_function to match; update |
Scott James Remnant | 8d54d13 | 2009-05-19 03:13:46 +0200 | [diff] [blame] | 1498 | |
Scott James Remnant | 3c5d865 | 2009-05-19 03:06:21 +0200 | [diff] [blame] | 1499 | * nih-dbus-tool/method.c (method_proxy_sync_function): Also |
| 1500 | following the property code, rework method calls to return an |
| 1501 | integer as well - which means some tricksy cleanup code in the |
| 1502 | case of argument errors now we don't have a top-level message |
| 1503 | to free. |
| 1504 | * nih-dbus-tool/tests/method_code.h: Update the expected prototype |
Scott James Remnant | 8d54d13 | 2009-05-19 03:13:46 +0200 | [diff] [blame] | 1505 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): |
| 1506 | Update the tests to match |
Scott James Remnant | 3c5d865 | 2009-05-19 03:06:21 +0200 | [diff] [blame] | 1507 | |
Scott James Remnant | 93bb25d | 2009-05-19 02:32:29 +0200 | [diff] [blame] | 1508 | * nih-dbus-tool/method.c (method_proxy_notify_function): Of course, |
| 1509 | that's only useful if the notify function handles there being no |
| 1510 | reply handler, so put an if around the calling of it. |
| 1511 | * nih-dbus-tool/tests/test_method.c (test_proxy_notify_function): |
| 1512 | Update the output tests to look for the if. Add test cases for |
| 1513 | that as well. |
| 1514 | |
Scott James Remnant | a00e675 | 2009-05-19 02:24:57 +0200 | [diff] [blame] | 1515 | * nih-dbus-tool/method.c (method_proxy_function): Make the same |
| 1516 | modification that we made to the property functions, allowing the |
| 1517 | reply handler to be NULL as long as the error handler isn't |
| 1518 | * nih-dbus-tool/tests/test_method.c (test_proxy_function): Adjust |
| 1519 | the output test functions, and also add a test in for no reply |
| 1520 | handler but an error handler |
| 1521 | |
Scott James Remnant | 0287d02 | 2009-05-19 02:17:15 +0200 | [diff] [blame] | 1522 | * nih-dbus-tool/property.c (property_proxy_set_function) |
| 1523 | (property_proxy_set_notify_function): Functions to generate functions |
| 1524 | to make an asynchronous method call to set the value of a property. |
| 1525 | * nih-dbus-tool/property.h: Add prototypes |
| 1526 | * nih-dbus-tool/tests/property_factory.c: Use the functions to |
| 1527 | generate functions for testing purposes |
| 1528 | * nih-dbus-tool/tests/property_code.h: Expected prototypes of |
| 1529 | generated functions, along with the handler typedef that we need |
| 1530 | * nih-dbus-tool/tests/test_property.c (test_proxy_set_function) |
| 1531 | (test_proxy_set_notify_function): Test the functions and the |
| 1532 | generated code |
| 1533 | |
Scott James Remnant | 38a4aa2 | 2009-05-18 12:08:21 +0100 | [diff] [blame] | 1534 | 2009-05-18 Scott James Remnant <scott@netsplit.com> |
| 1535 | |
Scott James Remnant | cb6a099 | 2009-05-18 18:28:48 +0100 | [diff] [blame] | 1536 | * nih-dbus/dbus_pending_data.c (nih_dbus_pending_data_new): Allow |
| 1537 | handler to be NULL. |
| 1538 | * nih-dbus/tests/test_dbus_pending_data.c (test_new): Make sure |
| 1539 | that NULL is permitted. |
| 1540 | |
Scott James Remnant | c850f80 | 2009-05-18 17:41:01 +0100 | [diff] [blame] | 1541 | * nih-dbus-tool/property.c (property_proxy_get_function) |
| 1542 | (property_proxy_get_notify_function): Functions to generate functions |
| 1543 | to make an asynchronous method call to get the value of a property. |
| 1544 | * nih-dbus-tool/property.h: Add prototypes |
| 1545 | * nih-dbus-tool/tests/property_factory.c: Use the functions to |
| 1546 | generate functions for testing purposes |
| 1547 | * nih-dbus-tool/tests/property_code.h: Expected prototypes of |
| 1548 | generated functions, along with the handler typedef that we need |
| 1549 | * nih-dbus-tool/tests/test_property.c (test_proxy_get_function) |
| 1550 | (test_proxy_get_notify_function): Test the functions and the |
| 1551 | generated code |
| 1552 | |
Scott James Remnant | 4b76f81 | 2009-05-18 15:28:47 +0100 | [diff] [blame] | 1553 | * nih-dbus-tool/property.c (property_proxy_get_sync_function) |
| 1554 | (property_proxy_set_sync_function): Make sure we clean up in |
| 1555 | cases of out-of-memory for the interface name and property name |
| 1556 | arguments. |
| 1557 | * nih-dbus-tool/tests/test_property.c (test_proxy_get_sync_function) |
| 1558 | (test_proxy_set_sync_function): Adjust test cases to match |
| 1559 | |
Scott James Remnant | 69ceaa6 | 2009-05-18 15:19:38 +0100 | [diff] [blame] | 1560 | * nih-dbus-tool/method.c (method_proxy_notify_function): No need |
| 1561 | to use NIH_MUST when we're in an emomem loop. |
| 1562 | * nih-dbus-tool/tests/test_method.c (test_proxy_notify_function): |
| 1563 | Update output tests to match. |
| 1564 | |
Scott James Remnant | 38a4aa2 | 2009-05-18 12:08:21 +0100 | [diff] [blame] | 1565 | * nih-dbus-tool/property.c (property_proxy_get_sync_function) |
| 1566 | (property_proxy_set_sync_function): Functions to generate functions |
| 1567 | to make a synchronous method call to get or set the value of a |
| 1568 | property respectively. |
| 1569 | * nih-dbus-tool/property.h: Add prototypes |
| 1570 | * nih-dbus-tool/tests/property_factory.c: Call the two functions |
| 1571 | to generate functions for testing |
| 1572 | * nih-dbus-tool/tests/property_code.h: Prototypes for expected |
| 1573 | generated functions |
| 1574 | * nih-dbus-tool/tests/test_property.c (test_proxy_get_sync_function) |
| 1575 | (test_proxy_set_sync_function): Test the code generator and the |
| 1576 | generated code. |
| 1577 | |
Scott James Remnant | 6f1b093 | 2009-05-17 14:06:43 +0100 | [diff] [blame] | 1578 | 2009-05-17 Scott James Remnant <scott@netsplit.com> |
| 1579 | |
| 1580 | * NEWS: Add entry for move of nih-dbus errors |
| 1581 | |
Scott James Remnant | 63a33ec | 2009-05-15 17:38:57 +0100 | [diff] [blame] | 1582 | 2009-05-15 Scott James Remnant <scott@netsplit.com> |
| 1583 | |
Scott James Remnant | 51f6952 | 2009-05-15 20:04:54 +0100 | [diff] [blame] | 1584 | * nih/tests/test_error.c (test_raise_no_memory): Fix missing |
| 1585 | nih_error_get () |
| 1586 | (test_raise_error): Free the second error |
| 1587 | * nih/libnih.supp: Suppress the abort()-related leak |
| 1588 | |
Scott James Remnant | 0b2b763 | 2009-05-15 19:53:57 +0100 | [diff] [blame] | 1589 | * nih-dbus-tool/method.c (method_object_function): Rename externs |
| 1590 | to handlers |
| 1591 | * nih-dbus-tool/method.h: Update prototype |
| 1592 | * nih-dbus-tool/tests/method_factory.c: Update calls |
| 1593 | * nih-dbus-tool/tests/test_method.c (test_object_function): Update |
| 1594 | variable names in tests |
| 1595 | |
Scott James Remnant | d89a1be | 2009-05-15 19:51:25 +0100 | [diff] [blame] | 1596 | * nih-dbus-tool/method.c (method_reply_function) |
| 1597 | (method_proxy_sync_function): Remove the unused externs parameters |
| 1598 | * nih-dbus-tool/method.h: Update prototypes |
| 1599 | * nih-dbus-tool/tests/method_factory.c: Don't pass when we don't |
| 1600 | use them |
| 1601 | * nih-dbus-tool/tests/test_method.c (test_reply_function) |
| 1602 | (test_proxy_sync_function): Remove the empty list checks |
| 1603 | |
Scott James Remnant | d98182a | 2009-05-15 19:46:46 +0100 | [diff] [blame] | 1604 | * nih-dbus-tool/property.c (property_object_get_function) |
| 1605 | (property_object_set_function): Rename externs to handlers |
| 1606 | * nih-dbus-tool/property.h: Update prototypes |
| 1607 | * nih-dbus-tool/tests/property_factory.c: Update calls |
| 1608 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 1609 | (test_object_set_function): Update variable names in tests. |
| 1610 | |
Scott James Remnant | fd1c5f8 | 2009-05-15 19:43:12 +0100 | [diff] [blame] | 1611 | * nih-dbus-tool/signal.c (signal_emit_function): Remove the externs |
| 1612 | parameter, which is not used. |
| 1613 | * nih-dbus-tool/signal.h: Update prototype |
| 1614 | * nih-dbus-tool/tests/signal_factory.c: Drop externs handling |
| 1615 | * nih-dbus-tool/tests/test_signal.c (test_emit_function): Drop |
| 1616 | tests for empty externs list |
| 1617 | |
Scott James Remnant | 5739aad | 2009-05-15 19:33:12 +0100 | [diff] [blame] | 1618 | * nih/errors.h: Remove the D-Bus errors from this file |
| 1619 | * nih-dbus/errors.h: Place them in a new file. |
| 1620 | * nih-dbus/libnih-dbus.h: Include the new header |
| 1621 | * nih-dbus/Makefile.am (nihdbusinclude_HEADERS): Install the new |
| 1622 | header. |
| 1623 | * nih-dbus/dbus_error.c, |
| 1624 | * nih-dbus/dbus_object.c: |
| 1625 | * nih-dbus/tests/test_dbus_connection.c, |
| 1626 | * nih-dbus/tests/test_dbus_error.c, |
| 1627 | * nih-dbus-tool/tests/method_factory.c, |
| 1628 | * nih-dbus-tool/tests/signal_factory.c, |
| 1629 | * nih-dbus-tool/tests/property_factory.c, |
| 1630 | * nih-dbus-tool/tests/test_method.c, |
| 1631 | * nih-dbus-tool/tests/test_property.c, |
| 1632 | * nih-dbus-tool/tests/test_com.netsplit.Nih.Test_proxy.c: Update |
| 1633 | headers included |
| 1634 | * nih-dbus-tool/nih_dbus_tool.py (Output.sourceFile): Update generated |
| 1635 | includes. |
| 1636 | |
Scott James Remnant | 38c37f8 | 2009-05-15 19:21:28 +0100 | [diff] [blame] | 1637 | * nih-dbus/dbus_object.h (NihDBusPropertySetter): Change prototype |
| 1638 | to return an int, instead of a handler result. This allows us to |
| 1639 | introduce interesting new SetMany-like methods later. |
| 1640 | * nih-dbus/dbus_object.c (nih_dbus_object_property_set): Expand |
| 1641 | the function to do the reply handling here, this actually makes |
| 1642 | things much better for the ENOMEM case. |
| 1643 | * nih-dbus/tests/test_dbus_object.c (test_object_property_set): |
| 1644 | Adjust test cases to match |
| 1645 | |
Scott James Remnant | ab9c106 | 2009-05-15 18:35:14 +0100 | [diff] [blame] | 1646 | * nih-dbus-tool/property.c (property_object_set_function): Rework |
| 1647 | the prototype of property setter functions, we just want to return |
| 1648 | int and have the nih-dbus core deal with sending the reply. |
| 1649 | * nih-dbus-tool/tests/property_code.h: Update prototype. |
| 1650 | * nih-dbus-tool/tests/test_property.c (test_object_set_function): |
| 1651 | Update tests to match |
| 1652 | |
Scott James Remnant | 2ef594b | 2009-05-15 18:03:01 +0100 | [diff] [blame] | 1653 | * nih-dbus-tool/method.c (method_object_function): Push an error |
| 1654 | context around the handler call |
| 1655 | * nih-dbus-tool/tests/test_method.c (test_object_function): Adjust |
| 1656 | tests to expect the error context |
| 1657 | |
Scott James Remnant | b8309ae | 2009-05-15 17:40:12 +0100 | [diff] [blame] | 1658 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): Make |
| 1659 | sure the methods aren't marked to expect no reply (completeness) |
| 1660 | |
Scott James Remnant | e8bc861 | 2009-05-15 17:39:43 +0100 | [diff] [blame] | 1661 | * nih-dbus-tool/method.c (method_proxy_sync_function): Fix nih_strcat |
| 1662 | call to not overwrite variable with return value |
| 1663 | |
Scott James Remnant | 63a33ec | 2009-05-15 17:38:57 +0100 | [diff] [blame] | 1664 | * nih-dbus-tool/method.c (method_proxy_function) |
| 1665 | (method_proxy_notify_function): Functions to generate the two |
| 1666 | functions required for an asynchronous method call, the first makes |
| 1667 | the call and the second is the pending call notify function for it |
| 1668 | that calls the reply handler. |
| 1669 | * nih-dbus-tool/method.h: Prototypes. |
| 1670 | * nih-dbus-tool/tests/method_factory.c: Call both functions to |
| 1671 | generate functions for testing |
| 1672 | * nih-dbus-tool/tests/method_code.h: Expected prototypes for the |
| 1673 | generated functions. |
| 1674 | * nih-dbus-tool/tests/test_method.c (test_proxy_function) |
| 1675 | (test_proxy_notify_function): Test the code generator and the |
| 1676 | generated code. |
| 1677 | |
Scott James Remnant | d23c9a0 | 2009-05-14 14:13:37 +0100 | [diff] [blame] | 1678 | 2009-05-14 Scott James Remnant <scott@netsplit.com> |
| 1679 | |
Scott James Remnant | c6d3ced | 2009-05-14 14:13:51 +0100 | [diff] [blame] | 1680 | * nih-dbus/dbus_pending_data.c (nih_dbus_pending_data_new): Allocate |
| 1681 | a new NihDBusPendingData structure, referencing the D-Bus connection. |
| 1682 | (nih_dbus_pending_data_destroy): Unreference the attached connection. |
| 1683 | * nih-dbus/dbus_pending_data.h: Function typedefs, structure and |
| 1684 | function prototype. |
| 1685 | * nih-dbus/tests/test_dbus_pending_data.c: Test suite. |
| 1686 | * nih-dbus/libnih-dbus.h: Include the header |
| 1687 | * nih-dbus/Makefile.am (libnih_dbus_la_SOURCES): Build and link |
| 1688 | the new source file |
| 1689 | (nihdbusinclude_HEADERS): Install the header |
| 1690 | (TESTS): Run the test suite |
| 1691 | (test_dbus_pending_data_SOURCES, test_dbus_pending_data_LDFLAGS) |
| 1692 | (test_dbus_pending_data_LDADD): Test suite details. |
| 1693 | |
Scott James Remnant | d23c9a0 | 2009-05-14 14:13:37 +0100 | [diff] [blame] | 1694 | * nih-dbus/dbus_object.c (nih_dbus_object_new): Add a comment to |
| 1695 | explain why we don't reference the connection in NihDBusObject. |
| 1696 | * nih-dbus/dbus_object.h (NihDBusObject): Document that no |
| 1697 | reference is held on @conn |
| 1698 | |
Scott James Remnant | 894f084 | 2009-05-13 14:15:41 +0100 | [diff] [blame] | 1699 | 2009-05-13 Scott James Remnant <scott@netsplit.com> |
| 1700 | |
Scott James Remnant | 084b895 | 2009-05-13 21:34:47 +0100 | [diff] [blame] | 1701 | * nih-dbus-tool/method.c (method_proxy_sync_function): Rename the |
| 1702 | message local to method_call and the msg local to message to match |
| 1703 | other functions. |
| 1704 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): |
| 1705 | Update tests to match |
| 1706 | |
Scott James Remnant | f4daab7 | 2009-05-13 21:26:05 +0100 | [diff] [blame] | 1707 | * nih-dbus-tool/method.c (method_proxy_sync_function): Unreference |
| 1708 | the D-Bus method call we're building, not the message we'll return. |
| 1709 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): |
| 1710 | Adjust output functions to account for the change. |
| 1711 | |
Scott James Remnant | a6524d3 | 2009-05-13 19:25:54 +0100 | [diff] [blame] | 1712 | * nih-dbus-tool/method.c (method_object_function): We can't just |
| 1713 | use a do { .. } while (0) loop and continue in the case of ENOMEM |
| 1714 | because that won't work for arrays. Instead use a local label to |
| 1715 | goto the continuation of an outer loop like we do in |
| 1716 | method_proxy_sync_function() |
| 1717 | * nih-dbus-tool/tests/test_method.c (test_object_function): Adjust |
| 1718 | output tests to account for the change. |
| 1719 | |
Scott James Remnant | 9ffc47e | 2009-05-13 19:18:30 +0100 | [diff] [blame] | 1720 | * nih-dbus-tool/tests/test_method.c (test_object_function) |
| 1721 | (test_reply_function): Add tests for argument-less methods. |
| 1722 | * nih-dbus-tool/tests/test_signal.c (test_emit_function): Add |
| 1723 | test for argument-less signal, and missing test for deprecated |
| 1724 | signals. |
| 1725 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 1726 | (test_object_set_function): Add missing tests for deprecated |
| 1727 | properties. |
| 1728 | * nih-dbus-tool/method.c (method_object_function) |
| 1729 | (method_reply_function): Build the assert block up as we go |
| 1730 | * nih-dbus-tool/signal.c (signal_emit_function): Build up the |
| 1731 | assert block as we go. |
| 1732 | |
Scott James Remnant | d8ac3d4 | 2009-05-13 18:35:02 +0100 | [diff] [blame] | 1733 | * nih-dbus-tool/method.c (method_proxy_sync_function): Generate a |
| 1734 | function to make a synchronous method call to a remote D-Bus object. |
| 1735 | * nih-dbus-tool/method.h: Prototype. |
| 1736 | * nih-dbus-tool/tests/method_factory.c: Use the function to |
| 1737 | generate a function for testing |
| 1738 | * nih-dbus-tool/tests/method_code.h: Add expected prototype of |
| 1739 | generated function. |
| 1740 | * nih-dbus-tool/tests/test_method.c (test_proxy_sync_function): Test |
| 1741 | the generator function and the generated function. |
| 1742 | |
Scott James Remnant | e13fb16 | 2009-05-13 15:37:31 +0100 | [diff] [blame] | 1743 | * nih-dbus/dbus_message.c (nih_dbus_message_new): Pass parent to |
| 1744 | nih_new() not NULL. |
| 1745 | |
Scott James Remnant | 894f084 | 2009-05-13 14:15:41 +0100 | [diff] [blame] | 1746 | * nih/error.h (nih_error_raise_no_memory): Finally succum and |
| 1747 | add this macro. |
| 1748 | (nih_return_no_memory_error): Use that macro in this. |
| 1749 | * nih/tests/test_error.c (test_raise_no_memory): Add test case. |
| 1750 | |
Scott James Remnant | ecee1fe | 2009-05-12 14:38:53 +0100 | [diff] [blame] | 1751 | 2009-05-12 Scott James Remnant <scott@netsplit.com> |
| 1752 | |
Scott James Remnant | 244171f | 2009-05-12 15:26:59 +0100 | [diff] [blame] | 1753 | * nih-dbus-tool/tests/method_factory.c, |
| 1754 | * nih-dbus-tool/tests/signal_factory.c, |
| 1755 | * nih-dbus-tool/tests/property_factory.c: Use the returned externs |
| 1756 | list for the prototypes, rather than hard-coding them. |
| 1757 | |
Scott James Remnant | bc3832f | 2009-05-12 15:05:01 +0100 | [diff] [blame] | 1758 | * nih-dbus-tool/type.c (type_to_static, type_to_extern): Methods |
| 1759 | to prepend "static" and "extern" onto a type. |
| 1760 | * nih-dbus-tool/type.h: Prototypes. |
| 1761 | * nih-dbus-tool/tests/test_type.c (test_to_static) |
| 1762 | (test_to_extern): Test the methods. |
| 1763 | |
Scott James Remnant | 2c2d1d3 | 2009-05-12 14:40:41 +0100 | [diff] [blame] | 1764 | * nih-dbus-tool/tests/test_parse.c (test_parse_xml): Update due to |
| 1765 | change in error from D-Bus 1.2.14 |
| 1766 | |
Scott James Remnant | ecee1fe | 2009-05-12 14:38:53 +0100 | [diff] [blame] | 1767 | * nih-dbus-tool/method.c (method_object_function) |
| 1768 | (method_reply_function): Replace the hand-coded function layout code |
| 1769 | with a call to type_func_to_string() |
| 1770 | * nih-dbus-tool/tests/test_method.c (test_object_function) |
| 1771 | (test_reply_function): Adjust tests to account for the indentation |
| 1772 | differences. |
| 1773 | * nih-dbus-tool/signal.c (signal_emit_function): Replace code |
| 1774 | * nih-dbus-tool/tests/test_signal.c (test_emit_function): Adjust tests |
| 1775 | * nih-dbus-tool/property.c (property_object_get_function) |
| 1776 | (property_object_set_function): Replace code |
| 1777 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 1778 | (test_object_set_function): Adjust tests |
| 1779 | |
Scott James Remnant | 8806f1a | 2009-05-11 18:39:42 +0100 | [diff] [blame] | 1780 | 2009-05-11 Scott James Remnant <scott@netsplit.com> |
| 1781 | |
Scott James Remnant | 061903b | 2009-05-11 21:11:19 +0100 | [diff] [blame] | 1782 | * nih-dbus-tool/property.c (property_get_function, property_set_function): |
| 1783 | Accept list arguments for prototypes and externs, filling them in. |
| 1784 | * nih-dbus-tool/property.h: Adjust prototypes. |
| 1785 | * nih-dbus-tool/tests/property_factory.c: Pass in the prototypes |
| 1786 | and extern lists, but don't actually use them just yet. |
| 1787 | * nih-dbus-tool/tests/test_property.c (test_get_function) |
| 1788 | (test_set_function): Add tests for returned prototype, including |
| 1789 | a test for not having a deprecated attribute. |
| 1790 | |
Scott James Remnant | 426326f | 2009-05-11 20:24:32 +0100 | [diff] [blame] | 1791 | * nih-dbus-tool/signal.c (signal_reply_function): Accept list |
| 1792 | arguments for prototypes and externs, filling in the prototypes |
| 1793 | one. |
| 1794 | * nih-dbus-tool/signal.h: Adjust prototype. |
| 1795 | * nih-dbus-tool/tests/signal_factory.c: Pass in the prototypes |
| 1796 | and extern lists, but don't actually use them just yet. |
| 1797 | * nih-dbus-tool/tests/test_signal.c (test_reply_function): Add |
| 1798 | tests for returned prototype, including a test for not having a |
| 1799 | deprecated attribute. |
| 1800 | |
Scott James Remnant | c967390 | 2009-05-11 20:04:49 +0100 | [diff] [blame] | 1801 | * nih-dbus-tool/demarshal.c (demarshal_array), |
| 1802 | * nih-dbus-tool/marshal.c (marshal_array), |
| 1803 | * nih-dbus-tool/method.c (method_object_function) |
| 1804 | (method_reply_function), |
| 1805 | * nih-dbus-tool/signal.c (signal_emit_function), |
| 1806 | * nih-dbus-tool/property.c (property_object_get_function) |
| 1807 | (property_object_set_function): Line-up variable blocks. |
| 1808 | * nih-dbus-tool/tests/test_demarshal.c (test_demarshal), |
| 1809 | * nih-dbus-tool/tests/test_marshal.c (test_marshal), |
| 1810 | * nih-dbus-tool/tests/test_method.c (test_object_function) |
| 1811 | (test_reply_function): |
| 1812 | * nih-dbus-tool/tests/test_signal.c (test_emit_function): |
| 1813 | * nih-dbus-tool/tests/test_property.c (test_object_get_function): |
| 1814 | Adjust string output checks for the slight difference in indentation |
| 1815 | |
Scott James Remnant | 8806f1a | 2009-05-11 18:39:42 +0100 | [diff] [blame] | 1816 | * nih-dbus-tool/type.c (type_func_to_string, type_func_layout): |
| 1817 | Functions to convert TypeFunc entries into strings. |
| 1818 | * nih-dbus-tool/type.h: Add prototypes. |
| 1819 | * nih-dbus-tool/tests/test_type.c (test_func_to_string) |
| 1820 | (test_func_layout): Test cases for the functions. |
| 1821 | |
Scott James Remnant | fcb7444 | 2009-05-10 11:28:44 +0100 | [diff] [blame] | 1822 | 2009-05-10 Scott James Remnant <scott@netsplit.com> |
| 1823 | |
Scott James Remnant | 5c0dd6c | 2009-05-10 19:42:34 +0100 | [diff] [blame] | 1824 | * nih-dbus-tool/type.c (type_var_to_string, type_var_layout): |
| 1825 | Functions to convert TypeVar entries into strings. |
| 1826 | * nih-dbus-tool/type.h: Prototypes. |
| 1827 | * nih-dbus-tool/tests/test_type.c (test_var_to_string) |
| 1828 | (test_var_layout): Test cases. |
| 1829 | |
Scott James Remnant | fa710f7 | 2009-05-10 16:18:52 +0100 | [diff] [blame] | 1830 | * nih-dbus-tool/tests/test_marshal.c (test_marshal): Make sure |
| 1831 | the input and local variable parents are correct, and make sure the |
| 1832 | lists are empty in case of memory error. |
| 1833 | * nih-dbus-tool/tests/test_demarshal.c (test_demarshal): Make sure |
| 1834 | the output and local variable parents are correct, and make sure the |
| 1835 | lists are empty in case of memory error. |
| 1836 | |
Scott James Remnant | fc0e9f9 | 2009-05-10 16:05:24 +0100 | [diff] [blame] | 1837 | * nih-dbus-tool/method.c (method_reply_function): Accept list |
| 1838 | arguments for prototypes and externs, filling in the prototypes |
| 1839 | one. |
| 1840 | * nih-dbus-tool/method.h: Adjust prototype. |
| 1841 | * nih-dbus-tool/tests/method_factory.c: Pass in the prototypes |
| 1842 | and extern lists, but don't actually use them just yet. |
| 1843 | * nih-dbus-tool/tests/test_method.c (test_reply_function): Add |
| 1844 | tests for returned prototype, including a test for not having a |
| 1845 | deprecated attribute. |
| 1846 | |
Scott James Remnant | 103d68c | 2009-05-10 15:46:53 +0100 | [diff] [blame] | 1847 | * nih-dbus-tool/method.c (method_object_function): Accept list |
| 1848 | arguments for prototypes and externs. |
| 1849 | * nih-dbus-tool/method.h: Add prototype. |
| 1850 | * nih-dbus-tool/tests/method_factory.c: Pass in the prototypes |
| 1851 | and extern lists, but don't actually use them just yet.x |
| 1852 | * nih-dbus-tool/tests/test_method.c (test_object_function): Add |
| 1853 | tests for returned prototype, and add a test for not having a |
| 1854 | deprecated attribute |
| 1855 | |
Scott James Remnant | fcb7444 | 2009-05-10 11:28:44 +0100 | [diff] [blame] | 1856 | * nih-dbus-tool/type.h (TypeFunc): Structure to represent a function |
| 1857 | definition. |
| 1858 | * nih-dbus-tool/type.c (type_func_new): Function to create a new |
| 1859 | TypeFunc structure. |
| 1860 | * nih-dbus-tool/tests/test_type.c (test_func_new): Test for the |
| 1861 | function. |
| 1862 | |
Scott James Remnant | fc6e39b | 2009-05-09 11:09:43 +0100 | [diff] [blame] | 1863 | 2009-05-09 Scott James Remnant <scott@netsplit.com> |
| 1864 | |
Scott James Remnant | 115e3df | 2009-05-09 16:50:04 +0100 | [diff] [blame] | 1865 | * nih/error.c (nih_error_steal): Add a new function to get an |
| 1866 | error and remove it from the context, needed for stashing errors |
| 1867 | while trying something else - or raising an error outside of a |
| 1868 | context. |
| 1869 | * nih/error.h: Add prototype. |
| 1870 | * nih/tests/test_error.c (test_steal): Add test cases. |
| 1871 | |
Scott James Remnant | 897aac5 | 2009-05-09 14:59:53 +0100 | [diff] [blame] | 1872 | * nih/error.h: Update documentation. |
| 1873 | |
Scott James Remnant | ab48348 | 2009-05-09 14:48:15 +0100 | [diff] [blame] | 1874 | * TODO: Update. |
| 1875 | |
Scott James Remnant | ed0f221 | 2009-05-09 14:31:39 +0100 | [diff] [blame] | 1876 | * nih/main.c (nih_main_daemonise): Don't just ignore the raised |
| 1877 | error when we fail to write the pid file, at least warn about it. |
| 1878 | * nih/tests/test_main.c (test_daemonise): Hide the output from |
| 1879 | nih_main_daemonise() which will usually bitch about permissions |
| 1880 | |
Scott James Remnant | 19119aa | 2009-05-09 14:03:25 +0100 | [diff] [blame] | 1881 | * nih/tests/test_io.c (test_watcher): In various tests, we close |
| 1882 | the file descriptor when reading or writing and check for an error |
| 1883 | being raised - but had forgotten that we'd get the error again |
| 1884 | when the structure is closed as it tries to close the descriptor |
| 1885 | (test_message_recv, test_message_send, test_reopen) |
| 1886 | (test_destroy): Add a few contexts around critical bits to make |
| 1887 | sure we're not leaking any other errors. |
| 1888 | |
Scott James Remnant | 2760759 | 2009-05-09 13:30:11 +0100 | [diff] [blame] | 1889 | * nih/error.c (nih_error_clear): Make an unhandled error an |
| 1890 | assertion failure |
| 1891 | * nih/tests/test_error.c (test_pop_context): Make sure the |
| 1892 | unhandled error is asserted |
| 1893 | (test_raise_error): Make sure a double-raise is asserted. |
| 1894 | |
Scott James Remnant | 66287af | 2009-05-09 13:04:23 +0100 | [diff] [blame] | 1895 | * nih/error.c (nih_error_clear): Allow the function to be called |
| 1896 | when there is no current error in the context |
| 1897 | (nih_error_init): Register as an atexit() function so that unhandled |
| 1898 | errors are caught when the process exits. |
| 1899 | (_nih_error_raise_error, nih_error_pop_context): Don't double check, |
| 1900 | just call the function to clear the context. |
| 1901 | |
Scott James Remnant | 24a58c1 | 2009-05-09 12:58:09 +0100 | [diff] [blame] | 1902 | * nih/error.c (_nih_error_raise_error): Don't allow the same |
| 1903 | error to be raised twice anymore. |
| 1904 | * nih/tests/test_error.c (test_pop_context): No need to raise the |
| 1905 | error twice. |
| 1906 | * nih/io.c (nih_io_watcher): Don't double-raise the error. |
| 1907 | * nih/watch.c (nih_watch_add): Again, don't double-raise the error |
| 1908 | * nih/tests/test_file.c (my_error_handler): No need to double-raise |
| 1909 | * nih-dbus-tool/annotation.c (annotation_start_tag): Don't need |
| 1910 | to double-raise either |
| 1911 | |
Scott James Remnant | aee7672 | 2009-05-09 12:31:45 +0100 | [diff] [blame] | 1912 | * nih/error.h (NIH_SHOULD): We don't need to raise the error again, |
| 1913 | simply don't free it. |
| 1914 | * nih/error.c (_nih_error_raise_error): Don't accept a NULL |
| 1915 | filename anymore. |
| 1916 | |
Scott James Remnant | 6552a63 | 2009-05-09 12:23:58 +0100 | [diff] [blame] | 1917 | * nih/error.c (_nih_error_raise, _nih_error_raise_printf) |
| 1918 | (_nih_error_raise_system): Don't make the error a child of the |
| 1919 | context. |
| 1920 | |
Scott James Remnant | 5be86d8 | 2009-05-09 12:18:51 +0100 | [diff] [blame] | 1921 | * nih/error.h (NihError): Add filename, line and function members |
| 1922 | set when the error is raised. |
| 1923 | (NIH_SHOULD): Re-raise using _nih_error_raise_error() directly |
| 1924 | passing NULL for the filename and such so it's not overwritten (this |
| 1925 | is a temporary hack) |
| 1926 | (nih_error_raise, nih_error_raise_printf) |
| 1927 | (nih_error_raise_system, nih_error_raise_error): Macros to wrap the |
| 1928 | underlying functions passing the filename, line and function name |
| 1929 | in which they were expanded. |
| 1930 | * nih/error.c (nih_error_raise, nih_error_raise_printf) |
| 1931 | (nih_error_raise_system, nih_error_raise_error): Rename to have |
| 1932 | an initial underscore, accepting filename, line and function |
| 1933 | arguments from the wrapping macros. |
| 1934 | (_nih_error_raise_error): Set the filename, line and function |
| 1935 | members of the raised error (we just overwrite these). |
| 1936 | (nih_error_clear): Report where the unhandled error came from. |
| 1937 | |
Scott James Remnant | fc6e39b | 2009-05-09 11:09:43 +0100 | [diff] [blame] | 1938 | * nih/error.c (nih_error_destroy): Add destructor functions for error |
| 1939 | messages, this clears the error from the current error context. |
| 1940 | (nih_error_raise_error): Set the destructor. |
| 1941 | (nih_error_clear): Assert that the destructor frees the error, don't |
| 1942 | do it ourselves. |
| 1943 | (nih_error_get): Do not clear the error from the context. |
| 1944 | (nih_error_raise_error): Check for the error being double-raised |
| 1945 | which is currently permitted. |
| 1946 | |
Scott James Remnant | a2c8e14 | 2009-05-07 12:58:17 +0100 | [diff] [blame] | 1947 | 2009-05-07 Scott James Remnant <scott@netsplit.com> |
Scott James Remnant | 629d60c | 2009-05-06 08:30:40 +0100 | [diff] [blame] | 1948 | |
Scott James Remnant | 4f6ba3c | 2009-05-07 13:09:04 +0100 | [diff] [blame] | 1949 | * nih-dbus-tool/annotation.c (annotation_start_tag): Update |
| 1950 | error call to nih_error_raise_error(). |
| 1951 | |
Scott James Remnant | ffe6786 | 2009-05-06 08:34:07 +0100 | [diff] [blame] | 1952 | * nih/tests/test_error.c (test_raise_error): Use TEST_ALLOC_FAIL |
| 1953 | and a separate error context for each test. |
| 1954 | |
Scott James Remnant | 629d60c | 2009-05-06 08:30:40 +0100 | [diff] [blame] | 1955 | * nih/error.c (nih_error_raise_again): Rename to nih_error_raise_error() |
| 1956 | (nih_error_raise, nih_error_raise_printf) |
| 1957 | (nih_error_raise_system): Update calling. |
| 1958 | * nih/error.h (NIH_SHOULD): Update calling. |
| 1959 | Update prototype. |
| 1960 | * nih/tests/test_error.c (test_raise_again): Rename and change calls. |
| 1961 | * nih/io.c (nih_io_watcher): Update call. |
| 1962 | * nih/watch.c (nih_watch_add): Update call. |
| 1963 | * nih/tests/test_file.c (my_error_handler): Update call. |
| 1964 | * nih-dbus/dbus_error.c (nih_dbus_error_raise) |
| 1965 | (nih_dbus_error_raise_printf): Update calls. |
| 1966 | |
Scott James Remnant | e2924a9 | 2009-04-28 10:39:33 +0100 | [diff] [blame] | 1967 | 2009-04-28 Scott James Remnant <scott@netsplit.com> |
| 1968 | |
Scott James Remnant | 0c6f9f9 | 2009-04-28 19:03:57 +0100 | [diff] [blame] | 1969 | * nih-dbus-tool/marshal.c (marshal_array, marshal_struct): We |
| 1970 | have to close a container in out-of-memory situations, unrefing |
| 1971 | the message isn't sufficient. |
| 1972 | * nih-dbus-tool/tests/test_marshal.c (test_marshal): Make sure |
| 1973 | all those containers are closed. |
| 1974 | * nih-dbus-tool/tests/test_method.c (test_object_function) |
| 1975 | (test_reply_function): Make sure containers called from method |
| 1976 | functions are closed on error too |
| 1977 | * nih-dbus-tool/property.c (property_object_get_function): Close |
| 1978 | containers in case of out-of-memory error. |
| 1979 | * nih-dbus-tool/tests/test_property.c (test_object_get_function): |
| 1980 | Make sure the close container code is added. |
| 1981 | |
Scott James Remnant | 9257c67 | 2009-04-28 18:46:49 +0100 | [diff] [blame] | 1982 | * nih-dbus/tests/test_dbus_object.c (test_object_message): Add a |
| 1983 | test where the first handler declines |
| 1984 | (test_object_property_set): Make sure that the Set handler cannot |
| 1985 | decline, as we can't do the same for the Get handler. |
| 1986 | * nih-dbus/dbus_object.c (nih_dbus_object_message): Move onto the |
| 1987 | next handler if the handler declines. |
| 1988 | |
Scott James Remnant | 1ba29fb | 2009-04-28 18:35:06 +0100 | [diff] [blame] | 1989 | * nih-dbus-tool/Makefile.am (nih_dbus_tool_LDADD) |
| 1990 | (test_method_LDADD, test_signal_LDADD) |
| 1991 | (test_com_netsplit_Nih_Test_object_LDADD) |
| 1992 | (test_com_netsplit_Nih_Test_proxy_LDADD): Always put libnih.la |
| 1993 | after libnih-dbus.la |
| 1994 | |
Scott James Remnant | da0795a | 2009-04-28 18:32:48 +0100 | [diff] [blame] | 1995 | * nih-dbus/dbus_object.h (NihDBusMethod): Move the method handler |
| 1996 | to be the last member. |
| 1997 | * nih-dbus/tests/test_dbus_object.c: Update. |
| 1998 | * nih-dbus-tool/nih_dbus_tool.py (Interface.methodsArray): Update. |
| 1999 | |
Scott James Remnant | e7357f7 | 2009-04-28 18:11:03 +0100 | [diff] [blame] | 2000 | * nih-dbus/Makefile.am (libnih_dbus_la_LIBS): Include libnih.la |
| 2001 | as it's a dependency. |
| 2002 | (test_dbus_error_LDADD, test_dbus_connection_LDADD) |
| 2003 | (test_dbus_message_LDADD, test_dbus_object_LDADD) |
| 2004 | (test_dbus_proxy_LDADD, test_dbus_util_LDADD): Specify libnih-dbus.la |
| 2005 | first since it's what we're testing, and deps go the other way |
| 2006 | |
Scott James Remnant | deec664 | 2009-04-28 18:10:21 +0100 | [diff] [blame] | 2007 | * nih-dbus/tests/test_dbus_object.c (test_object_introspect): Add |
| 2008 | a missing test case for too many arguments to the Introspect call. |
| 2009 | * nih-dbus/dbus_object.c (nih_dbus_object_introspect): Which reveals |
| 2010 | we didn't catch this. |
| 2011 | |
Scott James Remnant | f4f01da | 2009-04-28 18:07:05 +0100 | [diff] [blame] | 2012 | * nih-dbus/tests/test_dbus_object.c (test_object_property_get) |
| 2013 | (test_object_property_get_all, test_object_property_set): Add |
| 2014 | missing test cases for argument errors. |
| 2015 | |
Scott James Remnant | daeb7e4 | 2009-04-28 18:00:12 +0100 | [diff] [blame] | 2016 | * nih-dbus/dbus_object.c (nih_dbus_object_property_get_all): Add |
| 2017 | function to retrieve all properties at once. |
| 2018 | (nih_dbus_object_message): Call out to it. |
| 2019 | * nih-dbus/tests/test_dbus_object.c (test_object_property_get_all): |
| 2020 | Test the new function. |
| 2021 | |
Scott James Remnant | 0ad6033 | 2009-04-28 16:57:27 +0100 | [diff] [blame] | 2022 | * nih-dbus/dbus_object.h (NihDBusPropertyGetter) |
| 2023 | (NihDBusPropertySetter): Add function typedefs for property get |
| 2024 | and set functions. |
| 2025 | (NihDBusProperty): Add getter and setter members. |
| 2026 | * nih-dbus/dbus_object.c (nih_dbus_object_property_get) |
| 2027 | (nih_dbus_object_property_set): Functions to handle calling the |
| 2028 | getter and setter functions for a single property Get or Set method. |
| 2029 | (nih_dbus_object_message): Call out to the new functions. |
| 2030 | * nih-dbus/tests/test_dbus_object.c (test_object_property_get) |
| 2031 | (test_object_property_set): Test the new single property get/set |
| 2032 | functions. |
| 2033 | |
Scott James Remnant | 68a289a | 2009-04-28 12:53:39 +0100 | [diff] [blame] | 2034 | * nih-dbus/dbus_object.h (NihDBusMarshaller): Rename to |
| 2035 | NihDBusMethodHandler, since this prototype only applies to methods |
| 2036 | and not to properties. |
| 2037 | (nih_dbus_method): Change type and name of marshaller member to |
| 2038 | handler. |
| 2039 | * nih-dbus/dbus_object.c (nih_dbus_object_message): Update name |
| 2040 | of function pointer member we use. |
| 2041 | * nih-dbus/tests/test_dbus_object.c: Avoid using the word "marshal" |
| 2042 | and use "handler" instead. |
| 2043 | |
Scott James Remnant | 46aaf5e | 2009-04-28 12:36:26 +0100 | [diff] [blame] | 2044 | * nih-dbus/dbus_object.c (nih_dbus_object_introspect): Put the |
| 2045 | Introspect interface last, since it's the least important one; |
| 2046 | we always want the object's own interfaces first, followed by |
| 2047 | properties, followed by introspection, followed by children nodes. |
| 2048 | * nih-dbus/tests/test_dbus_object.c (test_object_introspect): |
| 2049 | Update tests to match. |
| 2050 | |
Scott James Remnant | be7d4c1 | 2009-04-28 12:34:54 +0100 | [diff] [blame] | 2051 | * nih-dbus/tests/test_dbus_object.c (test_object_message): Split |
| 2052 | out the introspection test cases into a new function. |
| 2053 | (test_object_introspect): Add a test for having no properties. |
| 2054 | |
Scott James Remnant | b79c80c | 2009-04-28 12:30:49 +0100 | [diff] [blame] | 2055 | * nih-dbus/tests/test_dbus_object.c (test_object_new) |
| 2056 | (test_object_destroy, test_object_unregister) |
| 2057 | (test_object_message): Convert to test using TEST_DBUS rather than |
| 2058 | a hodge-podge of different buses and servers. |
| 2059 | |
Scott James Remnant | 45766d1 | 2009-04-28 12:30:40 +0100 | [diff] [blame] | 2060 | * nih-dbus/test_dbus.h (TEST_DBUS_DISPATCH): Equivalent to |
| 2061 | TEST_DBUS_MESSAGE but dispatches the message internally rather |
| 2062 | than stealing it. |
| 2063 | |
Scott James Remnant | e2924a9 | 2009-04-28 10:39:33 +0100 | [diff] [blame] | 2064 | * nih-dbus/tests/test_dbus_connection.c (test_connect): Add tests |
| 2065 | for a fake disconnected signal (as much as we can test anyway). |
| 2066 | |
Scott James Remnant | deaa872 | 2009-04-27 15:46:46 +0100 | [diff] [blame] | 2067 | 2009-04-27 Scott James Remnant <scott@netsplit.com> |
| 2068 | |
Scott James Remnant | cd9231e | 2009-04-27 18:51:42 +0100 | [diff] [blame] | 2069 | * nih-dbus/dbus_connection.h: Note on allocation. |
| 2070 | |
Scott James Remnant | ae3d7c9 | 2009-04-27 18:50:21 +0100 | [diff] [blame] | 2071 | * nih-dbus/dbus_message.h: Add documentation string. |
| 2072 | |
Scott James Remnant | 50bd1a4 | 2009-04-27 18:44:39 +0100 | [diff] [blame] | 2073 | * nih-dbus/tests/test_dbus_message.c (test_message_new): Add missing |
| 2074 | call to dbus_shutdown() after test case. |
| 2075 | (test_message_error): Rewrite using TEST_DBUS and using |
| 2076 | TEST_ALLOC_FAIL to check for memory issues. |
| 2077 | |
Scott James Remnant | 6ac1133 | 2009-04-27 18:16:18 +0100 | [diff] [blame] | 2078 | * nih-dbus/dbus_connection.h: Add documentation. |
| 2079 | |
Scott James Remnant | 3e1611b | 2009-04-27 17:57:24 +0100 | [diff] [blame] | 2080 | * nih-dbus/dbus_connection.c (nih_dbus_setup): We actually want |
| 2081 | to attempt to setup the watch, timeout and wake-up functions each |
| 2082 | time through nih_dbus_setup() so it can be called in a loop in |
| 2083 | cases of out-of-memory so do this first before setting the main |
| 2084 | loop function, and unwind in case of error. |
| 2085 | (nih_dbus_watch_toggled): D-Bus could try and change the flags |
| 2086 | with a toggle? |
| 2087 | |
Scott James Remnant | 709650b | 2009-04-27 17:13:04 +0100 | [diff] [blame] | 2088 | * nih-dbus/dbus_connection.h (NihDBusConnectHandler): Add missing |
| 2089 | Returns to documentation string. |
| 2090 | |
Scott James Remnant | 3db5f8e | 2009-04-27 17:12:22 +0100 | [diff] [blame] | 2091 | * nih-dbus/dbus_error.h: Add documentation string. |
| 2092 | |
Scott James Remnant | bb4c360 | 2009-04-27 17:02:52 +0100 | [diff] [blame] | 2093 | * nih-dbus/dbus_connection.c (nih_dbus_connect, nih_dbus_bus): |
| 2094 | Clarify that it's ok to unreference a connection obtained with |
| 2095 | these functions - indeed we do so everywhere in the test suite. |
| 2096 | |
Scott James Remnant | 3866c41 | 2009-04-27 16:59:54 +0100 | [diff] [blame] | 2097 | * nih-dbus/dbus_connection.c (nih_dbus_connect, nih_dbus_bus) |
| 2098 | (nih_dbus_server): Return ENOMEM raised on insufficient memory |
| 2099 | rather than the D-Bus equivalent; we don't just convert these |
| 2100 | everywhere because sometimes we want to know that it's the |
| 2101 | remote side that's out of memory and we don't want to use ENOMEM |
| 2102 | for that. |
| 2103 | |
Scott James Remnant | e93b63c | 2009-04-27 16:28:24 +0100 | [diff] [blame] | 2104 | * nih-dbus/tests/test_dbus_connection.c: Various cleanup fixes, |
| 2105 | making sure we unref everything that we use. Increase timeout |
| 2106 | for method calls since things get slower when under valgrind. |
| 2107 | |
Scott James Remnant | 546d981 | 2009-04-27 15:47:04 +0100 | [diff] [blame] | 2108 | * nih-dbus/dbus_connection.c (nih_dbus_connection_disconnected): |
| 2109 | Push an error context while calling the handler. |
| 2110 | (nih_dbus_new_connection): Push an error context while calling |
| 2111 | the handler. |
| 2112 | |
Scott James Remnant | deaa872 | 2009-04-27 15:46:46 +0100 | [diff] [blame] | 2113 | * nih/timer.c (nih_timer_poll): The timer callback can free the |
| 2114 | timer, so we need to adjust the due time before we call it. In |
| 2115 | the case of timeouts, we hold a reference while calling and |
| 2116 | always free after returning. Also push an error context during |
| 2117 | it so we don't leak errors. |
| 2118 | |
Scott James Remnant | 168cfa4 | 2009-04-24 14:15:36 +0100 | [diff] [blame] | 2119 | 2009-04-24 Scott James Remnant <scott@netsplit.com> |
| 2120 | |
| 2121 | * nih-dbus/tests/test_dbus_connection.c (test_connect): Add tests |
| 2122 | for a method call being made and its reply received through the |
| 2123 | main loop, and for a method call timing out within the main loop. |
| 2124 | This exercises the watch and timeout functions. |
| 2125 | |
Scott James Remnant | 7c6b3d2 | 2009-04-23 00:47:01 +0100 | [diff] [blame] | 2126 | 2009-04-23 Scott James Remnant <scott@netsplit.com> |
| 2127 | |
Scott James Remnant | 1e78ad4 | 2009-04-24 13:11:25 +0100 | [diff] [blame] | 2128 | * nih-dbus/tests/test_dbus_connection.c (test_server): Add tests |
| 2129 | for address in use, |
| 2130 | |
Scott James Remnant | bfdc2c2 | 2009-04-23 10:21:32 +0100 | [diff] [blame] | 2131 | * nih/tests/test_logging.c (my_logger): Safely strdup the message. |
| 2132 | (test_set_logger, test_set_priority, test_log_message): Make sure |
| 2133 | all calls are wrapped with TEST_ALLOC_FAIL |
| 2134 | (test_logger_printf): Call TEST_ALLOC_FAIL for everything. |
| 2135 | |
Scott James Remnant | 10ff818 | 2009-04-23 01:02:21 +0100 | [diff] [blame] | 2136 | * nih/Makefile.am (.PHONY): Mark tests phony. |
| 2137 | * nih-dbus/Makefile.am (.PHONY): Mark tests phony. |
| 2138 | * nih-dbus-tool/Makefile.am (.PHONY): Mark tests phony. |
| 2139 | |
Scott James Remnant | 96235df | 2009-04-23 00:58:51 +0100 | [diff] [blame] | 2140 | * nih-dbus/Makefile.am (libnih_dbus_la_CFLAGS, AM_CFLAGS): Replace |
| 2141 | the former with the latter. |
| 2142 | (test_dbus_error_CFLAGS, test_dbus_connection_LDFLAGS) |
| 2143 | (test_dbus_message_CFLAGS, test_dbus_object_CFLAGS) |
| 2144 | (test_dbus_proxy_CFLAGS, test_dbus_util_CFLAGS): Remove. |
| 2145 | |
Scott James Remnant | 7c6b3d2 | 2009-04-23 00:47:01 +0100 | [diff] [blame] | 2146 | * nih-dbus/tests/test_dbus_connection.c: Wrap every test in |
| 2147 | NIH_ALLOC_FAIL, to properly make sure that we handle failure |
| 2148 | cases properly. |
| 2149 | * nih-dbus/dbus_connection.c (nih_dbus_server): Disconnect the |
| 2150 | server before unreferencing it. |
| 2151 | |
Scott James Remnant | 119487a | 2009-04-22 14:23:52 +0100 | [diff] [blame] | 2152 | 2009-04-22 Scott James Remnant <scott@netsplit.com> |
| 2153 | |
Scott James Remnant | d0fc7b1 | 2009-04-22 15:32:08 +0100 | [diff] [blame] | 2154 | * nih-dbus-tool/nih_dbus_tool.py (Method.marshalFunction): Also fix |
| 2155 | async method handler return to match. |
| 2156 | |
Scott James Remnant | 119487a | 2009-04-22 14:23:52 +0100 | [diff] [blame] | 2157 | * nih-dbus-tool/tests/test_main.c, |
| 2158 | * nih-dbus-tool/tests/test_node.c, |
| 2159 | * nih-dbus-tool/tests/test_interface.c, |
| 2160 | * nih-dbus-tool/tests/test_method.c, |
| 2161 | * nih-dbus-tool/tests/test_signal.c, |
| 2162 | * nih-dbus-tool/tests/test_property.c, |
| 2163 | * nih-dbus-tool/tests/test_argument.c, |
| 2164 | * nih-dbus-tool/tests/test_annotation.c, |
| 2165 | * nih-dbus-tool/tests/test_parse.c: All tests cases should use |
| 2166 | TEST_ALLOC_FAIL, even the ones testing for errors. To get around |
| 2167 | situations where some allocations may be repeated, but others will |
| 2168 | fail, check the return value to see which happened. |
| 2169 | |
Scott James Remnant | e9cdea1 | 2009-04-21 12:22:53 +0100 | [diff] [blame] | 2170 | 2009-04-21 Scott James Remnant <scott@netsplit.com> |
| 2171 | |
Scott James Remnant | 0a2deae | 2009-04-21 19:37:40 +0100 | [diff] [blame] | 2172 | * nih-dbus/tests/test_dbus_message.c (my_return_error): Return |
| 2173 | DBUS_HANDLED_RESULT_HANDLED otherwise the message will be ignored. |
| 2174 | |
Scott James Remnant | 5b6156a | 2009-04-21 16:37:56 +0100 | [diff] [blame] | 2175 | * nih-dbus-tool/property.c (property_object_get_function) |
| 2176 | (property_object_set_function): Generate code for functions to get |
| 2177 | and set, respectively, properties using a handler function. |
| 2178 | * nih-dbus-tool/property.h: Add prototypes. |
| 2179 | * nih-dbus-tool/tests/property_factory.c: Call the two functions |
| 2180 | to generate their resulting property get and set functions and |
| 2181 | place them in a C file for testing. |
| 2182 | * nih-dbus-tool/tests/property_code.h: Expected prototypes for |
| 2183 | generated functions. |
| 2184 | * nih-dbus-tool/tests/test_property.c (test_object_get_function) |
| 2185 | (test_object_set_function): Tests for the code, and for the |
| 2186 | resulting generated code. |
| 2187 | * nih-dbus-tool/Makefile.am (check_PROGRAMS): Run the program |
| 2188 | to generate the C code. |
| 2189 | (property_factory_SOURCES) |
| 2190 | (property_factory_LDFLAGS, property_factory_LDADD) |
| 2191 | (tests/property_code.c): Details for code generator. |
| 2192 | (CLEANFILES): Clean up after. |
| 2193 | (test_property_SOURCES): Link to the generated code. |
| 2194 | |
Scott James Remnant | e9cdea1 | 2009-04-21 12:22:53 +0100 | [diff] [blame] | 2195 | * nih-dbus/dbus_object.c: Add missing include for previous commit. |
| 2196 | |
Scott James Remnant | fc4ce39 | 2009-04-20 07:45:07 +0100 | [diff] [blame] | 2197 | 2009-04-20 Scott James Remnant <scott@netsplit.com> |
| 2198 | |
Scott James Remnant | 0617df9 | 2009-04-20 07:47:35 +0100 | [diff] [blame] | 2199 | * nih-dbus/dbus_object.c (nih_dbus_object_message): Call the |
| 2200 | marshaller function inside a context so that errors aren't leaked. |
| 2201 | |
Scott James Remnant | fc4ce39 | 2009-04-20 07:45:07 +0100 | [diff] [blame] | 2202 | * nih-dbus/dbus_object.c (nih_dbus_object_message): We don't need |
| 2203 | any special handling for async functions now we have nih_local, the |
| 2204 | function simply needs to reference the message. Drop the requirement |
| 2205 | that it returns DBUS_HANDLER_RESULT_NOT_YET_HANDLED. |
| 2206 | * nih-dbus-tool/method.c (method_object_function): Always return |
| 2207 | DBUS_HANDLER_RESULT_HANDLED, even for async methods. |
| 2208 | * nih-dbus-tool/tests/test_method.c (test_object_function): Replace |
| 2209 | tests for not yet handled with ones for the ordinary handled result. |
| 2210 | |
Scott James Remnant | 0624e04 | 2009-04-18 20:37:13 +0100 | [diff] [blame] | 2211 | 2009-04-18 Scott James Remnant <scott@netsplit.com> |
| 2212 | |
Scott James Remnant | ceb0e48 | 2009-04-18 21:19:07 +0100 | [diff] [blame] | 2213 | * nih-dbus-tool/signal.c (signal_emit_function): Generate code for |
| 2214 | a function that emits a signal. |
| 2215 | * nih-dbus-tool/signal.h: Add prototype. |
| 2216 | * nih-dbus-tool/tests/signal_factory.c: Call signal_emit_function() |
| 2217 | to generate a signal emission function and place it in a C file |
| 2218 | for testing. |
| 2219 | * nih-dbus-tool/tests/signal_code.h: Expected prototype for generated |
| 2220 | function. |
| 2221 | * nih-dbus-tool/tests/test_signal.c (test_emit_function): Test the |
| 2222 | generator function and generated function. |
| 2223 | * nih-dbus-tool/Makefile.am (check_PROGRAMS): Run the program to |
| 2224 | generate the C code. |
| 2225 | (signal_factory_SOURCES, signal_factory_LDFLAGS) |
| 2226 | (signal_factory_LDADD, tests/signal_code.c): Details for generator |
| 2227 | (CLEANFILES): Clean up after. |
| 2228 | (test_signal_SOURCES): Link to the generated code. |
| 2229 | |
Scott James Remnant | 0624e04 | 2009-04-18 20:37:13 +0100 | [diff] [blame] | 2230 | * nih-dbus-tool/method.c (method_object_function) |
| 2231 | (method_reply_function): Add missing asserts. |
| 2232 | |
Scott James Remnant | 715ffe4 | 2009-04-17 15:17:43 +0100 | [diff] [blame] | 2233 | 2009-04-17 Scott James Remnant <scott@netsplit.com> |
| 2234 | |
Scott James Remnant | 28cd777 | 2009-04-17 18:25:38 +0100 | [diff] [blame] | 2235 | * nih-dbus-tool/tests/test_method.c: Oops, commented out the test. |
| 2236 | |
Scott James Remnant | accc16d | 2009-04-17 18:18:23 +0100 | [diff] [blame] | 2237 | * nih-dbus-tool/tests/test_method.c (test_object_function): Add |
| 2238 | test cases for the no reply expected flag on an incoming message. |
| 2239 | |
Scott James Remnant | b297e94 | 2009-04-17 18:11:19 +0100 | [diff] [blame] | 2240 | * nih-dbus-tool/method.c (method_reply_function): Generate code for |
| 2241 | a function that sends a reply to an asynchronous method call. |
| 2242 | * nih-dbus-tool/method.h: Add prototype. |
| 2243 | * nih-dbus-tool/tests/method_factory.c: Call method_reply_function() |
| 2244 | to generate a reply function and place it in a C file for testing. |
| 2245 | * nih-dbus-tool/tests/method_code.h: Expected prototype. |
| 2246 | * nih-dbus-tool/tests/test_method.c (test_reply_function): Add test |
| 2247 | cases for the code, the generated code, and the no reply expected |
| 2248 | case. |
| 2249 | |
Scott James Remnant | f074699 | 2009-04-17 16:54:34 +0100 | [diff] [blame] | 2250 | * nih-dbus-tool/tests/test_method.c (test_object_function): Add |
| 2251 | tests for too many arguments in method call |
| 2252 | * nih-dbus-tool/method.c (method_object_function): Add a block of |
| 2253 | code to check for extra function arguments. |
| 2254 | |
Scott James Remnant | bece8fc | 2009-04-17 16:06:14 +0100 | [diff] [blame] | 2255 | * nih-dbus-tool/method.c (method_object_function): When the method |
| 2256 | is marked async, ignore the output arguments and don't try and send |
| 2257 | any reply - instead returning the magic "not yet handled" code. |
| 2258 | * nih-dbus-tool/tests/method_factory.c: Generate an async version |
| 2259 | of the same function for testing. |
| 2260 | * nih-dbus-tool/tests/method_code.h: Add prototype |
| 2261 | * nih-dbus-tool/tests/test_method.c (test_object_function): Test |
| 2262 | code generation and the generated code for an asynchronous method. |
| 2263 | |
Scott James Remnant | 715ffe4 | 2009-04-17 15:17:43 +0100 | [diff] [blame] | 2264 | * nih-dbus-tool/method.c (method_object_function): Generate code for |
| 2265 | a function that handles an incoming method call, and calls a handler |
| 2266 | function for it. |
| 2267 | * nih-dbus-tool/method.h: Add prototype. |
| 2268 | * nih-dbus-tool/tests/test_method.c (test_object_function): Tests |
| 2269 | cases for the function and the function code it generates. |
| 2270 | * nih-dbus-tool/tests/method_factory.c: Call method_object_function() |
| 2271 | to generate a function, and place it in a C file for testing. |
| 2272 | * nih-dbus-tool/tests/method_code.h: Prototype for generated function. |
| 2273 | * nih-dbus-tool/Makefile.am (check_PROGRAMS): Build the method_factory |
| 2274 | program when running tests |
| 2275 | (nih_dbus_tool_SOURCES, TESTS): Marshalling/demarshalling code now |
| 2276 | has to come before parsing and method code since we use it. |
| 2277 | (method_factory_SOURCES, method_factory_LDFLAGS) |
| 2278 | (method_factory_LDADD, tests/method_code.c): Run the method_factory |
| 2279 | tool to generate tests/method_code.c |
| 2280 | (test_method_SOURCES, test_method_LDADD): Link to the output of |
| 2281 | the method_factory tool |
| 2282 | (CLEANFILES): Clean up |
| 2283 | (test_node_LDADD, test_interface_LDADD, test_signal_LDADD) |
| 2284 | (test_property_LDADD, test_argument_LDADD) |
| 2285 | (test_annotation_LDADD, test_parse_LDADD): Add marshal/demarshal |
| 2286 | object files |
| 2287 | |
Scott James Remnant | eb0c0d9 | 2009-04-16 14:15:33 +0100 | [diff] [blame] | 2288 | 2009-04-16 Scott James Remnant <scott@netsplit.com> |
| 2289 | |
Scott James Remnant | a7eb496 | 2009-04-16 14:16:59 +0100 | [diff] [blame] | 2290 | * nih-dbus-tool/tests/marshal_factory.c (marshal_function): Remove |
| 2291 | code to get type which we never use now we have the demarshalling |
| 2292 | function outputs |
| 2293 | * nih-dbus-tool/tests/demarshal_factory.c (demarshal_function): Remove |
| 2294 | code to get type which we never use now we have the marshalling |
| 2295 | function inputs. |
| 2296 | |
Scott James Remnant | eb0c0d9 | 2009-04-16 14:15:33 +0100 | [diff] [blame] | 2297 | * nih-dbus-tool/demarshal.c (demarshal_basic): Do not make the output |
| 2298 | variable a pointer, when used in method object/signal proxy mode we |
| 2299 | actually have this as a local variable and want the demarshalled |
| 2300 | value placed directly into it. |
| 2301 | (demarshal_array, demarshal_struct): Instead of making the output |
| 2302 | variable a pointer, demarshal into a local and copy that into the |
| 2303 | output variable. |
| 2304 | * nih-dbus-tool/tests/demarshal_factory.c (demarshal_function): Make |
| 2305 | passed in outputs pointers, copy into them after demarshalling |
| 2306 | * nih-dbus-tool/tests/test_demarshal.c (test_demarshal): Make sure |
| 2307 | that const does not appear in the inputs, or comments, but that all |
| 2308 | locals are still const (as they are only copies) even in source. |
| 2309 | |
Scott James Remnant | 130dca0 | 2009-04-15 11:46:05 +0100 | [diff] [blame] | 2310 | 2009-04-15 Scott James Remnant <scott@netsplit.com> |
| 2311 | |
Scott James Remnant | 4285e24 | 2009-04-15 17:40:09 +0100 | [diff] [blame] | 2312 | * nih-dbus-tool/marshal.c (marshal_basic): Do not make the input |
| 2313 | variable const, when used in method object/signal proxy mode we |
| 2314 | might modify the local variable before passing it to the marshalling |
| 2315 | code so can't have it const. |
| 2316 | (marshal_array, marshal_struct): Instead of making the input |
| 2317 | variable const, make the local we copy into const. |
| 2318 | * nih-dbus-tool/tests/marshal_factory.c (marshal_function): Make |
| 2319 | passed-in inputs const. |
| 2320 | * nih-dbus-tool/tests/test_marshal.c (test_marshal): Make sure that |
| 2321 | const does not appear in the inputs, or comments, but that all locals |
| 2322 | are still const (as they are only copies) even in source. |
| 2323 | |
| 2324 | * nih-dbus-tool/type.c (type_of): can't pass a size_t to a format |
| 2325 | length, and don't want to cast down to int in case of underrun |
| 2326 | |
Scott James Remnant | 130dca0 | 2009-04-15 11:46:05 +0100 | [diff] [blame] | 2327 | Continue porting the D-Bus binding tool from Python to C, this code |
| 2328 | implements the type marshalling and demarshalling with additional |
| 2329 | support for arrays of arrays of fixed types and structures that the |
| 2330 | Python code never had. |
| 2331 | |
| 2332 | * nih-dbus-tool/type.c, nih-dbus-tool/type.h: Functions to identify |
| 2333 | C types from D-Bus type signatures, and to handle variable |
| 2334 | declarations |
| 2335 | * nih-dbus-tool/test_type.c: Test cases |
| 2336 | * nih-dbus-tool/marshal.c, nih-dbus-tool/marshal.h: Generate code |
| 2337 | to marshal data from C standard types with given variable names |
| 2338 | into a D-Bus message. |
| 2339 | * nih-dbus-tool/tests/marshal_factory.c: Generate functions that |
| 2340 | contain the generated code for types that we test |
| 2341 | * nih-dbus-tool/tests/marshal_code.h: Header for generated code |
| 2342 | * nih-dbus-tool/tests/test_marshal.c: Test both the output strings |
| 2343 | and the behaviour of the generated code |
| 2344 | * nih-dbus-tool/demarshal.c, nih-dbus-tool/demarshal.h: Generate |
| 2345 | code to demarshal data from a D-Bus message into C standard types |
| 2346 | with requested variable names. |
| 2347 | * nih-dbus-tool/tests/demarshal_factory.c: Generate functions that |
| 2348 | contain the generated code for types that we test |
| 2349 | * nih-dbus-tool/tests/demarshal_code.h: Header for generated code |
| 2350 | * nih-dbus-tool/tests/test_demarshal.c: Test both the output strings |
| 2351 | and the behaviour of the generated code |
| 2352 | * nih-dbus-tool/Makefile.am (nih_dbus_tool_SOURCES): Build and |
| 2353 | link new source files |
| 2354 | (TESTS): Run test cases for new source files |
| 2355 | (test_type_SOURCES, test_type_LDFLAGS, test_type_LDADD) |
| 2356 | (test_marshal_SOURCES, test_marshal_LDFLAGS, test_marshal_LDADD) |
| 2357 | (test_demarshal_SOURCES, test_demarshal_LDFLAGS) |
| 2358 | (test_demarshal_LDADD): Details for test cases. |
| 2359 | (check_PROGRAMS, marshal_factory_SOURCES) |
| 2360 | (marshal_factory_LDFLAGS, marshal_factory_LDADD) |
| 2361 | (tests/marshal_code.c, demarshal_factory_SOURCES) |
| 2362 | (demarshal_factory_LDFLAGS, demarshal_factory_LDADD) |
| 2363 | (tests/demarshal_code.c, CLEANFILES): In order to test the output |
| 2364 | code, we generate a C file containing it and link it to the test |
| 2365 | cases. This gets cleaned up on "clean" rather than maintainer-clean |
| 2366 | |
Scott James Remnant | baa6974 | 2009-04-15 10:44:49 +0100 | [diff] [blame] | 2367 | 2009-04-04 Scott James Remnant <scott@netsplit.com> |
| 2368 | |
| 2369 | * nih-dbus-tool/parse.c (parse_start_tag, parse_xml): Cast return |
| 2370 | value of XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber to |
| 2371 | size_t and use %zu |
| 2372 | * nih-dbus-tool/node.c (node_start_tag): Likewise. |
| 2373 | * nih-dbus-tool/interface.c (interface_start_tag): Likewise. |
| 2374 | * nih-dbus-tool/method.c (method_start_tag): Likewise. |
| 2375 | * nih-dbus-tool/signal.c (signal_start_tag): Likewise. |
| 2376 | * nih-dbus-tool/property.c (property_start_tag): Likewise. |
| 2377 | * nih-dbus-tool/annotation.c (annotation_start_tag): Likewise. |
| 2378 | * nih-dbus-tool/argument.c (argument_start_tag): Likewise. |
| 2379 | (argument_end_tag): Use %zu for the unsigned count, not %zi |
| 2380 | |
Scott James Remnant | 77853a2 | 2009-03-30 14:45:03 +0100 | [diff] [blame] | 2381 | 2009-03-30 Scott James Remnant <scott@netsplit.com> |
| 2382 | |
Scott James Remnant | db8ee12 | 2009-03-30 19:29:23 +0100 | [diff] [blame] | 2383 | * nih-dbus-tool/main.c (main): open() returns less-than-zero on error |
| 2384 | not zero, which is standard input! |
| 2385 | |
Scott James Remnant | f14d479 | 2009-03-30 19:25:12 +0100 | [diff] [blame] | 2386 | * nih-dbus-tool/Makefile.am (test_com_netsplit_Nih_Test_object_CFLAGS) |
| 2387 | (test_com_netsplit_Nih_Test_proxy_CFLAGS): Remove the CFLAGS |
| 2388 | overrides, we set this globally in the file. |
| 2389 | |
Scott James Remnant | 0dad279 | 2009-03-30 19:24:19 +0100 | [diff] [blame] | 2390 | * nih-dbus-tool/indent.c (indent): Function to indent the lines in |
| 2391 | a string using the specified number of tabs. |
| 2392 | (comment): Function to prepend the traditional " * " comment prefix |
| 2393 | to the lines in a string. |
| 2394 | * nih-dbus-tool/indent.h: Prototypes. |
| 2395 | * nih-dbus-tool/tests/test_indent.c: Test cases. |
| 2396 | * nih-dbus-tool/Makefile.am (TESTS): Build the indent test cases |
| 2397 | (test_indent_SOURCES, test_indent_LDFLAGS, test_indent_LDADD): Details |
| 2398 | for indent test cases |
| 2399 | |
Scott James Remnant | 632343d | 2009-03-30 19:20:16 +0100 | [diff] [blame] | 2400 | * nih-dbus-tool/main.c: Re-order so that the option variables, the |
| 2401 | options list and the main() function can be contained inside a #if |
| 2402 | directive so we can test the rest. |
| 2403 | (source_file_path, header_file_path): Factor out the code from |
| 2404 | main() that generated the source and header file paths so we can |
| 2405 | test; at the same time, fix them so they don't cast ptrdiff_t to int |
| 2406 | and always output to the current working directory unless output_path |
| 2407 | includes one. |
| 2408 | * nih-dbus-tool/tests/test_main.c: Which means we can test the |
| 2409 | mode_option(), source_file_path() and header_file_path() functions |
| 2410 | * nih-dbus-tool/Makefile.am (TESTS): Build and run test_main |
| 2411 | (test_main_SOURCES, test_main_LDFLAGS, test_main_LDADD): usual |
| 2412 | details for test_main, except we use main.c as a SOURCE rather than |
| 2413 | linking in LDADD like we normally do |
| 2414 | (test_main_CFLAGS): Override CFLAGS to set -DTEST, this causes us |
| 2415 | to recompile main.c specially for test_main with the main() function |
| 2416 | #ifdef'd out. |
| 2417 | |
Scott James Remnant | 7dde4cd | 2009-03-30 15:35:48 +0100 | [diff] [blame] | 2418 | * nih-dbus/Makefile.am (tests): Move to the bottom of the file |
| 2419 | * nih/Makefile.am (tests): Move to the bottom of the file |
| 2420 | * nih-dbus-tool/Makefile.am (tests): Move to the bottom of the file |
| 2421 | |
Scott James Remnant | 77853a2 | 2009-03-30 14:45:03 +0100 | [diff] [blame] | 2422 | Begin replacing the old Python D-Bus bindings tool with one |
| 2423 | written in C, starting with the code that parses the introspection |
| 2424 | data. |
| 2425 | |
| 2426 | * nih-dbus-tool/Makefile.am (bin_SCRIPTS, noinst_SCRIPTS) |
| 2427 | (bin_PROGRAMS, noinst_PROGRAMS): Replace the nih-dbus-tool script |
| 2428 | with a program that we need to compile. |
| 2429 | (CLEANFILES, EXTRA_DIST, do_subst, nih-dbus-tool): Drop the rules |
| 2430 | to generate the script by replacing bits out of the Python source |
| 2431 | (nih_dbus_tool_SOURCES, nih_dbus_tool_LDADD): Instead build from |
| 2432 | C sources, and link to libnih, libnih-dbus, expat and libdbus |
| 2433 | (AM_CFLAGS): Require the D-Bus CFLAGS when compiling the tool |
| 2434 | (AM_CPPFLAGS): Include quoted headers from the source directory |
| 2435 | so the test suite can get at them |
| 2436 | (TESTS): Add tests for the various bits of the C tool |
| 2437 | (tests): Rule to generate binaries for the test suite |
| 2438 | (test_symbol_SOURCES, test_symbol_LDFLAGS, test_symbol_LDADD) |
| 2439 | (test_node_SOURCES, test_node_LDFLAGS, test_node_LDADD) |
| 2440 | (test_interface_SOURCES, test_interface_LDFLAGS) |
| 2441 | (test_interface_LDADD, test_method_SOURCES, test_method_LDFLAGS) |
| 2442 | (test_method_LDADD, test_signal_SOURCES, test_signal_LDFLAGS) |
| 2443 | (test_signal_LDADD, test_property_SOURCES) |
| 2444 | (test_property_LDFLAGS, test_property_LDADD) |
| 2445 | (test_argument_SOURCES, test_argument_LDFLAGS) |
| 2446 | (test_argument_LDADD, test_annotation_SOURCES) |
| 2447 | (test_annotation_LDFLAGS, test_annotation_LDADD) |
| 2448 | (test_parse_SOURCES, test_parse_LDFLAGS, test_parse_LDADD): Test |
| 2449 | suite details |
| 2450 | * nih-dbus-tool/main.c, nih-dbus-tool/symbol.c, nih-dbus-tool/symbol.h, |
| 2451 | nih-dbus-tool/tests/test_symbol.c, nih-dbus-tool/node.c, |
| 2452 | nih-dbus-tool/node.h, nih-dbus-tool/tests/test_node.c, |
| 2453 | nih-dbus-tool/interface.c, nih-dbus-tool/interface.h, |
| 2454 | nih-dbus-tool/tests/test_interface.c, nih-dbus-tool/method.c, |
| 2455 | nih-dbus-tool/method.h, nih-dbus-tool/tests/test_method.c, |
| 2456 | nih-dbus-tool/signal.c, nih-dbus-tool/signal.h, |
| 2457 | nih-dbus-tool/tests/test_signal.c, nih-dbus-tool/property.c, |
| 2458 | nih-dbus-tool/property.h, nih-dbus-tool/tests/test_property.c, |
| 2459 | nih-dbus-tool/argument.c, nih-dbus-tool/argument.h, |
| 2460 | nih-dbus-tool/tests/test_argument.c, nih-dbus-tool/annotation.c, |
| 2461 | nih-dbus-tool/annotation.h, nih-dbus-tool/tests/test_annotation.h, |
| 2462 | nih-dbus-tool/parse.c, nih-dbus-tool/parse.h, |
| 2463 | nih-dbus-tool/tests/test_parse.c, nih-dbus-tool/errors.h: Source |
| 2464 | for the tool |
| 2465 | * m4/misc.m4 (NIH_INIT): Explicitly check for pkg-config 0.22 |
| 2466 | * m4/libs.m4 (NIH_LIB_DBUS): Replace check for Python with a check |
| 2467 | for the expat library, removing the HAVE_PYTHON conditional |
| 2468 | entirely. Update required D-Bus version to 1.2.4 |
| 2469 | * README: Update dependencies documentation |
| 2470 | |
Scott James Remnant | 2f3b5b5 | 2009-03-27 14:27:11 +0000 | [diff] [blame] | 2471 | 2009-03-27 Scott James Remnant <scott@netsplit.com> |
| 2472 | |
Scott James Remnant | 00d848e | 2009-03-27 15:38:12 +0000 | [diff] [blame] | 2473 | * nih/file.c (nih_file_read, nih_file_map): Cast to the bigger type. |
| 2474 | |
Scott James Remnant | d63c34e | 2009-03-27 14:27:45 +0000 | [diff] [blame] | 2475 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c: Add missing |
| 2476 | signal.h include. |
| 2477 | |
Scott James Remnant | 2f3b5b5 | 2009-03-27 14:27:11 +0000 | [diff] [blame] | 2478 | * m4/compiler.m4: Add -Wextra, but turn off some of the silly ones. |
| 2479 | * nih/io.c (nih_io_buffer_resize): Remove unnecessary assert. |
| 2480 | * nih/file.c (nih_file_read, nih_file_map): Be explicit when |
| 2481 | comparing signed and unsigned types. |
| 2482 | * nih/option.c (nih_option_long): Cast pointer difference to size_t |
| 2483 | (nih_option_group_help): Use unsigned constant. |
| 2484 | * nih/command.c (nih_command_group_help): Use unsigned constant. |
| 2485 | * nih/tests/test_config.c (test_parse_stanza): Cast -1 to size_t |
| 2486 | to get the real number. |
| 2487 | * nih-dbus/dbus_object.c (nih_dbus_object_vtable): Move static to |
| 2488 | before const. |
| 2489 | * nih-dbus/tests/test_dbus_message.c (my_error_connect): Put |
| 2490 | static before const. |
| 2491 | |
Scott James Remnant | 59b43de | 2009-03-22 10:51:59 +0000 | [diff] [blame] | 2492 | 2009-03-22 Scott James Remnant <scott@netsplit.com> |
| 2493 | |
Scott James Remnant | 202065b | 2009-03-22 11:01:37 +0000 | [diff] [blame] | 2494 | * nih/Makefile.am (tests): Add rule to build all test cases without |
| 2495 | running them (useful when using valgrind). |
| 2496 | * nih-dbus/Makefile.am (tests): Add the same rule. |
| 2497 | |
Scott James Remnant | 3b16727 | 2009-03-22 11:00:55 +0000 | [diff] [blame] | 2498 | * nih/test_values.h (TEST_EQ_STR, TEST_EQ_STRN, TEST_EQ_MEM) |
| 2499 | (TEST_NE_STR, TEST_NE_STRN, TEST_NE_MEM): Guard against NULL being |
| 2500 | parsed. |
| 2501 | * nih/test_alloc.h (TEST_ALLOC_SIZE, TEST_ALLOC_PARENT) |
| 2502 | (TEST_ALLOC_ORPHAN): Also guard against NULL for these. |
| 2503 | |
Scott James Remnant | 59b43de | 2009-03-22 10:51:59 +0000 | [diff] [blame] | 2504 | * nih/test_files.h (TEST_FILE_MATCH): Add test that lets us match |
| 2505 | the content of a file line against a wildcard pattern. |
| 2506 | |
Scott James Remnant | 4bd6c07 | 2009-02-20 22:04:41 +0000 | [diff] [blame] | 2507 | 2009-02-20 Scott James Remnant <scott@netsplit.com> |
| 2508 | |
Scott James Remnant | 3f942cd | 2009-02-20 22:26:09 +0000 | [diff] [blame] | 2509 | * nih/option.c (nih_option_help), |
| 2510 | * nih/command.c (nih_command_help), |
| 2511 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c (my_str_to_int32_array): |
| 2512 | No need for a new_* temporary variable when looping over nih_realloc |
| 2513 | with NIH_MUST. |
| 2514 | |
Scott James Remnant | 6dea449 | 2009-02-20 22:04:48 +0000 | [diff] [blame] | 2515 | * nihify: Add nih-dbus-tool symlink too |
| 2516 | |
Scott James Remnant | 4bd6c07 | 2009-02-20 22:04:41 +0000 | [diff] [blame] | 2517 | * nih/watch.c (nih_watch_new): Update to set variable outside of |
| 2518 | NIH_SHOULD and NIH_MUST macros. |
| 2519 | (nih_watch_add, nih_watch_handle), |
| 2520 | * nih/alloc.c (nih_alloc_ref_new), |
| 2521 | * nih/timer.c (nih_timer_init), |
| 2522 | * nih/signal.c (nih_signal_init), |
| 2523 | * nih/child.c (nih_child_init), |
| 2524 | * nih/io.c (nih_io_init), |
| 2525 | * nih/file.c (nih_dir_walk, nih_dir_walk_scan) |
| 2526 | (nih_dir_walk_visit), |
| 2527 | * nih/main.c (nih_main_init_full, nih_main_version) |
| 2528 | (nih_main_set_pidfile, nih_main_get_pidfile) |
| 2529 | (nih_main_write_pidfile, nih_main_loop_init), |
| 2530 | * nih/option.c (nih_option_parser, nih_option_handle_arg) |
| 2531 | (nih_option_join, nih_option_help, nih_option_group_help), |
| 2532 | * nih/command.c (nih_command_parser, nih_command_join) |
| 2533 | (nih_command_help, nih_command_group_help), |
| 2534 | * nih/logging.c (nih_log_message), |
| 2535 | * nih/error.c (nih_error_init, nih_error_raise) |
| 2536 | (nih_error_raise_printf, nih_error_raise_system) |
| 2537 | (nih_error_push_context), |
| 2538 | * nih/tests/test_string.c (test_array_copy, test_array_append), |
| 2539 | * nih/tests/test_watch.c (my_create_handler, my_modify_handler) |
| 2540 | (my_delete_handler), |
| 2541 | * nih-dbus/dbus_error.c (nih_dbus_error_raise) |
| 2542 | (nih_dbus_error_raise_printf), |
| 2543 | * nih-dbus-tool/tests/com.netsplit.Nih.Test_impl.c () |
| 2544 | (my_test_async_method, my_str_to_int32_array): Update to set |
| 2545 | variable outside of NIH_MUST macro. |
| 2546 | |
Scott James Remnant | d97c2c1 | 2009-02-20 21:45:20 +0000 | [diff] [blame] | 2547 | 2009-02-20 Casey Dahlin <cdahlin@redhat.com> |
| 2548 | |
| 2549 | * nih/macros.h (NIH_MUST, NIH_ZERO): Use the GCC statement |
| 2550 | expression extension (also used by nih_min and nih_max) to allow |
| 2551 | these macros to return the value of their expression. |
| 2552 | * nih/error.h (NIH_SHOULD): Also return its value. |
| 2553 | |
Scott James Remnant | 6119861 | 2009-02-20 21:29:00 +0000 | [diff] [blame] | 2554 | 2009-02-20 Scott James Remnant <scott@netsplit.com> |
| 2555 | |
Scott James Remnant | 2c6799f | 2009-02-20 21:45:09 +0000 | [diff] [blame] | 2556 | * nih-dbus-tool/Makefile.am (test_com_netsplit_Nih_Test_object_LDADD) |
| 2557 | (test_com_netsplit_Nih_Test_proxy_LDADD): Fix path to libnih-dbus.la |
| 2558 | |
Scott James Remnant | 066affe | 2009-02-20 21:33:55 +0000 | [diff] [blame] | 2559 | * nih/option.c (nih_option_parser): Fix a bug where a lone dash |
| 2560 | would be eaten instead of treated as an argument |
| 2561 | * nih/tests/test_option.c (test_parser): Add test case |
| 2562 | |
Scott James Remnant | c346b22 | 2009-02-20 21:30:59 +0000 | [diff] [blame] | 2563 | * nih/option.c (nih_option_help): Support the bugs address being |
| 2564 | a URL, and slightly change the wording we use. |
| 2565 | |
Scott James Remnant | f154f62 | 2009-02-20 21:29:37 +0000 | [diff] [blame] | 2566 | * nih/libnih.ver: We have to export anything beginning _nih_* and |
| 2567 | the program_name and package_* variables. |
| 2568 | |
Scott James Remnant | 6119861 | 2009-02-20 21:29:00 +0000 | [diff] [blame] | 2569 | * configure.ac (AC_INIT): Give bugs address as a URL |
| 2570 | |
Scott James Remnant | 6991921 | 2009-01-30 15:59:56 +0000 | [diff] [blame] | 2571 | 2009-01-30 Scott James Remnant <scott@netsplit.com> |
| 2572 | |
Scott James Remnant | ef3a7cc | 2009-01-30 16:12:46 +0000 | [diff] [blame] | 2573 | * Makefile.am (SUBDIRS): po needs to be last, so always append |
| 2574 | |
Scott James Remnant | 3f2b83e | 2009-01-30 16:10:40 +0000 | [diff] [blame] | 2575 | * configure.ac: Create nih-dbus-tool Makefile |
| 2576 | * Makefile.am (SUBDIRS): Add nih-dbus-tool sub-directory |
| 2577 | * nih-dbus-tool/Makefile.am: Include rules to create nih-dbus-tool |
| 2578 | and its tests |
| 2579 | * nih-dbus/Makefile.am: Remove those rules from here |
| 2580 | * nih-dbus/nih_dbus_tool.py: Move to nih-dbus-tool/nih_dbus_tool.py |
| 2581 | * nih-dbus/tests/com.netsplit.Nih.Test.xml, |
| 2582 | nih-dbus/tests/com.netsplit.Nih.Test_impl.c, |
| 2583 | nih-dbus/tests/com.netsplit.Nih.Test_impl.h, |
| 2584 | nih-dbus/tests/test_com.netsplit.Nih.Test_object.c, |
| 2585 | nih-dbus/tests/test_com.netsplit.Nih.Test_proxy.c: Move to |
| 2586 | nih-dbus-tool/tests |
| 2587 | |
Scott James Remnant | 6991921 | 2009-01-30 15:59:56 +0000 | [diff] [blame] | 2588 | * Makefile.am (SUBDIRS): conditionally add the nih-dbus directory |
| 2589 | depending on HAVE_DBUS |
| 2590 | * nih-dbus/Makefile.am: which means we don't have to conditionalise |
| 2591 | anything in this file, cleaning things up a bit. |
| 2592 | |
Scott James Remnant | a1fbad3 | 2009-01-29 14:36:46 +0000 | [diff] [blame] | 2593 | 2009-01-29 Scott James Remnant <scott@netsplit.com> |
| 2594 | |
| 2595 | * nih-dbus/tests/test_com.netsplit.Nih.Test_proxy.c (test_method_dispatch): |
| 2596 | Fix the test case to not compare a void * with strcmp |
| 2597 | |
Scott James Remnant | e98cbc9 | 2009-01-29 10:05:25 +0000 | [diff] [blame] | 2598 | 2008-01-29 Casey Dahlin <cdahlin@redhat.com> |
Casey Dahlin | abb7818 | 2009-01-29 02:53:35 -0500 | [diff] [blame] | 2599 | |
| 2600 | * nih/nih_dbus_tool.py (Method.asyncDispatchPrototype): Prototype for |
| 2601 | new asynchronous dispatch function, explained below. |
Scott James Remnant | e98cbc9 | 2009-01-29 10:05:25 +0000 | [diff] [blame] | 2602 | (Method.asyncDispatchFunction): The asynchronous dispatch function |
| 2603 | takes a proxy, the arguments to the given method, a callback and an |
| 2604 | "errback" function pointer, and a void pointer. It calls the DBus |
| 2605 | method, but does not wait for a reply. Instead it sets up the |
| 2606 | callback to be called upon reply. If an error occurs, the errback |
| 2607 | is called instead. Either function will recieve the proxy and the |
| 2608 | value in the void pointer as arguments. The normal callback also |
| 2609 | receives arguments for anything returned by the method. |
| 2610 | (Method.asyncNotifyPrototype): Prototype for new asynchronous |
| 2611 | notification function. See below. |
| 2612 | (Method.asyncNotifyFunction): When the asynchronous dispatch function |
| 2613 | sets up a method call, it specifies the function generated by this |
| 2614 | function as the callback, and passes it an NihAsyncNotifyData struct |
| 2615 | containing the user-provided callback and errback. The asynchronous |
| 2616 | notify function then sets up the error to be handled by the errback |
| 2617 | or marshalls the return values to the callback. |
| 2618 | (Generator.exportTypedefs): This function returns a list of tuples |
Scott James Remnant | a1fbad3 | 2009-01-29 14:36:46 +0000 | [diff] [blame] | 2619 | * nih-dbus/tests/test_com.netsplit.Nih.Test_proxy.c (test_method_dispatch): |
Scott James Remnant | e98cbc9 | 2009-01-29 10:05:25 +0000 | [diff] [blame] | 2620 | of (type, name, args) format for typedefs to be placed in the |
| 2621 | generated header file. Args is present for defining function |
| 2622 | arguments for function pointer typedefs. |
| 2623 | (lineup_typedefs): Works like the other lineup_*s. Outputs typedef |
| 2624 | text from (type, name, args) tuples (see above) in a prettified, |
| 2625 | well-spaced format. |
| 2626 | (typedef_lineup_prefix): Used to make names line up well in |
| 2627 | lineup_typedefs. If a string begins with (* it is returned as is. |
| 2628 | If it begins with * it is returned with one leading space. Otherwise |
| 2629 | it gets two leading spaces. |
| 2630 | * nih-dbus/tests/test_com.netsplit.Nih.Test_proxy.c (test_method_dispatch): |
| 2631 | Test asynchronous method dispatch |
Casey Dahlin | abb7818 | 2009-01-29 02:53:35 -0500 | [diff] [blame] | 2632 | |
Scott James Remnant | d569f6f | 2009-01-29 02:39:36 +0000 | [diff] [blame] | 2633 | 2009-01-29 Scott James Remnant <scott@netsplit.com> |
| 2634 | |
Scott James Remnant | b64318a | 2009-01-29 07:31:38 +0000 | [diff] [blame] | 2635 | * nih/alloc.c (nih_alloc_real_set_destructor): Does not modify the |
| 2636 | actual data, so the pointer can be const. |
| 2637 | (nih_ref): Does not modify the actual data, so the pointer can be |
| 2638 | const. |
| 2639 | (nih_unref_only): Does not modify the actual data, and unlike |
| 2640 | nih_unref(), does not free it; so the pointer can be const |
| 2641 | * nih/alloc.h: Update prototypes. |
| 2642 | |
Scott James Remnant | b07fb9b | 2009-01-29 06:13:55 +0000 | [diff] [blame] | 2643 | * configure.ac: Bump version to 0.2.1 |
| 2644 | * NEWS: Begin 0.2.1 |
| 2645 | |
Scott James Remnant | 966b9bf | 2009-01-29 05:45:48 +0000 | [diff] [blame] | 2646 | * NEWS: Update |
| 2647 | |
Scott James Remnant | e05ef7e | 2009-01-29 05:26:16 +0000 | [diff] [blame] | 2648 | * nih/test_alloc.h (TEST_ALLOC_FAIL): Initialise the count in the |
| 2649 | loop pre-condition, still doesn't solve gcc's issues but I prefer |
| 2650 | it. |
| 2651 | |
Scott James Remnant | a95f559 | 2009-01-29 05:03:53 +0000 | [diff] [blame] | 2652 | * nih/tests/test_command.c (test_help): Array was too small, increase |
| 2653 | the size. |
| 2654 | |
Scott James Remnant | 95b093a | 2009-01-29 04:34:00 +0000 | [diff] [blame] | 2655 | * nih/tests/test_string.c (test_str_split): Oops, left some debugging |
| 2656 | in here. |
| 2657 | |
Scott James Remnant | d66f6f2 | 2009-01-29 04:10:21 +0000 | [diff] [blame] | 2658 | * nih/file.c (nih_file_read): Never trust a changelog entry that |
| 2659 | says "minor clean-up"; make sure we raise the error before returning |
| 2660 | NULL. |
| 2661 | |
Scott James Remnant | e73ec09 | 2009-01-29 04:01:36 +0000 | [diff] [blame] | 2662 | * nih-dbus/dbus_connection.c (nih_dbus_setup) |
| 2663 | (nih_dbus_add_watch, nih_dbus_add_timeout): We should discard |
| 2664 | objects attached to the D-Bus connection since they're floating; |
| 2665 | nobody should take a reference, but good practice and all that. |
| 2666 | |
Scott James Remnant | 9a55d37 | 2009-01-29 03:59:43 +0000 | [diff] [blame] | 2667 | * nih/alloc.h: Document the different usage patterns |
| 2668 | |
Scott James Remnant | bfd42c3 | 2009-01-29 03:39:18 +0000 | [diff] [blame] | 2669 | * nih/io.c (nih_io_buffer_resize): Use nih_unref() instead of |
| 2670 | nih_free(), while nothing should have taken a reference, it's a |
| 2671 | good pattern to stick to. |
| 2672 | (nih_io_message_recv): Use nih_local for ctrl_buf |
| 2673 | (nih_io_message_send): Use nih_local for ctrl_buf |
| 2674 | (nih_io_send_message): Take a reference to messages on the send q |
| 2675 | (nih_io_watcher_write): Unreference the message from the NihIo |
| 2676 | object instead of freeing, in case a reference is used elsewhere |
| 2677 | (nih_io_read): Unreference instead of freeing |
| 2678 | (nih_io_get): Unreference instead of freeing |
| 2679 | (nih_io_message_new): Parent should not be the NihIo |
| 2680 | (nih_io_write): Obey that rule here |
| 2681 | |
| 2682 | * nih/tests/test_io.c (test_send_message): Make sure that a |
| 2683 | reference is taken after all. |
| 2684 | (test_watcher): Don't create object with parent as io |
| 2685 | |
Scott James Remnant | cf74329 | 2009-01-29 03:24:30 +0000 | [diff] [blame] | 2686 | * nih/file.c (nih_file_read): Minor clean-up |
| 2687 | |
Scott James Remnant | 46192c8 | 2009-01-29 03:01:57 +0000 | [diff] [blame] | 2688 | * nih/main.c (nih_main_set_pidfile): Discard the pid file in case |
| 2689 | someone took a reference to it. |
| 2690 | |
Scott James Remnant | 2408b37 | 2009-01-29 02:57:12 +0000 | [diff] [blame] | 2691 | * nih/main.c (nih_main_init_full): Discard the package string in |
| 2692 | case another part of the code has taken a reference to it; since |
| 2693 | it never changes unless this function is called, generate it here |
| 2694 | (nih_main_package_string): dropping this function |
| 2695 | (nih_main_version): Fetch package_string |
| 2696 | * nih/main.h: Add external package_string and drop function proto. |
| 2697 | * nih/tests/test_main.c (test_package_string): Fold these tests into |
| 2698 | (test_init): here. |
| 2699 | * nih/libnih.supp: Update suppression |
| 2700 | |
Scott James Remnant | f5a5032 | 2009-01-29 02:42:55 +0000 | [diff] [blame] | 2701 | * nih/logging.c (nih_log_message): Use nih_local for message |
| 2702 | |
Scott James Remnant | f52e132 | 2009-01-29 02:42:18 +0000 | [diff] [blame] | 2703 | * nih/io.c (nih_io_printf): Use nih_local for str |
| 2704 | |
Scott James Remnant | d569f6f | 2009-01-29 02:39:36 +0000 | [diff] [blame] | 2705 | * nih/config.c (nih_config_parse_stanza): Use nih_local for name. |
| 2706 | |
Scott James Remnant | 4b2e464 | 2009-01-28 01:51:00 +0000 | [diff] [blame] | 2707 | 2009-01-28 Scott James Remnant <scott@netsplit.com> |
| 2708 | |
Scott James Remnant | eb449d3 | 2009-01-28 23:49:59 +0000 | [diff] [blame] | 2709 | * nih/file.c (nih_dir_walk_visit): Can't allocate nih_local var |
| 2710 | with a parent, otherwise it'll never be cleaned up. |
| 2711 | |
Scott James Remnant | f7a7b08 | 2009-01-28 23:45:31 +0000 | [diff] [blame] | 2712 | * nih/config.c (nih_config_parse): Initialise nih_local var to NULL. |
| 2713 | |
Scott James Remnant | a25749c | 2009-01-28 08:26:31 +0000 | [diff] [blame] | 2714 | * nih/alloc.c (nih_alloc_context_free): After the destructor has |
| 2715 | been called, an object is dead. Attempting to reference it should |
| 2716 | fail, so we need to store a flag that this has happened. |
| 2717 | (nih_realloc, nih_free, nih_discard, nih_alloc_real_set_destructor) |
| 2718 | (nih_alloc_ref_new, nih_unref, nih_alloc_parent) |
| 2719 | (nih_alloc_ref_lookup, nih_alloc_size): Forbid operations on |
| 2720 | finalised objects. |
| 2721 | |
Scott James Remnant | af039d9 | 2009-01-28 08:03:10 +0000 | [diff] [blame] | 2722 | * nih/tests/test_alloc.c (test_free): Once again I've tripped over |
| 2723 | bugs where the ordering of allocations between siblings in a child |
| 2724 | matters if they refer to each other in their destructor (typical |
| 2725 | case, a hash table in a struct). |
| 2726 | * nih/alloc.c (nih_realloc, nih_alloc_ref_new): Reverse the free |
| 2727 | order, so that the last member allocated is the first one freed. |
| 2728 | This was the original fix for the above bug, but this just moves |
| 2729 | the problem without really fixing it. I do think it's generally |
| 2730 | correct that the order should be backwards though. |
| 2731 | (nih_free): Since this is the only function that needs to do it, |
| 2732 | take care of casting off parents here. |
| 2733 | (nih_unref): Again, since this is the only function that needs |
| 2734 | to free the context when there are no parents, do it here after |
| 2735 | freeing the reference. |
| 2736 | (nih_alloc_ref_free): Which means this function no longer needs |
| 2737 | to recurse; nih_free() and nih_discard() always directly free a |
| 2738 | context, and nih_unref() knows to if there are no parents left; |
| 2739 | nih_unref() explicitly doesn't free the context. |
| 2740 | (nih_unref_only): No need to pass FALSE to nih_alloc_ref_free() now. |
| 2741 | (nih_alloc_context_free): This gets the big rewrite; rather than |
| 2742 | just recursively freeing the heirarchy, finalise them first by |
| 2743 | calling destructors and then reparenting them to the context |
| 2744 | being freed. Only free the objects after all destructors are called. |
| 2745 | |
Scott James Remnant | f72d9b6 | 2009-01-28 05:59:01 +0000 | [diff] [blame] | 2746 | * nih/macros.h (MIN, MAX): Replace with newer evaluation-safe |
| 2747 | nih_min() and nih_max() |
| 2748 | * nih/io.c (nih_io_select_fds): Replace MAX with nih_max |
| 2749 | (nih_io_buffer_pop): Replace MIN with nih_min |
| 2750 | (nih_io_buffer_shrink): Replace MIN with nih_min |
| 2751 | * nih/command.c (nih_command_group_help): Replace MAX with nih_max, |
| 2752 | nicely avoiding multiple function call there. |
| 2753 | * nih/option.c (nih_option_group_help): Likewise. |
| 2754 | * nih/tests/test_io.c (test_select_fds): Replace MAX with nih_max |
| 2755 | |
Scott James Remnant | 4b2e464 | 2009-01-28 01:51:00 +0000 | [diff] [blame] | 2756 | * nih-dbus/nih_dbus_tool.py (Method.replyFunction): Don't free the |
| 2757 | message passed in to the function. Since we now require the handler |
| 2758 | function to take a reference to the message during async processing, |
| 2759 | we can't just go around freeing it. |
| 2760 | (Method.replyPrototype): Warn if the error from the reply function |
| 2761 | is ignored, since this is important. |
| 2762 | * nih-dbus/dbus_message.c (nih_dbus_message_error): Likewise we |
| 2763 | should not free the message when passed in for a caller either. |
| 2764 | * nih-dbus/tests/test_dbus_message.c (my_return_error_cb): Update |
| 2765 | to make sure the message is not freed. |
| 2766 | * nih-dbus/tests/com.netsplit.Nih.Test_impl.c (async_method_reply): |
| 2767 | Make sure message is not freed. |
| 2768 | * NEWS: Document the change |
| 2769 | |
Scott James Remnant | 79683ba | 2009-01-26 00:27:59 +0000 | [diff] [blame] | 2770 | 2009-01-26 Scott James Remnant <scott@netsplit.com> |
| 2771 | |
Scott James Remnant | 8a28c99 | 2009-01-26 15:22:34 +0000 | [diff] [blame] | 2772 | * configure.ac: Officially mandate libtool 2.2 |
| 2773 | * HACKING: Bump dependency on libtool to 2.2.4 |
| 2774 | * NEWS: Document change. |
| 2775 | |
Scott James Remnant | e1e6be9 | 2009-01-26 15:17:55 +0000 | [diff] [blame] | 2776 | * configure.ac (AC_INIT): Bump version to 0.2.0 since we're making |
| 2777 | a number of large API changes. |
| 2778 | (AC_COPYRIGHT): Bump the copyright year too. |
| 2779 | * NEWS (0.1.0): Declare 0.1.0 to have happened at revision 600 before |
| 2780 | we started the most recent round of changes; this is the version |
| 2781 | shipped with Upstart 0.5 but with the fixed list iteration. |
| 2782 | (0.2.0): Begin documenting changes in the API since then; this file |
| 2783 | can therefore be used as a checklist for updating software. |
| 2784 | |
Scott James Remnant | 74bc023 | 2009-01-26 14:51:41 +0000 | [diff] [blame] | 2785 | * nih-dbus/dbus.c, nih-dbus/dbus.h: Seperate out the code into |
| 2786 | separate files to make maintenance much easier. The new files are |
| 2787 | nih-dbus/dbus_error.c, nih-dbus/dbus_error.h, |
| 2788 | nih-dbus/dbus_connection.c, nih-dbus/dbus_connection.h, |
| 2789 | nih-dbus/dbus_message.c, nih-dbus/dbus_message.h, |
| 2790 | nih-dbus/dbus_object.c, nih-dbus/dbus_object.h, |
| 2791 | nih-dbus/dbus_proxy.c, nih-dbus/dbus_proxy.h, |
| 2792 | nih-dbus/dbus_util.c, nih-dbus/dbus_util.h. |
| 2793 | * nih-dbus/nih_dbus_tool.py (Output.sourceFile): Change include |
| 2794 | to separate ones for error, message, object and proxy. |
| 2795 | (Output.headerFile): Change include to separate ones for message, |
| 2796 | object and proxy. |
| 2797 | * nih-dbus/dbus_message.c (nih_dbus_message_new): New function |
| 2798 | separated out of nih_dbus_object_message(); also no need to cast |
| 2799 | the destructor. |
| 2800 | * nih-dbus/dbus_object.c (nih_dbus_object_message): Clean up to |
| 2801 | call new nih_dbus_message_new function. |
| 2802 | * nih-dbus/libnih-dbus.h: New top-level header to include everything |
| 2803 | * nih-dbus/tests/test_dbus.c: Separate out the tests into files |
| 2804 | to match the sources. The new files are |
| 2805 | nih-dbus/tests/test_dbus_error.c, |
| 2806 | nih-dbus/tests/test_dbus_connection.c, |
| 2807 | nih-dbus/tests/test_dbus_message.c, |
| 2808 | nih-dbus/tests/test_dbus_object.c, |
| 2809 | nih-dbus/tests/test_dbus_proxy.c, |
| 2810 | nih-dbus/tests/test_dbus_util.c. |
| 2811 | * nih-dbus/tests/test_dbus_error.c (test_error_raise_printf): |
| 2812 | Looks like this function was never run in the old test suite, oops. |
| 2813 | * nih-dbus/tests/test_dbus_message.c (test_message_new): Test the |
| 2814 | new function |
| 2815 | * nih-dbus/tests/test_com.netsplit.Nih.Test_object.c: Drop includes |
| 2816 | we don't actually seem to use the library! |
| 2817 | * nih-dbus/tests/test_com.netsplit.Nih.Test_proxy.c: Update includes |
| 2818 | to include proxy |
| 2819 | * nih-dbus/tests/com.netsplit.Nih.Test_impl.c: Replace includes |
| 2820 | with separate ones. |
| 2821 | * nih-dbus/tests/com.netsplit.Nih.Test_impl.h: Drop include. |
| 2822 | * nih-dbus/Makefile.am (include_HEADERS): Install the top-level header |
| 2823 | (nihdbusinclude_HEADERS): Update paths to new headers |
| 2824 | (libnih_dbus_la_SOURCES): Build from new sources |
| 2825 | (TESTS, test_dbus_error_SOURCES, test_dbus_error_CFLAGS) |
| 2826 | (test_dbus_error_LDFLAGS, test_dbus_error_LDADD) |
| 2827 | (test_dbus_connection_SOURCES, test_dbus_connection_CFLAGS) |
| 2828 | (test_dbus_connection_LDFLAGS, test_dbus_connection_LDADD) |
| 2829 | (test_dbus_message_SOURCES, test_dbus_message_CFLAGS) |
| 2830 | (test_dbus_message_LDFLAGS, test_dbus_message_LDADD) |
| 2831 | (test_dbus_object_SOURCES, test_dbus_object_CFLAGS) |
| 2832 | (test_dbus_object_LDFLAGS, test_dbus_object_LDADD) |
| 2833 | (test_dbus_proxy_SOURCES, test_dbus_proxy_CFLAGS) |
| 2834 | (test_dbus_proxy_LDFLAGS, test_dbus_proxy_LDADD) |
| 2835 | (test_dbus_util_SOURCES, test_dbus_util_CFLAGS) |
| 2836 | (test_dbus_util_LDFLAGS, test_dbus_util_LDADD): Add details for |
| 2837 | new tests, replacing old ones |
| 2838 | |
Scott James Remnant | e0ca0b6 | 2009-01-26 13:26:14 +0000 | [diff] [blame] | 2839 | * nih/dbus.c, nih/dbus.h, nih/libnih-dbus.supp, nih/libnih-dbus.ver, |
| 2840 | nih/nih_dbus_tool.py, nih/test_dbus.h, |
| 2841 | nih/tests/com.netsplit.Nih.Test.xml, |
| 2842 | nih/tests/com.netsplit.Nih.Test_impl.c, |
| 2843 | nih/tests/com.netsplit.Nih.Test_impl.h, |
| 2844 | nih/tests/test_com.netsplit.Nih.Test_object.c, |
| 2845 | nih/tests/test_com.netsplit.Nih.Test_proxy.c, |
| 2846 | nih/tests/test_dbus.c: Move all D-Bus related code into a new |
| 2847 | sub-directory |
| 2848 | * nih/Makefile.am: Move D-Bus related rules into |
| 2849 | * nih-dbus/Makefile.am: here. |
| 2850 | * nih-dbus/tests/test_dbus.c: Update include path for D-Bus test |
| 2851 | macros and dbus.h |
| 2852 | * nih-dbus/tests/test_com.netsplit.Nih.Test_object.c: Update include |
| 2853 | path for dbus.h |
| 2854 | * nih-dbus/tests/test_com.netsplit.Nih.Test_proxy.c: Update include |
| 2855 | path for dbus.h |
| 2856 | * nih-dbus/tests/com.netsplit.Nih.Test_impl.c: Update include path |
| 2857 | for dbus.h |
| 2858 | * nih-dbus/tests/com.netsplit.Nih.Test_impl.h: Update include path |
| 2859 | for dbus.h |
| 2860 | * nih-dbus/nih_dbus_tool.py (Output.sourceFile, Output.headerFile): |
| 2861 | Generate includes with correct path for dbus.h |
| 2862 | * Makefile.am (SUBDIRS): Iterate into new sub-directory |
| 2863 | * configure.ac (AC_CONFIG_FILES): Generate new Makefile |
| 2864 | * nihify: Create symlink to nih-dbus as well |
| 2865 | |
Scott James Remnant | 4963721 | 2009-01-26 00:54:36 +0000 | [diff] [blame] | 2866 | * nih/tests/com.netsplit.Nih.Test_impl.c (my_test_async_method): |
| 2867 | Take a reference to the message |
| 2868 | * nih/libnih-dbus.supp: Update D-Bus suppressions. |
| 2869 | |
Scott James Remnant | fe2a23c | 2009-01-26 00:45:27 +0000 | [diff] [blame] | 2870 | * TODO: Update |
| 2871 | |
Scott James Remnant | b5cf7b3 | 2009-01-26 00:43:01 +0000 | [diff] [blame] | 2872 | * nih/libnih.supp: Update suppressions for new calling stack |
| 2873 | |
Scott James Remnant | c8a7764 | 2009-01-26 00:42:43 +0000 | [diff] [blame] | 2874 | * nih/dbus.c (nih_dbus_object_new): Update documentation to match |
| 2875 | new nih_alloc(), no need to cast destructor |
| 2876 | (nih_dbus_proxy_new, nih_dbus_path): Update documentation to match |
| 2877 | new nih_alloc() |
| 2878 | (nih_dbus_object_message): Make the message nih_local, this means |
| 2879 | the handler must now reference the message otherwise it will be |
| 2880 | freed. |
| 2881 | (nih_dbus_object_introspect): Make the xml string nih_local |
| 2882 | (nih_dbus_message_error): Make the string nih_local |
| 2883 | * nih/tests/test_dbus.c (test_error_raise) |
| 2884 | (test_error_raise_printf): Don't check for no parent if we don't |
| 2885 | need to. |
| 2886 | (my_return_error): Must reference the message |
| 2887 | (test_error_raise, test_error_raise_printf): Must mean TEST_ALLOC_FAIL |
| 2888 | |
Scott James Remnant | 04aa925 | 2009-01-26 00:42:38 +0000 | [diff] [blame] | 2889 | * nih/main.c (nih_main_loop_add_func): Update documentation to match |
| 2890 | new nih_alloc(), no need to cast destructor function. |
| 2891 | (nih_main_version): Use nih_local |
| 2892 | (nih_main_write_pidfile): Use nih_local |
| 2893 | * nih/tests/test_main.c: Include limits.h |
| 2894 | |
Scott James Remnant | cf4b615 | 2009-01-26 00:28:11 +0000 | [diff] [blame] | 2895 | * nih/io.c (nih_io_watcher): Can't just break if we catch a free, |
| 2896 | we have to at least process errors first! |
| 2897 | |
Scott James Remnant | 79683ba | 2009-01-26 00:27:59 +0000 | [diff] [blame] | 2898 | * nih/watch.c (nih_watch_new): Update documentation to match new |
| 2899 | nih_alloc(), no need to cast destructor function. |
| 2900 | (nih_watch_add): No need to cast destructor function; free the |
| 2901 | not a directory error as well. |
| 2902 | (nih_watch_handle): Use nih_local on the path so it's always cleaned |
| 2903 | up if we don't reference it; reference it when delaying the create |
| 2904 | handler instead of reparenting |
| 2905 | * nih/tests/test_watch.c: Include limits.h |
| 2906 | (test_new): Free watch inside loop, don't select fds; no idea why |
| 2907 | this code is here. |
| 2908 | (test_reader): Can't just call select then handle, we actually have |
| 2909 | to wait for activity first. |
| 2910 | (my_create_handler, my_modify_handler, my_delete_handler): Loop over |
| 2911 | allocations, we can't use TEST_ALLOC_SAFE if we don't know we're in |
| 2912 | a TEST_ALLOC_FAIL. |
| 2913 | |
Scott James Remnant | 9b769a4 | 2009-01-25 16:42:56 +0000 | [diff] [blame] | 2914 | 2009-01-25 Scott James Remnant <scott@netsplit.com> |
| 2915 | |
Scott James Remnant | aadc6af | 2009-01-25 23:39:42 +0000 | [diff] [blame] | 2916 | * nih/file.c (nih_file_read): Update documentation to match |
| 2917 | new nih_alloc() |
| 2918 | (nih_dir_walk, nih_dir_walk_visit): No need to cast destructor |
| 2919 | function, use nih_local to clean up code a little bit. |
| 2920 | (nih_dir_walk_scan): Use nih_local to make this easier. |
| 2921 | * nih/tests/test_file.c: Include limits.h |
| 2922 | (my_visitor): No need to cast destructor |
| 2923 | |
Scott James Remnant | 679c658 | 2009-01-25 23:34:25 +0000 | [diff] [blame] | 2924 | * nih/test.h: Include config.h since that defines _GNU_SOURCE |
| 2925 | * nih/tests/test_child.c, nih/tests/test_signal.c: Remove extra |
| 2926 | double include. |
| 2927 | |
Scott James Remnant | c90e3d5 | 2009-01-25 23:32:41 +0000 | [diff] [blame] | 2928 | * nih/test_alloc.h (TEST_FREE_TAG): Remove incorrect "extern" |
| 2929 | |
Scott James Remnant | 28231a2 | 2009-01-25 23:32:20 +0000 | [diff] [blame] | 2930 | * nih/alloc.c (nih_unref_only): Add function to allow unreferencing |
| 2931 | without freeing, for example if we return something from our state |
| 2932 | and want to reparent but still allow NULL. |
| 2933 | * nih/alloc.h: Add prototype. |
| 2934 | |
Scott James Remnant | b944d1d | 2009-01-25 23:31:41 +0000 | [diff] [blame] | 2935 | * nih/io.c (nih_io_add_watch, nih_io_message_new, nih_io_reopen): |
| 2936 | Update documentation to match new nih_alloc(), no need to cast |
| 2937 | destructor function. |
| 2938 | (nih_io_buffer_new, nih_io_buffer_pop, nih_io_read, nih_io_get): |
| 2939 | Update documentation to match new nih_alloc() |
| 2940 | (nih_io_read_message): Update documentation to match new nih_alloc(), |
| 2941 | reparent message by referencing to parent before unreferencing from |
| 2942 | io structure. |
| 2943 | * nih/tests/test_io.c (test_read_message, test_send_message): |
| 2944 | Replace TEST_ALLOC_PARENT with NULL parent with TEST_ALLOC_OPRHAN |
| 2945 | (test_read_message): Message must reference the io watch |
| 2946 | (test_message_add_control): Remove strange allocator changing. |
| 2947 | (test_message_recv): Call nih_error_init to avoid valgrind issue |
| 2948 | |
Scott James Remnant | b92c6df | 2009-01-25 23:21:26 +0000 | [diff] [blame] | 2949 | * nih/child.c (nih_child_add_watch): Update documentation to match new |
| 2950 | nih_alloc(), no need to cast destructor function. |
| 2951 | * nih/tests/test_child.c: Include config.h |
| 2952 | |
Scott James Remnant | 7374cb1 | 2009-01-25 23:20:55 +0000 | [diff] [blame] | 2953 | * nih/signal.c (nih_signal_add_handler): Update documentation to |
| 2954 | match new nih_alloc(), no need to cast destructor function. |
| 2955 | * nih/tests/test_signal.c: Include config.h |
| 2956 | |
Scott James Remnant | c82cb4f | 2009-01-25 23:18:09 +0000 | [diff] [blame] | 2957 | * nih/timer.c (nih_timer_add_timeout, nih_timer_add_periodic) |
| 2958 | (nih_timer_add_scheduled): Update documentation to match new |
| 2959 | nih_alloc(), no need to cast destructor function. |
| 2960 | |
Scott James Remnant | ec52af8 | 2009-01-25 23:15:39 +0000 | [diff] [blame] | 2961 | * nih/alloc.c (nih_alloc_parent, nih_alloc_size): Pointer argument |
| 2962 | should be const since we don't modify it. |
| 2963 | * nih/alloc.h: Update prototype. |
| 2964 | |
Scott James Remnant | 5a0fe53 | 2009-01-25 23:15:13 +0000 | [diff] [blame] | 2965 | * nih/error.h: Add documentation for header. |
| 2966 | (NIH_SHOULD): Much needed docstring. |
| 2967 | |
Scott James Remnant | cb97f3b | 2009-01-25 23:10:52 +0000 | [diff] [blame] | 2968 | * nih/logging.c: Include nih/macros.h |
| 2969 | * nih/logging.h: Add documentation for header. |
| 2970 | |
Scott James Remnant | 5f67707 | 2009-01-25 23:00:53 +0000 | [diff] [blame] | 2971 | * nih/config.c (nih_config_next_token, nih_config_next_arg) |
| 2972 | (nih_config_parse_args, nih_config_parse_command) |
| 2973 | (nih_config_parse_block): Update documentation to match new |
| 2974 | nih_alloc() |
| 2975 | (nih_config_parse): Rewrite to use nih_file_read() into an nih_local |
| 2976 | variable, instead of mmap which has strange behaviours in the face |
| 2977 | of updates. |
| 2978 | * nih/config.h: Add documentation header. |
| 2979 | * nih/tests/test_config.c: Include limits.h |
| 2980 | |
Scott James Remnant | b9bd260 | 2009-01-25 22:50:11 +0000 | [diff] [blame] | 2981 | * nih/command.c (nih_command_parser): Update documentation to |
| 2982 | match new nih_alloc(), use nih_local where possible to clean up |
| 2983 | code. |
| 2984 | (nih_command_join): Update documentation to match new nih_alloc() |
| 2985 | (nih_command_handle): Update documentation to match new nih_alloc(), |
| 2986 | use nih_local where possible to clean up code. |
| 2987 | (nih_command_help): Use nih_local for groups array |
| 2988 | (nih_command_group_help): Use nih_local for wrapped string |
| 2989 | * nih/command.h: Add documentation string for header. |
| 2990 | |
Scott James Remnant | 1043ceb | 2009-01-25 21:57:26 +0000 | [diff] [blame] | 2991 | * nih/option.c (nih_option_parser): Update documentation to match |
| 2992 | new nih_alloc(), should not use parent for any old allocation. |
| 2993 | (nih_option_join): Update documentation to match new nih_alloc() |
| 2994 | (nih_option_help): Use nih_local for temporary strings and groups |
| 2995 | (nih_option_group_help): Use nih_local for temporary string. |
| 2996 | * nih/option.h: Add documentation string for header. |
| 2997 | |
Scott James Remnant | 76c1463 | 2009-01-25 20:58:32 +0000 | [diff] [blame] | 2998 | * nih/list.h, nih/hash.h: Provide a much better documentation string. |
| 2999 | |
Scott James Remnant | b59b92e | 2009-01-25 20:47:21 +0000 | [diff] [blame] | 3000 | * nih/tree.c (nih_tree_new, nih_tree_entry_new): Update documentation |
| 3001 | to match new nih_alloc(); no need to cast destructor function |
| 3002 | * nih/tree.h: Add documentation string for the header. |
| 3003 | |
Scott James Remnant | 1e35e10 | 2009-01-25 20:23:53 +0000 | [diff] [blame] | 3004 | * nih/hash.c (nih_hash_new): Update documentation to match |
| 3005 | new nih_alloc(); update comment to reflect what we actually do to |
| 3006 | pick a prime. |
| 3007 | (nih_hash_pointer_key, nih_hash_pointer_hash) |
| 3008 | (nih_hash_pointer_cmp): Drop these, we were looking at the raw bytes |
| 3009 | of a pointer, which is almost certainly naughty. |
| 3010 | * nih/hash.h: Add documentation string, remove prototypes. |
| 3011 | (NIH_HASH_FOREACH, NIH_HASH_FOREACH_SAFE): Update documentation in |
| 3012 | same manner as the list functions. |
| 3013 | (nih_hash_pointer_new): Drop, this is probably illegal C ;-) |
| 3014 | (nih_hash_string_new): Update documentation to match new nih_alloc() |
| 3015 | * nih/tests/test_hash.c (test_pointer_new, test_pointer_key): Drop. |
| 3016 | (test_lookup): Modify to use string hashes instead. |
| 3017 | (test_foreach, test_foreach_safe): Fix function name comment. |
| 3018 | |
Scott James Remnant | 6585f98 | 2009-01-25 20:07:04 +0000 | [diff] [blame] | 3019 | * nih/list.c (nih_list_new, nih_list_entry_new): Update documentation |
| 3020 | to match new nih_alloc(); No need to cast the destructor function |
| 3021 | anymore. |
| 3022 | * nih/list.h: Add documentation string for the header. |
| 3023 | (NIH_LIST_FOREACH, NIH_LIST_FOREACH_SAFE): Improve documentation |
| 3024 | about which is best. |
| 3025 | (NIH_LIST_ITER): Add macro to make iterating a list with an offset |
| 3026 | head easier. |
| 3027 | |
Scott James Remnant | 179b941 | 2009-01-25 19:51:27 +0000 | [diff] [blame] | 3028 | * nih/macros.h: Add sorely-missed documentation strings, including |
| 3029 | one for the header itself. |
| 3030 | (NULL): Drop, NULL is defined by the C compiler. |
| 3031 | |
Scott James Remnant | 624ed15 | 2009-01-25 18:50:59 +0000 | [diff] [blame] | 3032 | * nih/string.c: Update all documentation to match new nih_alloc() |
| 3033 | (nih_str_array_addp): Take a reference to the passed variable |
| 3034 | instead of reparenting (which isn't possible anymore). |
| 3035 | (nih_str_array_add, nih_str_array_addn): Since these just call |
| 3036 | nih_str_array_addp() which now takes a reference rather than |
| 3037 | reparents, we can change these functions to make new_str as a |
| 3038 | local variable. |
| 3039 | (nih_strv_free): Drop this function, it's not used and it's utterly |
| 3040 | inconsistent with the others as it expressly isn't used with |
| 3041 | nih_alloc(). |
Scott James Remnant | da0c200 | 2009-01-25 19:34:29 +0000 | [diff] [blame] | 3042 | (nih_strncat): This function worryingly did not work if NULL was |
| 3043 | passed, catch that and call nih_strndup() instead. |
Scott James Remnant | 624ed15 | 2009-01-25 18:50:59 +0000 | [diff] [blame] | 3044 | * nih/string.h: Add a documentation string and drop prototype. |
| 3045 | * nih/tests/test_string.c (test_strv_free): Drop. |
| 3046 | (test_sprintf, test_vsprintf, test_strdup, test_strndup): Replace |
| 3047 | TEST_ALLOC_PARENT calls with NULL as the second argument with |
| 3048 | TEST_ALLOC_ORPHAN instead. |
| 3049 | (test_strcat, test_strncat, test_strcat_sprintf) |
| 3050 | (test_strcat_vsprintf): Strangely these test cases don't appear to |
| 3051 | have worked before, the functions return NULL in case of memory |
| 3052 | allocation failure so we need to check the string against a temporary |
Scott James Remnant | da0c200 | 2009-01-25 19:34:29 +0000 | [diff] [blame] | 3053 | copy stored before, and we need to free that string as well. |
| 3054 | Also add test cases for NULL being passed in as the source string. |
Scott James Remnant | 624ed15 | 2009-01-25 18:50:59 +0000 | [diff] [blame] | 3055 | |
| 3056 | * nih/test_alloc.h: Expose references to nih_alloc()'s pointers to |
| 3057 | malloc, realloc and free so we can replace them for testing purposes. |
| 3058 | (TEST_ALLOC_SIZE): Since this returns the size of the allocated object, |
| 3059 | rather than the request, check that the block is at least as large |
| 3060 | as the argument given - not exactly as large. |
| 3061 | (TEST_ALLOC_PARENT): Call nih_alloc_parent directly with both |
| 3062 | arguments, since it's compatible with our calling - can't output the |
| 3063 | current parent now they're may be multiple though. When passed NULL |
| 3064 | this now checks if it *has* a parent (almost the exact inverse of the |
| 3065 | previous meaning). |
| 3066 | (TEST_ALLOC_ORPHAN): New test to make sure that an object does not |
| 3067 | have a parent. |
| 3068 | (_test_free_tag): Reimplement to lookup the tag block in a linked |
| 3069 | list, instead of a static array, and only return TRUE or FALSE. |
| 3070 | (_test_destructor): Drop, we can just use nih_list_destroy instead. |
| 3071 | (TEST_FREE_TAG): Reimplement to allocate the tag struct itself as |
| 3072 | the child, and place in a linked list. |
| 3073 | (_test_malloc): Add malloc wrapper. |
| 3074 | (_test_allocator): Rename to _test_realloc |
| 3075 | (TEST_ALLOC_FAIL, TEST_ALLOC_SAFE): Change allocator through the |
| 3076 | exposed variables. |
| 3077 | |
Scott James Remnant | 50ce1c0 | 2009-01-25 17:51:29 +0000 | [diff] [blame] | 3078 | * nih/alloc.h (nih_local): Macro to add a variable attribute that |
| 3079 | calls a nih_discard() as a cleanup function when the variable goes |
| 3080 | out of scope. |
| 3081 | * nih/alloc.c (_nih_discard_local): gcc cleanup function wrapper that |
| 3082 | takes the address of the local variable, it gets the actual pointer |
| 3083 | out and passes it to nih_discard(). Unlike the other functions, |
| 3084 | this actually allows the pointer to be NULL. |
| 3085 | * nih/tests/test_alloc.c (test_local): Test local variables work! |
| 3086 | |
Scott James Remnant | ccfb8c8 | 2009-01-25 17:21:31 +0000 | [diff] [blame] | 3087 | * nih/alloc.c (nih_alloc_has_ref): Rename back to nih_alloc_parent. |
| 3088 | (nih_alloc_parent): Accept NULL, if given returns TRUE if there are |
| 3089 | any parents. |
| 3090 | * nih/alloc.h: Update prototype. |
| 3091 | * nih/tests/test_alloc.c (test_parent): Since it's a bit more |
| 3092 | complex, we should probably explicitly test this ;-) |
| 3093 | |
Scott James Remnant | 72c7a4f | 2009-01-25 16:55:56 +0000 | [diff] [blame] | 3094 | * nih/test.h, nih/test_output.h, nih/test_values.h, nih/test_process.h, |
| 3095 | nih/test_divert.h, nih/test_files.h, nih/test_alloc.h, nih/test_list.h, |
| 3096 | nih/test_hash.h, nih/test_dbus.h: Split the test macros out into |
| 3097 | separate files to make maintaining them easier. None of them may |
| 3098 | be included directly, execept nih/test_dbus.h which is now no longer |
| 3099 | included by default. |
| 3100 | * nih/Makefile.am (nihinclude_HEADERS): Install new headers. |
| 3101 | |
Scott James Remnant | 9b769a4 | 2009-01-25 16:42:56 +0000 | [diff] [blame] | 3102 | * nih/alloc.c: Re-implement as a multi-reference allocator; an object |
| 3103 | may now have as many parents as you wish, each one holding its own |
| 3104 | reference to it. |
| 3105 | (NihAllocCtx): Restructure. |
| 3106 | (NihAllocRef): New object linked by context to hold a reference. |
| 3107 | (nih_alloc_init, nih_alloc_set_allocator, nih_alloc_using): Drop |
| 3108 | support for custom allocators, knowing that we always use malloc |
| 3109 | is useful for the implementation - we still allow the test suite |
| 3110 | to change them, but nothing else. |
| 3111 | (nih_alloc): Reimplement from original nih_alloc_using() function, |
| 3112 | now calls nih_alloc_ref_new() if parent is not NULL. |
| 3113 | (nih_realloc): Reimplement for multi-referenceness; much of the |
| 3114 | this remains the same. |
| 3115 | (nih_free): Reimplement as a wrap around nih_alloc_context_free(). |
| 3116 | (nih_discard): New function to discard an object if it has no |
| 3117 | parent references, used if you believe references may have been |
| 3118 | taken by functions you have called. |
| 3119 | (nih_alloc_context_free): Common function to free an object, calling |
| 3120 | its destructor after discarding parent references but before cleaning |
| 3121 | up children. |
| 3122 | (nih_alloc_reparent): Drop, it's no longer possible to simply reparent |
| 3123 | an object. Instead you should call the new functions: |
| 3124 | (nih_ref, nih_alloc_ref_new, nih_unref, nih_alloc_ref_free): Handle |
| 3125 | NihAllocRef objects, linking them to a context and removing them from |
| 3126 | a context; when the last reference to a child is removed, we |
| 3127 | automatically call nih_alloc_context_free(). |
| 3128 | (nih_alloc_parent, nih_alloc_has_ref): Replace the former function |
| 3129 | with the latter, it's no longer possible to query the exact parent |
| 3130 | since there isn't one. |
| 3131 | (nih_alloc_ref_lookup): Internal function to find a reference. |
| 3132 | (nih_alloc_size): Reimplement assuming malloc, which saves us some |
| 3133 | space in the context structure. |
| 3134 | * nih/alloc.h: Update all prototypes and documentation, including |
| 3135 | adding module documentation to the top of the header file. |
| 3136 | (NihAllocator): Drop typedef. |
| 3137 | (nih_alloc_set_destructor): Add casting macro with name of original |
| 3138 | function that calls nih_alloc_real_set_destructor(). |
| 3139 | * nih/tests/test_alloc.c (test_new, test_alloc): Fix to check for a |
| 3140 | reference rather than the explicit parent; also include a test for |
| 3141 | allocation failure using a malloc hook. |
| 3142 | (test_realloc): Fix to check for a reference rather than the |
| 3143 | explicit parent, change allocatil failure test to use a realloc hook |
| 3144 | instead of a different allocator. |
| 3145 | (test_free): Add a with parent test. |
| 3146 | (test_discard): New test, as test_free() but with different expected |
| 3147 | result for the parent test. |
| 3148 | (test_set_allocator): Drop test. |
| 3149 | (test_reparent, test_ref, test_unref): Drop the former test and |
| 3150 | replace with checking that referencing and unreferencing works. |
| 3151 | |
Scott James Remnant | b791130 | 2008-10-24 17:33:47 +0100 | [diff] [blame] | 3152 | 2008-10-24 Scott James Remnant <scott@netsplit.com> |
| 3153 | |
Scott James Remnant | 55c00c7 | 2008-10-24 19:42:25 +0100 | [diff] [blame] | 3154 | * nih/list.h (NIH_LIST_FOREACH_SAFE): Mark the cursor to be |
| 3155 | automatically cleaned up should we exit the loop; this somewhat |
| 3156 | simplifies the definition and allows returning from within the loop. |
| 3157 | |
Scott James Remnant | e65ec84 | 2008-10-24 18:46:14 +0100 | [diff] [blame] | 3158 | * nih/list.h (NIH_LIST_FOREACH_SAFE): Fix a typo that caused only |
| 3159 | once cursor variable to be used, rather than one per iteration. |
| 3160 | |
Scott James Remnant | 09ba295 | 2008-10-24 17:40:05 +0100 | [diff] [blame] | 3161 | * nih/main.h, nih/main.c, nih/dbus.c, nih/tests/test_dbus.c: Revert |
| 3162 | previous "delete" patch now that we can iterate linked lists |
| 3163 | without tripping over the bug we found here. |
| 3164 | |
Scott James Remnant | 0c632b9 | 2008-10-24 17:34:17 +0100 | [diff] [blame] | 3165 | * nih/libnih-dbus.supp: Update suppressions for newer glibc and |
| 3166 | D-Bus without debugging enabled. |
| 3167 | |
Scott James Remnant | b791130 | 2008-10-24 17:33:47 +0100 | [diff] [blame] | 3168 | * nih/list.h (NIH_LIST_FOREACH_SAFE): Replace with a more ingenious |
| 3169 | version based on work by Casey Dahlin and myself; instead of caching |
| 3170 | the next pointer, place a cursor node in the list instead. This |
| 3171 | solves the issue where the next pointer may be changed or freed, and, |
| 3172 | in fact solves all issues of list rearrangement. |
| 3173 | * nih/tests/test_list.c (test_foreach_safe): Add test cases. |
| 3174 | * nih/hash.h (NIH_HASH_FOREACH_SAFE): Update comment to match. |
| 3175 | |
Scott James Remnant | 07880f7 | 2008-08-12 13:31:08 +0100 | [diff] [blame] | 3176 | 2008-08-12 Casey Dahlin <cdahlin@redhat.com> |
| 3177 | |
| 3178 | * nih/main.h (NihMainLoopFunc): Add delete member. |
| 3179 | * nih/main.c (nih_main_loop): Don't run the callback for any function |
| 3180 | marked for deletion, instead call nih_free on it. |
| 3181 | (nih_main_loop_add_func): Initialise delete to FALSE. |
| 3182 | * nih/dbus.c (nih_dbus_release_callback): Add function to mark a |
| 3183 | loop function as deleted. |
| 3184 | (nih_dbus_setup): and use it as the free function instead of nih_free. |
| 3185 | * nih/tests/test_dbus.c (test_connect, test_bus, test_setup): Check |
| 3186 | that the loop functions are marked for deletion instead of freed. |
| 3187 | |
| 3188 | * nih/nih_dbus_tool.py (Output.sourceFile): Include limits.h |
| 3189 | |
Scott James Remnant | 1e05759 | 2008-07-02 14:42:50 +0100 | [diff] [blame] | 3190 | 2008-07-02 Scott James Remnant <scott@netsplit.com> |
| 3191 | |
| 3192 | * nih/Makefile.am (test_com_netsplit_Nih_Test_object_SOURCES) |
| 3193 | (test_com_netsplit_Nih_Test_proxy_SOURCES): Add forgotten header. |
| 3194 | |
Scott James Remnant | d39409b | 2008-07-01 13:10:49 +0100 | [diff] [blame] | 3195 | 2008-07-01 Scott James Remnant <scott@netsplit.com> |
| 3196 | |
Scott James Remnant | 91c86ac | 2008-07-01 21:12:59 +0100 | [diff] [blame] | 3197 | * TODO: Update. |
| 3198 | |
Scott James Remnant | abd8c86 | 2008-07-01 21:09:59 +0100 | [diff] [blame] | 3199 | * nih/tests/test_com.netsplit.Nih.Test_proxy.c (test_method_dispatch): |
| 3200 | Add test cases for input and output arguments of various types. |
| 3201 | |
Scott James Remnant | 89c149f | 2008-07-01 20:44:56 +0100 | [diff] [blame] | 3202 | * nih/nih_dbus_tool.py (DBusArray.marshal): Add extra parens in |
| 3203 | array setting call for precedence reasons. |
| 3204 | |
Scott James Remnant | bfa76fc | 2008-07-01 17:23:29 +0100 | [diff] [blame] | 3205 | * nih/tests/test_com.netsplit.Nih.Test_proxy.c (test_method_dispatch): |
| 3206 | Add basic tests of calls to synchronous and async methods, and the |
| 3207 | usual error returns. |
| 3208 | * nih/tests/com.netsplit.Nih.Test_impl.c (async_method_reply): |
| 3209 | Add replies that have the wrong combinations of arguments. |
| 3210 | |
Scott James Remnant | 776e370 | 2008-07-01 16:12:49 +0100 | [diff] [blame] | 3211 | * nih/tests/com.netsplit.Nih.Test_impl.c, |
| 3212 | * nih/tests/test_com.netsplit.Nih.Test_object.c (my_connect_handler) |
| 3213 | (my_setup, my_teardown): Move these functions across too. |
| 3214 | * nih/tests/com.netsplit.Nih.Test_impl.h: Add prototypes. |
| 3215 | |
Scott James Remnant | 27e9a4a | 2008-07-01 16:12:00 +0100 | [diff] [blame] | 3216 | * nih/dbus.c (nih_dbus_proxy_new): Allow name to be NULL. |
| 3217 | * nih/tests/test_dbus.c (test_proxy_new): Test without a name. |
| 3218 | |
Scott James Remnant | 0cb8030 | 2008-07-01 14:59:46 +0100 | [diff] [blame] | 3219 | * nih/tests/test_com.netsplit.Nih.Test_object.c, |
| 3220 | * nih/tests/com.netsplit.Nih.Test_impl.c: Separate out the server |
| 3221 | object implementation so that the proxy code could use it. |
| 3222 | * nih/tests/com.netsplit.Nih.Test_impl.h: Header for object definition |
| 3223 | * nih/Makefile.am (test_com_netsplit_Nih_Test_object_SOURCES) |
| 3224 | (test_com_netsplit_Nih_Test_proxy_SOURCES): Include the object |
| 3225 | implementation code. |
| 3226 | |
Scott James Remnant | 9e43ddd | 2008-07-01 13:30:24 +0100 | [diff] [blame] | 3227 | * nih/tests/test_com.netsplit.Nih.Test_proxy.c: Stub file for proxy |
| 3228 | test cases. |
| 3229 | * nih/Makefile.am (TESTS): Build the proxy test suite. |
| 3230 | (test_com_netsplit_Nih_Test_proxy_SOURCES) |
| 3231 | (test_com_netsplit_Nih_Test_proxy_CFLAGS) |
| 3232 | (test_com_netsplit_Nih_Test_proxy_LDFLAGS) |
| 3233 | (test_com_netsplit_Nih_Test_proxy_LDADD): Details for the proxy |
| 3234 | test suite, which actually includes the object code since it needs |
| 3235 | to implement objects too |
| 3236 | |
Scott James Remnant | 9bdeb89 | 2008-07-01 13:22:22 +0100 | [diff] [blame] | 3237 | * nih/nih_dbus_tool.py (MemberWithArgs.variables): Only include arg |
| 3238 | array in object mode. |
| 3239 | |
Scott James Remnant | 82d8dff | 2008-07-01 13:20:00 +0100 | [diff] [blame] | 3240 | * nih/Makefile.am ($(com_netsplit_Nih_Test_object_OUTPUTS)): |
| 3241 | ($(com_netsplit_Nih_Test_proxy_OUTPUTS)): Must be newer than the |
| 3242 | source for the python tool |
| 3243 | |
| 3244 | * nih/nih_dbus_tool.py (Interface.variables, Interface.exports): |
| 3245 | Only include the interface definition in object mode, we will need |
| 3246 | something for proxying signals later, but right now this means |
| 3247 | problems when building an object and its proxy together. |
| 3248 | |
Scott James Remnant | d39409b | 2008-07-01 13:10:49 +0100 | [diff] [blame] | 3249 | * nih/Makefile.am (com_netsplit_Nih_Test_proxy_OUTPUTS) |
| 3250 | (com_netsplit_Nih_Test_proxy_XML) |
| 3251 | ($(com_netsplit_Nih_Test_proxy_OUTPUTS)): Generate sources in proxy |
| 3252 | mode for the test interfaces. |
| 3253 | (BUILT_SOURCES, MAINTAINERCLEANFILES, EXTRA_DIST): Build if necessary |
| 3254 | before anything else, clean in maintainer-clean and include in the |
| 3255 | distribution. |
| 3256 | |
Scott James Remnant | 1c74e24 | 2008-06-30 11:04:29 +0100 | [diff] [blame] | 3257 | 2008-06-30 Scott James Remnant <scott@netsplit.com> |
| 3258 | |
Scott James Remnant | 7a37c25 | 2008-06-30 17:35:46 +0100 | [diff] [blame] | 3259 | * m4/libs.m4 (NIH_LIB_DBUS): Always check for Python, but don't error |
| 3260 | or disable D-Bus unless the install option is defined. Otherwise if |
| 3261 | we don't have it, don't define HAVE_PYTHON. |
| 3262 | * nih/Makefile.am (noinst_SCRIPTS): Only build if we have python. |
| 3263 | |
Scott James Remnant | 9d24d46 | 2008-06-30 16:47:38 +0100 | [diff] [blame] | 3264 | * nih/Makefile.am: Redress the Makefile such that the generated test |
| 3265 | sources are actually included in the distribution tarball. |
| 3266 | |
Scott James Remnant | a3d9bb5 | 2008-06-30 16:01:19 +0100 | [diff] [blame] | 3267 | * nih/dbus.h (NihDDusProxy): Add definition for proxy structure |
| 3268 | and prototype for function to create one. |
| 3269 | * nih/nih_dbus_tool.py (Method.dispatchFunction): Adjust name of |
| 3270 | destination member in the proxy. |
| 3271 | * nih/dbus.c (nih_dbus_proxy_new): Simple function to create a new |
| 3272 | proxy object. |
| 3273 | * nih/tests/test_dbus.c (test_proxy_new): Add simple test for the |
| 3274 | simple function, which will get more complicated if we add signal |
| 3275 | filter registration later. |
| 3276 | |
Scott James Remnant | ad895f4 | 2008-06-30 15:41:38 +0100 | [diff] [blame] | 3277 | * nih/errors.h (NIH_DBUS_INVALID_ARGS): Add error caused when the |
| 3278 | reply arguments on a method call were not what we expected. |
| 3279 | |
Scott James Remnant | 4ad4450 | 2008-06-30 15:40:48 +0100 | [diff] [blame] | 3280 | * nih/nih_dbus_tool.py: Implement the simplest of the method dispatch |
| 3281 | cases, a blocking method call with the reply data returned as arguments |
| 3282 | to the call. |
| 3283 | |
Scott James Remnant | 992bc63 | 2008-06-30 15:11:18 +0100 | [diff] [blame] | 3284 | * nih/nih_dbus_tool.py: Allocate a copy of string arguments when |
| 3285 | passing, this makes them consistent with arrays, and also means that |
| 3286 | we can actually do method dispatching which requires the reply data |
| 3287 | to last longer than the underlying message. |
| 3288 | |
Scott James Remnant | 5e90001 | 2008-06-30 14:14:47 +0100 | [diff] [blame] | 3289 | * nih/nih_dbus_tool.py: Add parent argument to marshal functions for |
| 3290 | when we need to allocate something (ie. arrays) |
| 3291 | |
Scott James Remnant | 5fda6a7 | 2008-06-30 13:54:07 +0100 | [diff] [blame] | 3292 | * nih/nih_dbus_tool.py (DBusArray.marshal): Add extra parens around |
| 3293 | possible deferenced length variable, not needed for precedence but |
| 3294 | helps clarity in generated code. |
| 3295 | (DBusArray.dispatch): Increment the length inside the for loop, rather |
| 3296 | than always leaving it at zero, useful for debugging. |
| 3297 | |
Scott James Remnant | 00445b9 | 2008-06-30 13:41:04 +0100 | [diff] [blame] | 3298 | * nih/nih_dbus_tool.py: Have a bash at sorting out the whole pointer |
| 3299 | and const problem again. Make them properties of a group, passed to |
| 3300 | type functions that can add * and const as appropriate, and allows |
| 3301 | DBusArray to be more clever about things. Works for the existing |
| 3302 | cases, anyway. |
| 3303 | |
Scott James Remnant | 05c3817 | 2008-06-30 12:59:12 +0100 | [diff] [blame] | 3304 | * nih/nih_dbus_tool.py (Method.handlerPrototype): Only include |
| 3305 | function pointers when the mode is object. |
| 3306 | |
Scott James Remnant | 1c74e24 | 2008-06-30 11:04:29 +0100 | [diff] [blame] | 3307 | * nih/nih_dbus_tool.py: Allow mode to be changed to proxy, but don't |
| 3308 | specify anything to be generated for that mode yet. |
| 3309 | |
Scott James Remnant | f5b4859 | 2008-06-11 07:53:20 +0100 | [diff] [blame] | 3310 | 2008-06-11 Scott James Remnant <scott@netsplit.com> |
| 3311 | |
Scott James Remnant | 057307c | 2008-06-11 08:11:04 +0100 | [diff] [blame] | 3312 | * Makefile.am (SUBDIRS): po has to come last to make sure we've |
| 3313 | built any auto-generated code before update-po |
| 3314 | |
Scott James Remnant | 186c534 | 2008-06-11 08:02:58 +0100 | [diff] [blame] | 3315 | * nih/nih_dbus_tool.py (Method.marshalFunction): Allow the message |
| 3316 | for the invalid args/type message to be translated. |
| 3317 | |
Scott James Remnant | 3ae29ad | 2008-06-11 07:59:02 +0100 | [diff] [blame] | 3318 | * nih/tests/test_child.c (test_poll): We end up creating a core file, |
| 3319 | so unlink it. |
| 3320 | |
Scott James Remnant | f5b4859 | 2008-06-11 07:53:20 +0100 | [diff] [blame] | 3321 | * nih/Makefile.am (tests/com.netsplit.Nih.Test_object.c tests/com.netsplit.Nih.Test_object.h): |
| 3322 | Create the tests directory. |
| 3323 | |
Scott James Remnant | b244469 | 2008-06-08 03:02:44 +0100 | [diff] [blame] | 3324 | 2008-06-08 Scott James Remnant <scott@netsplit.com> |
| 3325 | |
Scott James Remnant | f169708 | 2008-06-08 04:23:41 +0100 | [diff] [blame] | 3326 | * nih/Makefile.am (tests/com.netsplit.Nih.Test_object.c tests/com.netsplit.Nih.Test_object.h): |
| 3327 | Make the tests directory in the output. |
| 3328 | |
Scott James Remnant | 079371a | 2008-06-08 04:16:47 +0100 | [diff] [blame] | 3329 | * nih/Makefile.am (EXTRA_DIST): Forgot to distribute the test XML |
| 3330 | |
Scott James Remnant | b244469 | 2008-06-08 03:02:44 +0100 | [diff] [blame] | 3331 | * nih/file.c (nih_file_read): Implement a simpler function for reading |
| 3332 | a file into memory that does literally just that, better than map |
| 3333 | for various reasons. |
| 3334 | * nih/file.h: Add prototype. |
| 3335 | * nih/tests/test_file.c (test_read): Test it works. |
| 3336 | |
Scott James Remnant | 684dce6 | 2008-06-06 03:17:20 +0100 | [diff] [blame] | 3337 | 2008-06-06 Scott James Remnant <scott@netsplit.com> |
| 3338 | |
Scott James Remnant | da540d2 | 2008-06-06 03:53:42 +0100 | [diff] [blame] | 3339 | * nih/test.h (TEST_DBUS, TEST_DBUS_OPEN, TEST_DBUS_MESSAGE) |
| 3340 | (TEST_DBUS_CLOSE, TEST_DBUS_END): Various useful macros to set up, |
| 3341 | connect to, pop messages from, close and kill D-Bus connections to |
| 3342 | a private bus daemon. |
| 3343 | |
Scott James Remnant | 684dce6 | 2008-06-06 03:17:20 +0100 | [diff] [blame] | 3344 | * nih/tests/test_string.c (test_array_copy): Add a test case for a |
| 3345 | zero-length array, which we need to be able to support. |
| 3346 | * nih/string.c (nih_str_array_copy): Fix it by always creating a |
| 3347 | new array to copy into, since array can't be NULL. |
| 3348 | |
Scott James Remnant | b1266cf | 2008-06-04 18:49:30 +0100 | [diff] [blame] | 3349 | 2008-06-04 Scott James Remnant <scott@netsplit.com> |
| 3350 | |
| 3351 | * nih/tests/test_com.netsplit.Nih.Test_object.c (test_method_marshal): |
| 3352 | Why would I be allocating a string array using sizeof (int32_t), |
| 3353 | fix C&P error to make amd64 happy again. |
| 3354 | |
Scott James Remnant | e318088 | 2008-06-02 14:22:08 +0100 | [diff] [blame] | 3355 | 2008-06-02 Scott James Remnant <scott@netsplit.com> |
| 3356 | |
Scott James Remnant | b6c74aa | 2008-06-02 17:48:03 +0100 | [diff] [blame] | 3357 | * nih/test.h (TEST_DBUS): Initialise _test_address to zeros so |
| 3358 | valgrind shuts up. |
| 3359 | |
Scott James Remnant | 03faca5 | 2008-06-02 16:04:46 +0100 | [diff] [blame] | 3360 | * nih/test.h (TEST_DBUS, TEST_DBUS_END): Macros to set up a |
| 3361 | temporary D-Bus session bus for testing purposes. |
| 3362 | |
Scott James Remnant | 9e8c804 | 2008-06-02 14:39:14 +0100 | [diff] [blame] | 3363 | * nih/tests/test_dbus.c (test_object_new, test_object_destroy) |
| 3364 | (test_object_unregister): Use the system bus for testing, since |
| 3365 | there may be no session bus. |
| 3366 | |
Scott James Remnant | e318088 | 2008-06-02 14:22:08 +0100 | [diff] [blame] | 3367 | * nih/tests/test_dbus.c (test_bus): We get an error when the |
| 3368 | session bus is not available, so we should eat that before skipping. |
| 3369 | |
Scott James Remnant | 1f76a5f | 2008-06-01 19:06:25 +0100 | [diff] [blame] | 3370 | 2008-06-01 Scott James Remnant <scott@netsplit.com> |
| 3371 | |
| 3372 | * nih/dbus.c (nih_dbus_object_message): Keep a reference on the |
| 3373 | connection, as well as the message; otherwise if the connection is |
| 3374 | disconnected while handling a async method, we'll end up trying to |
| 3375 | send it to a freed connection instead of just a disconnected and |
| 3376 | forgotten one. |
| 3377 | (nih_dbus_message_destroy): Unreference the connection when freeing |
| 3378 | the message object. |
| 3379 | |
Scott James Remnant | d2e91ba | 2008-05-28 23:03:07 +0100 | [diff] [blame] | 3380 | 2008-05-28 Scott James Remnant <scott@netsplit.com> |
| 3381 | |
Scott James Remnant | bd10669 | 2008-05-28 23:08:41 +0100 | [diff] [blame] | 3382 | * TODO (main, timers): Update. |
| 3383 | |
Scott James Remnant | d2e91ba | 2008-05-28 23:03:07 +0100 | [diff] [blame] | 3384 | * nih/nih_dbus_tool.py: The C type of string-like types should be |
| 3385 | just "char *"; instead we should add "const" when needed, such as |
| 3386 | in the prototype of handlers and in reply functions. This avoids |
| 3387 | some const-bending games. |
| 3388 | * nih/tests/test_com.netsplit.Nih.Test_object.c (my_emit_signal): |
| 3389 | Adjust type of string array to match. |
| 3390 | |
Scott James Remnant | b6cf34d | 2008-05-24 13:08:58 +0200 | [diff] [blame] | 3391 | 2008-05-24 Scott James Remnant <scott@netsplit.com> |
| 3392 | |
| 3393 | * HACKING: Changed branch location again. |
| 3394 | |
Scott James Remnant | ceb8fe9 | 2008-05-18 13:38:29 +0200 | [diff] [blame] | 3395 | 2008-05-18 Scott James Remnant <scott@netsplit.com> |
| 3396 | |
| 3397 | * nih/error.h (nih_return_no_memory_error): Add a convenience macro |
| 3398 | for raising the ENOMEM system error with the right string, rather |
| 3399 | than setting errno just do it directly. |
| 3400 | * nih/tests/test_error.c (test_return_no_memory_error): Make sure |
| 3401 | the macro is tested. |
| 3402 | * nih/dbus.c (nih_dbus_connect, nih_dbus_bus, nih_dbus_server): |
| 3403 | Use new macro to return ENOMEM when we're not sure that it's the |
| 3404 | current errno. |
| 3405 | |
Scott James Remnant | dcfc9a4 | 2008-05-14 01:39:03 +0100 | [diff] [blame] | 3406 | 2008-05-14 Scott James Remnant <scott@netsplit.com> |
| 3407 | |
Scott James Remnant | d4a6a8a | 2008-05-14 19:25:41 +0100 | [diff] [blame] | 3408 | * TODO: Update. |
| 3409 | |
Scott James Remnant | b675b9d | 2008-05-14 14:54:56 +0100 | [diff] [blame] | 3410 | * nih/tests/test_com.netsplit.Nih.Test_object.c (my_str_to_int32_array): |
| 3411 | Forgot to clean up parts after splitting. |
| 3412 | (test_method_marshal): Forgot to free self-allocated arrays, and |
| 3413 | we have to free a string array returned by D-Bus as well. |
| 3414 | (test_signal_dispatch): Another string array to be freed. |
| 3415 | |
Scott James Remnant | 3b7e7dc | 2008-05-14 14:42:59 +0100 | [diff] [blame] | 3416 | * nih/tests/test_dbus.c (test_object_message): Don't use timeouts |
| 3417 | to guess when the reply should have arrived, just use a pending |
| 3418 | call notify function. This speeds the whole thing up a hundred |
| 3419 | fold and removes valgrind slowness issues. |
| 3420 | |
Scott James Remnant | 4eef5cf | 2008-05-14 14:37:47 +0100 | [diff] [blame] | 3421 | * nih/dbus.c (nih_dbus_message_error): Asynchronous messages need |
| 3422 | a way to return an error message to the sender after the handler |
| 3423 | function has terminated; this function fulfills that need |
| 3424 | * nih/dbus.h: Add prototype. |
| 3425 | * nih/tests/test_dbus.c (test_message_error): Add test case for |
| 3426 | replying to an asynchronous message with an error; this ends up |
| 3427 | somewhat evil since we're not using the bindings. |
| 3428 | |
Scott James Remnant | 10c81f2 | 2008-05-14 13:36:47 +0100 | [diff] [blame] | 3429 | * nih/nih_dbus_tool.py: Use a namespaced attribute to specify |
| 3430 | whether methods should be generated synchronous (reply generated |
| 3431 | after handler returns) or asynchronous (handler expected to keep |
| 3432 | the message object and call a reply function later). |
| 3433 | * nih/tests/com.netsplit.Nih.Test.xml: Add a test asynchronous |
| 3434 | method, the same basic method as the ordinary test method, but |
| 3435 | which is specified to generate an asynchronous call. |
| 3436 | * nih/tests/test_com.netsplit.Nih.Test_object.c: Add many tests |
| 3437 | for async calls, in fact, we pretty much just duplicate the sync |
| 3438 | tests but use a timer in the server to deliver the reply. |
| 3439 | |
Scott James Remnant | dcfc9a4 | 2008-05-14 01:39:03 +0100 | [diff] [blame] | 3440 | * nih/dbus.c (nih_dbus_object_message): Set a destructor for the |
| 3441 | message that unreferences the attached D-Bus message when it |
| 3442 | is freed, and don't unreference it ourselves. Also allow the |
| 3443 | handler to return "not yet handled" to mean that the method |
| 3444 | has actually been handled, but the reply hasn't been sent yet. |
| 3445 | (nih_dbus_message_destroy): Destructor for the message. |
| 3446 | |
Scott James Remnant | 05648ff | 2008-05-11 12:18:10 +0100 | [diff] [blame] | 3447 | 2008-05-11 Scott James Remnant <scott@netsplit.com> |
| 3448 | |
| 3449 | * nih/nih_dbus_tool.py: Implement handling for arrays of simple C |
| 3450 | types with an extra length variable, and handling for arrays of |
| 3451 | pointer types with an extra NULL element |
| 3452 | * nih/tests/com.netsplit.Nih.Test.xml: Add test methods with an |
| 3453 | int32 and string array as input and output, and test signals |
| 3454 | with both array types. |
| 3455 | * nih/tests/test_com.netsplit.Nih.Test_object.c: Add tests for |
| 3456 | the new methods and signals, testing the underlying automatic |
| 3457 | generation. |
| 3458 | |
Scott James Remnant | 2e4dbdb | 2008-05-10 15:00:51 +0100 | [diff] [blame] | 3459 | 2008-05-10 Scott James Remnant <scott@netsplit.com> |
| 3460 | |
Scott James Remnant | f0b8b7b | 2008-05-10 15:08:44 +0100 | [diff] [blame] | 3461 | * nih/string.c (nih_strncat, nih_strcat_vsprintf): Ok, there |
| 3462 | was a minor technical reason after all; don't strlen the |
| 3463 | string if we don't have it. |
| 3464 | |
Scott James Remnant | 2e4dbdb | 2008-05-10 15:00:51 +0100 | [diff] [blame] | 3465 | * nih/string.c (nih_strcat, nih_strncat, nih_strcat_sprintf) |
| 3466 | (nih_strcat_vsprintf): Remove the restriction that the string |
| 3467 | must be pre-allocated, there's no technical reason for it, I was |
| 3468 | just trying to enforce a style. |
| 3469 | |
Scott James Remnant | 9e77592 | 2008-05-09 02:18:54 +0100 | [diff] [blame] | 3470 | 2008-05-09 Scott James Remnant <scott@netsplit.com> |
| 3471 | |
Scott James Remnant | 76610cf | 2008-05-09 02:20:19 +0100 | [diff] [blame] | 3472 | * nih/nih_dbus_tool.py: Drop the data type argument, and just |
| 3473 | pass around void *; we never have the types available, and since |
| 3474 | we have our own prototype anyway, we never upset gcc. |
| 3475 | |
Scott James Remnant | 9e77592 | 2008-05-09 02:18:54 +0100 | [diff] [blame] | 3476 | * nih/dbus.c (nih_dbus_path): Empty path components are named |
| 3477 | as "_" instead. |
| 3478 | * nih/tests/test_dbus.c (test_path): Test the new functionality. |
| 3479 | |
Scott James Remnant | 89a3ea8 | 2008-05-08 23:55:54 +0100 | [diff] [blame] | 3480 | 2008-05-08 Casey Dahlin <cdahlin@redhat.com> |
| 3481 | |
| 3482 | * nih/file.c (nih_file_is_packaging): Add matches for various |
| 3483 | RPM temporary and atomicity files. |
| 3484 | |
Scott James Remnant | 4819655 | 2008-05-08 23:25:44 +0100 | [diff] [blame] | 3485 | 2008-05-08 Scott James Remnant <scott@netsplit.com> |
| 3486 | |
Scott James Remnant | 844fa17 | 2008-05-08 23:48:59 +0100 | [diff] [blame] | 3487 | * nih/dbus.c (nih_dbus_error_raise_printf): Add formatted error |
| 3488 | function, I held out as long as I could |
| 3489 | * nih/dbus.h: Add prototype. |
| 3490 | * nih/tests/test_dbus.c (test_error_raise_printf): And test for it. |
| 3491 | * nih/error.h: Add missing attribute |
| 3492 | |
Scott James Remnant | 4819655 | 2008-05-08 23:25:44 +0100 | [diff] [blame] | 3493 | * nih/Makefile.am: No need for version info if not installing |
| 3494 | |
Scott James Remnant | fba3aa3 | 2008-05-06 22:26:34 +0100 | [diff] [blame] | 3495 | 2008-05-06 Scott James Remnant <scott@netsplit.com> |
| 3496 | |
Scott James Remnant | c06b2a0 | 2008-05-06 23:34:48 +0100 | [diff] [blame] | 3497 | * m4/compiler.m4: -Wformat is already in -Wall |
| 3498 | |
Scott James Remnant | d775f5c | 2008-05-06 23:03:24 +0100 | [diff] [blame] | 3499 | * nih/main.c (nih_main_daemonise): Deliberately ignore chdir |
| 3500 | return value, repeat the dup calls until they work. |
| 3501 | (nih_main_loop_interrupt): repeat write call until it succeeds. |
| 3502 | * nih/test.h (TEST_CHILD, TEST_CHILD_WAIT, TEST_CHILD_RELEASE): |
| 3503 | assert that pipe() returns zero and read() and write() both return 1. |
| 3504 | (TEST_DIVERT_STDOUT_FD, TEST_DIVERT_STDERR_FD): assert that dup2 |
| 3505 | returns a file descriptor. |
| 3506 | (TEST_FILE_RESET): assert ftruncate works. |
| 3507 | * nih/tests/test_io.c (test_add_watch, test_select_fds) |
| 3508 | (test_handle_fds, test_reopen, test_shutdown, test_destroy) |
| 3509 | (test_watcher, test_read_message, test_send_message, test_read) |
| 3510 | (test_write, test_get, test_printf, test_set_nonblock) |
| 3511 | (test_set_cloexec): assert that the pipe() calls work. |
| 3512 | (test_watcher): assert that write() returns expected number. |
| 3513 | * nih/tests/test_file.c (test_map): Check the fgets works. |
| 3514 | (test_dir_walk): assert that the symlink call works. |
| 3515 | * nih/tests/test_main.c (test_daemonise): assert pipe(), write() |
| 3516 | and getcwd() calls work. |
| 3517 | * nih/tests/test_com.netsplit.Nih.Test_object.c (my_setup): |
| 3518 | initialise wait_fd to get around gcc's blindness. |
| 3519 | (my_emit_signal): initialise ret. |
| 3520 | |
Scott James Remnant | fba3aa3 | 2008-05-06 22:26:34 +0100 | [diff] [blame] | 3521 | * m4/compiler.m4: Add -Wformat, -Wformat-security and |
| 3522 | -D_FORTIFY_SOURCE=2 to our default CFLAGS unless compiler warnings |
| 3523 | are disabled. |
| 3524 | |
Scott James Remnant | ad79186 | 2008-04-29 17:55:53 +0100 | [diff] [blame] | 3525 | 2008-04-29 Scott James Remnant <scott@netsplit.com> |
| 3526 | |
Scott James Remnant | 52aa887 | 2008-04-29 18:19:28 +0100 | [diff] [blame] | 3527 | * nih/tests/test_com.netsplit.Nih.Test_object.c (test_method_marshal) |
| 3528 | (test_signal_dispatch): For some reason valgrind needs some |
| 3529 | reassurance that it's ok to pass uninitialised data around in various |
| 3530 | cases; probably good for testing anyway. |
| 3531 | |
Scott James Remnant | f32b5bb | 2008-04-29 17:57:02 +0100 | [diff] [blame] | 3532 | * nih/dbus.c (nih_dbus_path): Function to generate D-Bus paths with |
| 3533 | appropriate escaping of non-root elements. |
| 3534 | * nih/dbus.h: Add prototype. |
| 3535 | * nih/tests/test_dbus.c (test_path): Test the new function. |
| 3536 | |
Scott James Remnant | ad79186 | 2008-04-29 17:55:53 +0100 | [diff] [blame] | 3537 | * nih/dbus.c (nih_dbus_object_introspect): Free the introspection |
| 3538 | string after sending the message (oops!) |
| 3539 | |
Scott James Remnant | c834f5b | 2008-04-27 12:37:55 +0100 | [diff] [blame] | 3540 | 2008-04-27 Scott James Remnant <scott@netsplit.com> |
| 3541 | |
| 3542 | * nih/tests/com.netsplit.Nih.Test.xml: Add signals to the test |
| 3543 | interface for the variety of basic argument types, we also need |
| 3544 | a glue function to make the server emit the signal. |
| 3545 | * nih/tests/test_com.netsplit.Nih.Test_object.c (my_emit_signal) |
| 3546 | (test_signal_dispatch): Test the signals are emitted and dispatched |
| 3547 | properly by catching them and checking them. |
| 3548 | |
Scott James Remnant | 182706d | 2008-04-26 14:23:49 +0100 | [diff] [blame] | 3549 | 2008-04-26 Scott James Remnant <scott@netsplit.com> |
| 3550 | |
Scott James Remnant | 5204ec8 | 2008-04-26 14:47:21 +0100 | [diff] [blame] | 3551 | * nih/test.h (TEST_GROUP): Add macro for when we don't test functions. |
| 3552 | * nih/tests/test_com.netsplit.Nih.Test_object.c (test_method_marshal): |
| 3553 | Use TEST_GROUP here. |
| 3554 | |
Scott James Remnant | 182706d | 2008-04-26 14:23:49 +0100 | [diff] [blame] | 3555 | * nih/tests/com.netsplit.Nih.Test.xml: Add more methods to test, |
| 3556 | one generic method and two methods (in and out) for each basic type. |
| 3557 | * nih/tests/test_com.netsplit.Nih.Test_object.c: Slightly redo the |
| 3558 | way we do the tests, do the basic set of tests using a single method |
| 3559 | that can return cases such as errors, etc. Then have input and output |
| 3560 | marshal tests for each of the basic types. |
| 3561 | * nih/nih_dbus_tool.py (NAME_RE): Cope with numerics in member names, |
| 3562 | treat them the same as lowerspace characters. |
| 3563 | |
Scott James Remnant | 9edcb1b | 2008-04-25 00:48:59 +0100 | [diff] [blame] | 3564 | 2008-04-25 Scott James Remnant <scott@netsplit.com> |
| 3565 | |
Scott James Remnant | af32338 | 2008-04-25 01:12:33 +0100 | [diff] [blame] | 3566 | * TODO: Update, adding missing pieces for D-Bus support and an |
| 3567 | idea for changing the way that timers/signals/io/etc. work. |
| 3568 | |
| 3569 | * nih_dbus_tool.py: Handle the basic D-Bus types and generate |
| 3570 | marshalling functions for methods and dispatch functions for |
| 3571 | signals, along with all of the glue needed for nih_dbus_object_new() |
| 3572 | * nih/tests/com.netsplit.Nih.Test.xml: Interface to be used for |
| 3573 | testing of the generated code. |
| 3574 | * nih/tests/test_com.netsplit.Nih.Test_object.c: Test suite for |
| 3575 | the generated code (in object mode), so far this just tests a |
| 3576 | couple of methods but will be adding a lot more tests soon. |
| 3577 | * nih/Makefile.am (TESTS): Add the above test suite. |
| 3578 | (test_com_netsplit_Nih_Test_object_SOURCES) |
| 3579 | (test_com_netsplit_Nih_Test_object_CFLAGS) |
| 3580 | (test_com_netsplit_Nih_Test_object_LDFLAGS) |
| 3581 | (test_com_netsplit_Nih_Test_object_LDADD): Details for the test suite. |
| 3582 | (BUILT_SOURCES): Interface definitions are auto-generated and need |
| 3583 | to be done so at the start of the build so deps work properly. |
| 3584 | (CLEANFILES): All built sources need to be cleaned on "make clean" |
| 3585 | (tests/com.netsplit.Nih.Test_object.c tests/com.netsplit.Nih.Test_object.h): |
| 3586 | Generate the interface definitions with the binding tool, being |
| 3587 | sure to regenerate if the XML or binding tool change. |
| 3588 | |
Scott James Remnant | 9edcb1b | 2008-04-25 00:48:59 +0100 | [diff] [blame] | 3589 | * nih/dbus.c (nih_dbus_object_new): Register an object with D-Bus |
| 3590 | and hook it up to an internal message handling function that deals |
| 3591 | with introspection and the like, while passing off actual handling |
| 3592 | to marshaller functions for individual methods. |
| 3593 | (nih_dbus_object_destroy): When the object is freed, unregister |
| 3594 | it from the bus making sure that doing so doesn't try to free it |
| 3595 | a second time. |
| 3596 | (nih_dbus_object_unregister): When the bus connection is dropped |
| 3597 | or object otherwise unregistered, free it, making sure that doing |
| 3598 | so doesn't try to unregister it a second time. |
| 3599 | (nih_dbus_object_message): Handle messages for the object, locate |
| 3600 | the marshaller function in the interface structures or pass off |
| 3601 | to internal handler for introspection. |
| 3602 | (nih_dbus_object_introspect): Handle the Introspect method by |
| 3603 | generating XML which we return in a reply. |
| 3604 | * nih/dbus.h: Add prototype for new function. |
| 3605 | (NihDBusObject, NihDBusMessage, NihDBusMarshaller, NihDBusArgDir) |
| 3606 | (NihDBusArg, NihDBusMethod, NihDBusSignal, NihDBusAccess) |
| 3607 | (NihDBusProperty, NihDBusInterface): Add the truly insane number |
| 3608 | of structures and enums we need to fully specify the interfaces |
| 3609 | that a D-Bus object provides; you'll never do this by hand! :-) |
| 3610 | * nih/tests/test_dbus.c (test_object_new, test_object_destroy) |
| 3611 | (test_object_unregister, test_object_message): Test cases for new |
| 3612 | functions. |
| 3613 | (test_connect, test_bus): Check error messages using the macros |
| 3614 | rather than by name. |
| 3615 | |
Scott James Remnant | 52e09c9 | 2008-04-23 17:03:14 +0100 | [diff] [blame] | 3616 | 2008-04-23 Scott James Remnant <scott@netsplit.com> |
| 3617 | |
| 3618 | * nih/tests/test_nih_dbus_tool.py: In hindsight, it's unnecessary |
| 3619 | to test the binding tool directly since the tests will basically |
| 3620 | just compare the output to an expected C file which will make |
| 3621 | maintaining it damned hard and doesn't actually guarantee it works; |
| 3622 | instead we'll test generated output. |
| 3623 | * nih/Makefile.am (TESTS): Remove the call to the Python test suite, |
| 3624 | and reverse the TESTS/check_PROGRAMS thing again to match. |
| 3625 | |
Scott James Remnant | d1a827b | 2008-04-22 08:04:32 +0100 | [diff] [blame] | 3626 | 2008-04-22 Scott James Remnant <scott@netsplit.com> |
| 3627 | |
Scott James Remnant | f4e010f | 2008-04-22 08:08:48 +0100 | [diff] [blame] | 3628 | * nih/libnih-dbus.supp: D-Bus init_system_db() related leaks |
| 3629 | were likely a missing dbus_shutdown() since they've gone away |
| 3630 | now. |
| 3631 | |
Scott James Remnant | d1a827b | 2008-04-22 08:04:32 +0100 | [diff] [blame] | 3632 | * nih/dbus.c (nih_dbus_add_timeout, nih_dbus_timeout_toggled): |
| 3633 | Slightly adjust the millisecond to second conversion to always |
| 3634 | round up to the nearest whole second rather than down; that way |
| 3635 | we have a 1s minimum timeout instead of an immediate one. |
| 3636 | |
Scott James Remnant | 4bc8f8d | 2008-04-21 19:35:28 +0100 | [diff] [blame] | 3637 | 2008-04-21 Scott James Remnant <scott@netsplit.com> |
| 3638 | |
Scott James Remnant | 4c0774d | 2008-04-21 23:11:53 +0100 | [diff] [blame] | 3639 | * nih/tests/test_dbus.c (test_bus): Cope when the session bus |
| 3640 | is not available. |
| 3641 | |
Scott James Remnant | 4b0b0dc | 2008-04-21 23:07:24 +0100 | [diff] [blame] | 3642 | * nih/libnih-dbus.supp: Suppress annoying NSS problems on i686 |
| 3643 | as well (we did x86-64 last time). Also found that a couple of |
| 3644 | the suppressions were caused by failing to shutdown properly, |
| 3645 | so remove those (and uncover a D-Bus bug or two in the process). |
| 3646 | |
Scott James Remnant | d9f498f | 2008-04-21 19:36:42 +0100 | [diff] [blame] | 3647 | * nih/tests/test_dbus.c: Remove unnecessary SIGPIPE setting. |
| 3648 | |
Scott James Remnant | 1f510e4 | 2008-04-21 19:36:00 +0100 | [diff] [blame] | 3649 | * nih/libnih-dbus.supp: I keep finding ways in which D-Bus holds |
| 3650 | on to data, not to mention annoying NSS problems. |
| 3651 | |
Scott James Remnant | 4bc8f8d | 2008-04-21 19:35:28 +0100 | [diff] [blame] | 3652 | * nih/libnih.supp: Add long-missing suppression for the main loop |
| 3653 | functions list, seems we've never actually tested that without |
| 3654 | freeing it manually. |
| 3655 | |
Scott James Remnant | 18f2f5b | 2008-04-18 01:43:15 +0100 | [diff] [blame] | 3656 | 2008-04-18 Scott James Remnant <scott@netsplit.com> |
| 3657 | |
Scott James Remnant | ec13eb4 | 2008-04-18 02:01:52 +0100 | [diff] [blame] | 3658 | * nih/dbus.c (nih_dbus_connect, nih_dbus_bus): Functions to connect |
| 3659 | to an abitrary address or a well-known bus, calling our own handler |
| 3660 | on disconnect instead of exit() and setting things up in the main |
| 3661 | loop properly. |
| 3662 | (nih_dbus_setup): Function called by the above, and callable |
| 3663 | externally, to set up the disconnect handler and main loop hook-ups; |
| 3664 | deals with shared connections by checking the main loop slot. |
| 3665 | (nih_dbus_server): Similar function to create a listening server |
| 3666 | and hook it up to the main loop. |
| 3667 | (nih_dbus_add_watch, nih_dbus_remove_watch) |
| 3668 | (nih_dbus_watch_toggled, nih_dbus_watcher): Glue functions so that |
| 3669 | D-Bus can watch file descriptors using our main loop. |
| 3670 | (nih_dbus_add_timeout, nih_dbus_remove_timeout) |
| 3671 | (nih_dbus_timeout_toggled, nih_dbus_timer): Glue functions so that |
| 3672 | D-Bus can set timeouts using our main loop. |
| 3673 | (nih_dbus_wakeup_main): Glue function so that D-Bus can interrupt |
| 3674 | the main loop (I think this is really for multi-threaded apps, but |
| 3675 | it does no harm to force an iteration). |
| 3676 | (nih_dbus_callback): Glue function to dispatch D-Bus messages |
| 3677 | within the main loop. |
| 3678 | (nih_dbus_connection_disconnected): Filter function to catch the |
| 3679 | org.freedesktop.DBus.Local.Disconnected signal and call any |
| 3680 | disconnect handler before unreferencing the connection. |
| 3681 | (nih_dbus_new_connection): Handle new server connections by calling |
| 3682 | the connect handler if set, referencing the new connection then |
| 3683 | setting it up in the main loop. |
| 3684 | * nih/dbus.h (NihDBusDisconnectHandler, NihDBusConnectHandler): |
| 3685 | Function prototype typedefs for disconnect and connect handlers. |
| 3686 | * nih/tests/test_dbus.c (test_connect, test_bus, test_setup) |
| 3687 | (test_server): Test the new functions as best we can. |
| 3688 | * nih/libnih-dbus.supp: D-Bus slot allocator doesn't free memory. |
| 3689 | |
Scott James Remnant | 18f2f5b | 2008-04-18 01:43:15 +0100 | [diff] [blame] | 3690 | * nih/main.c (nih_main_loop_init): Make a non-static function. |
| 3691 | * nih/main.h: Add prototype. |
| 3692 | |
Scott James Remnant | 2ebd989 | 2008-04-16 14:30:30 +0100 | [diff] [blame] | 3693 | 2008-04-16 Scott James Remnant <scott@netsplit.com> |
| 3694 | |
| 3695 | * nih/test.h (TEST_FILE_NE, TEST_FILE_NE_N): Fix logic of tests. |
| 3696 | |
Scott James Remnant | 29564d0 | 2008-04-12 13:56:35 +0100 | [diff] [blame] | 3697 | 2008-04-12 Scott James Remnant <scott@netsplit.com> |
| 3698 | |
Scott James Remnant | 2d97364 | 2008-04-12 14:08:05 +0100 | [diff] [blame] | 3699 | * nih/Makefile.am: If we're not installing the library then we |
| 3700 | want to still make the script but don't want to install it. |
| 3701 | |
Scott James Remnant | d121362 | 2008-04-12 14:03:17 +0100 | [diff] [blame] | 3702 | * nih/nih_dbus_tool.py: Skeleton code for the Python binding tool. |
| 3703 | * nih/tests/test_nih_dbus_tool.py: Test cases for the dbus tool. |
| 3704 | * nih/Makefile.am (TESTS): When building the dbus library, also run |
| 3705 | the Python test suite for the Python binding tool; this requires |
| 3706 | reversing the check_PROGRAMS/TESTS setting since it needs to only |
| 3707 | be in TESTS. |
| 3708 | |
Scott James Remnant | cf57ade | 2008-04-12 13:56:49 +0100 | [diff] [blame] | 3709 | * nih/libnih-dbus.supp, nih/libnih-dbus.ver: Library support files. |
| 3710 | |
Scott James Remnant | 29564d0 | 2008-04-12 13:56:35 +0100 | [diff] [blame] | 3711 | * nih/dbus.c (nih_dbus_error_raise): Begin the D-Bus library with |
| 3712 | a function to raise an NihError that can be converted into a |
| 3713 | DBusError when necessary (to be used in function returns). |
| 3714 | * nih/dbus.h (NihDBusError): Type for the structure since we need |
| 3715 | to include a name member. |
| 3716 | * nih/tests/test_dbus.c (test_error_raise): Test case. |
| 3717 | * nih/errors.h: Add NIH_DBUS_ERROR error; no string for this since |
| 3718 | each individual error will have its own. |
| 3719 | |
Scott James Remnant | 4835386 | 2008-04-11 10:39:45 +0100 | [diff] [blame] | 3720 | 2008-04-11 Scott James Remnant <scott@netsplit.com> |
| 3721 | |
| 3722 | * m4/misc.m4: Reverse the sense of the noinstall option, so that |
| 3723 | "install" needs to be present for libnih to be installed. |
| 3724 | * configure.ac: Install libnih when built from its own source. |
| 3725 | |
Scott James Remnant | 9ca5065 | 2008-03-29 17:16:04 +0000 | [diff] [blame] | 3726 | 2008-03-29 Scott James Remnant <scott@netsplit.com> |
| 3727 | |
Scott James Remnant | 1029b93 | 2008-03-29 17:43:33 +0000 | [diff] [blame] | 3728 | * nih/Makefile.am (libraries): Build optional libnih-dbus.la |
| 3729 | (libnih_dbus_la_SOURCES, libnih_dbus_la_CFLAGS) |
| 3730 | (libnih_dbus_la_LIBS, -version-info 0, libnih_dbus_la_LDFLAGS): |
| 3731 | Details for optional library. |
| 3732 | (EXTRA_DIST): Distribute the version script and suppressions files. |
| 3733 | (nihinclude_HEADERS): Install the optional libdbus header |
| 3734 | (bin_SCRIPTS): Build optional nih-dbus-tool binding tool script |
| 3735 | (CLEANFILES, EXTRA_DIST, do_subst, nih-dbus-tool): Create installed |
| 3736 | script by substituting in another, be sure to distribute the other |
| 3737 | and clean the intermediate file. |
| 3738 | (TESTS): Optional test suite |
| 3739 | (test_dbus_SOURCES, test_dbus_CFLAGS, test_dbus_LDFLAGS) |
| 3740 | (test_dbus_LDADD): Details for the optional dbus test suite. |
| 3741 | * m4/misc.m4 (AC_COPYRIGHT): Also add a Makefile PACKAGE_COPYRIGHT |
| 3742 | variable for substitution. |
| 3743 | (NIH_INIT): We have separate cflags for dbus-related tools, so we |
| 3744 | need to check that gcc supports -c and -o. |
| 3745 | |
Scott James Remnant | cdfdca6 | 2008-03-29 17:31:54 +0000 | [diff] [blame] | 3746 | * m4/libs.m4 (NIH_LIB_DBUS): Macro to detet whether pkg-config, |
| 3747 | D-Bus and Python are available and decide based on that whether or |
| 3748 | not we can build an optional D-Bus binding library; configure options |
| 3749 | and arguments determine whether being unable to is a warning or an |
| 3750 | error. |
| 3751 | * m4/misc.m4: Add the dbus option to the help and the call to check |
| 3752 | for the libraries. |
| 3753 | * README: Add a section on the dependencies this introduces. |
| 3754 | |
Scott James Remnant | 9ca5065 | 2008-03-29 17:16:04 +0000 | [diff] [blame] | 3755 | * m4/libs.m4: Add an empty file to hold macros relating to library |
| 3756 | detection. |
| 3757 | * m4/Makefile.am (dist_aclocal_DATA): Install and distribute the |
| 3758 | new macro file. |
| 3759 | * nihify: Symlink the new macro file across as well. |
| 3760 | |
Scott James Remnant | 6a8a222 | 2008-03-19 08:39:08 +0000 | [diff] [blame] | 3761 | 2008-03-19 Scott James Remnant <scott@netsplit.com> |
| 3762 | |
| 3763 | * nih/hash.c (nih_hash_pointer_hash): Fix hash generation on 64-bit |
| 3764 | systems by using each byte rather than trying to be clever. |
| 3765 | |
Scott James Remnant | 777e21d | 2008-03-14 16:35:04 +0000 | [diff] [blame] | 3766 | 2008-03-14 Scott James Remnant <scott@netsplit.com> |
| 3767 | |
Scott James Remnant | 1add734 | 2008-03-14 16:56:44 +0000 | [diff] [blame] | 3768 | * nih/hash.c (nih_hash_new): Also require hash and cmp functions |
| 3769 | and store in the structure. |
| 3770 | (nih_hash_add, nih_hash_add_unique, nih_hash_add_replace) |
| 3771 | (nih_hash_search, nih_hash_lookup): Change key type to void, |
| 3772 | use hash and cmp functions from the structure. |
| 3773 | (fnv_hash): Rename to nih_hash_string_key |
| 3774 | (nih_hash_string_cmp): String comparison function. |
| 3775 | (nih_hash_pointer_key, nih_hash_pointer_hash, nih_hash_pointer_cmp): |
| 3776 | Pointer hash functions. |
| 3777 | * nih/hash.h (NihHashFunction): Prototype for hash function. |
| 3778 | (NihCmpFunction): Prototype for key comparison function. |
| 3779 | (NihHash): Add hash_function and cmp_function members. |
| 3780 | (nih_hash_pointer_new, nih_hash_string_new): Macros to wrap function |
| 3781 | and pass in common key, hash and cmp functions. |
| 3782 | * nih/tests/test_hash.c: Update tests to include new functions and |
| 3783 | macros. |
| 3784 | * nih/watch.c: Use nih_hash_string_new() to create the hash table. |
| 3785 | |
Scott James Remnant | fef07ca | 2008-03-14 16:50:37 +0000 | [diff] [blame] | 3786 | * nih/command.c: Add const to local structures. |
| 3787 | (nih_command_join): Expect to not change the structures passed |
| 3788 | (nih_command_handle): Iterate structure as const. |
| 3789 | * nih/command.h: Add const to prototype. |
| 3790 | * nih/option.c: Add const to local structures. |
| 3791 | (nih_option_join): Expect to not change the structures passed |
| 3792 | * nih/option.h: Add const to prototype. |
| 3793 | |
Scott James Remnant | 341b5ec | 2008-03-14 16:46:38 +0000 | [diff] [blame] | 3794 | * nih/error.c (nih_error_init): Make extern for consistency. |
| 3795 | * nih/error.h: Add prototype. |
| 3796 | * nih/logging.c (nih_log_init): Make extern for consistency. |
| 3797 | * nih/logging.h: Add prototype. |
| 3798 | |
Scott James Remnant | 21e18a0 | 2008-03-14 16:45:26 +0000 | [diff] [blame] | 3799 | * nih/child.c (child_watches): Rename to nih_child_watches and |
| 3800 | make extern. |
| 3801 | (nih_child_init): Make extern, update name of global. |
| 3802 | (nih_child_add_watch, nih_child_poll): Update name of global. |
| 3803 | * nih/child.h: Add prototypes. |
| 3804 | * nih/io.c (io_watches): Rename to nih_io_watches and make extern. |
| 3805 | (nih_io_init): Make extern, update name of global. |
| 3806 | (nih_io_add_watch, nih_io_select_fds, nih_io_handle_fds): Update |
| 3807 | name of global. |
| 3808 | * nih/io.h: Add prototypes. |
| 3809 | * nih/main.c (loop_functions): Rename to nih_main_loop_functions |
| 3810 | and make extern. |
| 3811 | (nih_main_loop_init, nih_main_loop, nih_main_loop_add_func): Update |
| 3812 | name of global. |
| 3813 | * nih/main.h: Add prototype. |
| 3814 | * nih/signal.c (signals): Rename to nih_signals and make extern. |
| 3815 | (nih_signal_init): Make extern, update name of global. |
| 3816 | (nih_signal_add_handler, nih_signal_poll): Update name of global. |
| 3817 | * nih/signal.h: Add prototypes. |
| 3818 | * nih/timer.c (timers): Rename to nih_timers and make extern. |
| 3819 | (nih_timer_init): Make extern, update name of global. |
| 3820 | (nih_timer_add_timeout, nih_timer_add_periodic) |
| 3821 | (nih_timer_add_scheduled, nih_timer_next_due, nih_timer_poll): Update |
| 3822 | name of global. |
| 3823 | * nih/timer.h: Add prototypes. |
| 3824 | |
Scott James Remnant | 777e21d | 2008-03-14 16:35:04 +0000 | [diff] [blame] | 3825 | * m4/misc.m4 (NIH_INIT): Allow the macro to take options, the first |
| 3826 | of which shall be "noinstall" which defines a Makefile conditional |
| 3827 | that prevents installation of files -- useful when embedded in |
| 3828 | things like Upstart. |
| 3829 | * m4/Makefile.am (dist_aclocal_DATA): Don't install if "noinstall" |
| 3830 | is defined. |
| 3831 | * nih/Makefile.am (lib_LTLIBRARIES): If "noinstall" is defined, |
| 3832 | still build the library but do not install it. |
| 3833 | (include_HEADERS): Don't install if "noinstall" is defined. |
| 3834 | |
Scott James Remnant | 51b7b9d | 2008-03-08 18:15:18 +0000 | [diff] [blame] | 3835 | 2008-03-08 Scott James Remnant <scott@netsplit.com> |
| 3836 | |
Scott James Remnant | 3824145 | 2008-03-08 18:16:29 +0000 | [diff] [blame] | 3837 | * HACKING: Don't even need /product/ anymore. |
| 3838 | |
Scott James Remnant | 51b7b9d | 2008-03-08 18:15:18 +0000 | [diff] [blame] | 3839 | * HACKING: Terminology changes: Bazaar-NG is now just Bazaar; |
| 3840 | Malone is now just Launchpad's bug tracking system. |
| 3841 | |
Scott James Remnant | 2c2a2d2 | 2008-03-07 22:36:52 +0000 | [diff] [blame] | 3842 | 2008-03-07 Scott James Remnant <scott@netsplit.com> |
| 3843 | |
| 3844 | * nih/error.h (NIH_SHOULD): We quite often need to loop while |
| 3845 | we get ENOMEM, but break on another error; this does that. |
| 3846 | * nih/watch.c (nih_watch_new): Use here, fixing a bug in the process |
| 3847 | where we didn't re-raise the error again. |
| 3848 | |
Scott James Remnant | 01c298d | 2008-03-06 19:09:38 +0000 | [diff] [blame] | 3849 | 2008-03-06 Scott James Remnant <scott@netsplit.com> |
| 3850 | |
Scott James Remnant | e9fede6 | 2008-03-06 19:18:03 +0000 | [diff] [blame] | 3851 | * nih/string.c (nih_strcat, nih_strncat, nih_strcat_sprintf) |
| 3852 | (nih_strcat_vsprintf): I'm needing to use realloc more than I should |
| 3853 | for string concatenation, so lets have some functions to do that. |
| 3854 | * nih/string.h: Prototypes for new functions. |
| 3855 | * nih/tests/test_string.c (test_strcat, test_strncat) |
| 3856 | (test_strcat_sprintf, test_strcat_vsprintf): Test the new functions. |
| 3857 | |
Scott James Remnant | 01c298d | 2008-03-06 19:09:38 +0000 | [diff] [blame] | 3858 | * TODO: Update. |
| 3859 | |
Scott James Remnant | 374e7f3 | 2008-03-03 01:01:39 +0000 | [diff] [blame] | 3860 | 2008-03-03 Scott James Remnant <scott@netsplit.com> |
| 3861 | |
Scott James Remnant | f7391d3 | 2008-03-03 11:25:21 +0000 | [diff] [blame] | 3862 | * nih/tests/test_config.c (test_token): Also check that backslashes |
| 3863 | can escape themselves; since you may want a literal one followed by |
| 3864 | whitespace or a newline. |
| 3865 | * nih/config.c (nih_config_token): Dequote blackslash following a |
| 3866 | blackslash. |
| 3867 | |
Scott James Remnant | 798dbae | 2008-03-03 11:06:28 +0000 | [diff] [blame] | 3868 | * nih/tests/test_config.c (test_token): We don't want to dequote |
| 3869 | anything other than newlines and whitespace, since the quote |
| 3870 | characters may be important for the value (e.g. \$FOO being different |
| 3871 | to $FOO). Add tests to make sure we don't. |
| 3872 | * nih/config.c (nih_config_token): After a slash, only dequote |
| 3873 | whitespace otherwise if we're copying, copy a literal slash character |
| 3874 | first. |
| 3875 | |
Scott James Remnant | 374e7f3 | 2008-03-03 01:01:39 +0000 | [diff] [blame] | 3876 | * nih/tests/test_string.c (test_array_append): Should work with a |
| 3877 | NULL array argument. |
| 3878 | * nih/string.c (nih_str_array_append): Make it work. |
| 3879 | (nih_str_array_copy): Which makes this function somewhat simpler. |
| 3880 | |
Scott James Remnant | 86fb49e | 2008-03-02 20:47:43 +0000 | [diff] [blame] | 3881 | 2008-03-02 Scott James Remnant <scott@netsplit.com> |
| 3882 | |
| 3883 | * nih/libnih.supp (nih-command-parser, nih-option-parser): Suppress |
| 3884 | leak of internal state during --help tests. |
| 3885 | (nih-main-package-string-test): Modify suppression to also catch |
| 3886 | when it's allocated within a test case. |
| 3887 | |
Scott James Remnant | 6d3fe94 | 2008-03-01 19:42:46 +0000 | [diff] [blame] | 3888 | 2008-03-01 Scott James Remnant <scott@netsplit.com> |
| 3889 | |
Scott James Remnant | 075021e | 2008-03-01 22:13:42 +0000 | [diff] [blame] | 3890 | * nih/tree.h (NIH_TREE_FOREACH_FULL, NIH_TREE_FOREACH_PRE_FULL) |
| 3891 | (NIH_TREE_FOREACH_POST_FULL): The lack of these macros was silly. |
| 3892 | * nih/tests/test_tree.c (test_foreach_full) |
| 3893 | (test_foreach_pre_full, test_foreach_post_full): Add tests. |
| 3894 | |
Scott James Remnant | 6d3fe94 | 2008-03-01 19:42:46 +0000 | [diff] [blame] | 3895 | * nih/tree.c (nih_tree_next, nih_tree_prev, nih_tree_next_pre) |
| 3896 | (nih_tree_prev_pre, nih_tree_next_post, nih_tree_prev_post): Rename |
| 3897 | these functions to *_full and add filter and data pointers, where |
| 3898 | the filter must return FALSE if given otherwise a node is ignored. |
| 3899 | * nih/tree.h: Update prototypes, and keep previous behaviour with |
| 3900 | the old names through the use of macros. Typedef the filter function |
| 3901 | pointer type. |
| 3902 | * nih/tests/test_tree.c (test_next_full, test_prev_full) |
| 3903 | (test_next_pre_full, test_prev_pre_full, text_next_post_full) |
| 3904 | (test_prev_post_full): Test iteration with filters. |
| 3905 | |
Scott James Remnant | 08d9f31 | 2008-01-16 01:48:36 +0000 | [diff] [blame] | 3906 | 2008-01-16 Scott James Remnant <scott@netsplit.com> |
| 3907 | |
Scott James Remnant | 351b93e | 2008-01-16 16:51:40 +0000 | [diff] [blame] | 3908 | * nih/tree.c (nih_tree_next, nih_tree_prev, nih_tree_next_pre) |
| 3909 | (nih_tree_prev_pre, nih_tree_next_post, nih_tree_prev_post): It's |
| 3910 | never possible to break out of the loop since we always return |
| 3911 | inside it. |
| 3912 | |
| 3913 | * nih/tests/test_child.c (test_poll): Add test case for the watch |
| 3914 | being on the wrong event. |
| 3915 | |
Scott James Remnant | 753c2b2 | 2008-01-16 14:19:23 +0000 | [diff] [blame] | 3916 | * m4/compiler.m4 (NIH_COMPILER_COVERAGE): Allow this to disable |
| 3917 | use of -Os, which otherwise wouldn't be. |
| 3918 | |
Scott James Remnant | 08d9f31 | 2008-01-16 01:48:36 +0000 | [diff] [blame] | 3919 | * configure.ac (AC_COPYRIGHT): Update copyright to 2008. |
| 3920 | |
Scott James Remnant | 3931d06 | 2008-01-15 17:10:03 +0000 | [diff] [blame] | 3921 | 2008-01-15 Scott James Remnant <scott@netsplit.com> |
| 3922 | |
Scott James Remnant | f786c31 | 2008-01-15 23:56:07 +0000 | [diff] [blame] | 3923 | * nih/tests/test_child.c (test_poll): Don't run the ptrace tests |
| 3924 | under valgrind, since they upset it somewhat and return different |
| 3925 | things (I expect we end up tracing valgrind itself). |
| 3926 | |
Scott James Remnant | 3931d06 | 2008-01-15 17:10:03 +0000 | [diff] [blame] | 3927 | * nih/main.c (nih_main_daemonise): Formatting fix. |
| 3928 | |
Scott James Remnant | 028a5fe | 2008-01-14 21:35:49 +0000 | [diff] [blame] | 3929 | 2008-01-14 Scott James Remnant <scott@netsplit.com> |
| 3930 | |
| 3931 | * HACKING: Correct bzr URL to trunk. |
| 3932 | |
Scott James Remnant | 5fcc9e2 | 2007-12-06 18:56:23 +0000 | [diff] [blame] | 3933 | 2007-12-06 Scott James Remnant <scott@netsplit.com> |
| 3934 | |
| 3935 | * nih/child.c (nih_child_poll): I give up. The wait queue can change |
| 3936 | between an invocation of waitid with WNOWAIT and the invocation later |
| 3937 | to "remove" the entry. WNOWAIT is a waste of time, and no matter how |
| 3938 | useful it might have been, I just see no way of actually using it. |
| 3939 | * nih/child.h: Update documentation. |
| 3940 | |
Scott James Remnant | 70e4081 | 2007-12-02 13:26:36 +0000 | [diff] [blame] | 3941 | 2007-12-02 Scott James Remnant <scott@netsplit.com> |
| 3942 | |
Scott James Remnant | 85121e0 | 2007-12-02 19:52:06 +0000 | [diff] [blame] | 3943 | * nih/signal.c (nih_signal_set_handler): Drop the SA_NOCLDSTOP flag |
| 3944 | from when we were setting SIGCHLD, I've no idea why this crept in |
| 3945 | and it now stops us doing things we want to. |
| 3946 | * nih/tests/test_signal.c (test_set_handler): Remove the test for it. |
| 3947 | |
Scott James Remnant | 1ee3e3f | 2007-12-02 14:13:14 +0000 | [diff] [blame] | 3948 | * nih/tests/test_child.c (test_poll): Fix for AMD64, the data |
| 3949 | argument for PTRACE_GETEVENTMSG is unsigned long, which is larger |
| 3950 | than pid_t here. |
| 3951 | |
Scott James Remnant | 70e4081 | 2007-12-02 13:26:36 +0000 | [diff] [blame] | 3952 | * nih/tests/test_child.c (test_poll): Fix up several race |
| 3953 | conditions in the ptrace test cases, there are a lot of quirks you |
| 3954 | have to remember when dealing this most insane of syscalls. |
| 3955 | (signal from traced child): Once we've finished the test we must |
| 3956 | detach from the child otherwise we'll trap our own SIGTERM and the |
| 3957 | child won't exit. Tthere's no need to send SIGCONT since this |
| 3958 | is an ordinary ptrace signal trap. |
| 3959 | (exec by traced child): Detach and send SIGCONT in case the process |
| 3960 | we run gets a signal delivered to it; if that happened, we'd trap |
| 3961 | that signal and the child would never exit. |
| 3962 | (fork by traced child): This is the most pathalogical. We had a |
| 3963 | race where nih_child_poll() was actually reaping the event for the |
| 3964 | child stopping. Change to get the child pid and wait for it before |
| 3965 | calling the poll function. Don't bother waiting for the child to |
| 3966 | terminate, we shouldn't ever find out if we've detached properly. |
| 3967 | |
Scott James Remnant | 9d84c2f | 2007-11-29 19:41:52 +0000 | [diff] [blame] | 3968 | 2007-11-29 Scott James Remnant <scott@netsplit.com> |
| 3969 | |
Scott James Remnant | 821b2ef | 2007-11-29 22:53:50 +0000 | [diff] [blame] | 3970 | * nih/main.c (nih_main_write_pidfile): Have to cast the difference |
| 3971 | in pointers to int, otherwise we get a compiler warning on amd64. |
| 3972 | |
Scott James Remnant | 9d84c2f | 2007-11-29 19:41:52 +0000 | [diff] [blame] | 3973 | * nih/child.c (nih_child_poll): Remove the hacks that shift the |
| 3974 | status information back now that we have a kernel patch in akpm's |
| 3975 | tree to fix it. |
| 3976 | |
Scott James Remnant | ea4892b | 2007-11-15 05:14:43 +0000 | [diff] [blame] | 3977 | 2007-11-15 Scott James Remnant <scott@netsplit.com> |
| 3978 | |
Scott James Remnant | 4cb5f04 | 2007-11-15 06:58:41 +0000 | [diff] [blame] | 3979 | * nih/child.c (nih_child_poll): I found out what was causing the |
| 3980 | signal information to be missing for CLD_STOPPED, a kernel bug; |
| 3981 | cope with it for now by shifting the status across 8 bits for |
| 3982 | CLD_TRAPPED and CLD_STOPPED until I get Roland to fix that bit. |
| 3983 | * nih/tests/test_child.c (test_poll): Replace sleeps with waitid |
| 3984 | WNOWAIT calls now that that particular kernel bug is fixed; add |
| 3985 | a couple of pauses so that the child doesn't exit and clean up |
| 3986 | the wait queue before we get a chance to look. Add a wait on the |
| 3987 | child stopping after fork to avoid a race condition where the child |
| 3988 | isn't actually running yet when we try and detach from it. |
| 3989 | |
Scott James Remnant | ea4892b | 2007-11-15 05:14:43 +0000 | [diff] [blame] | 3990 | * nih/child.h (NihChildWatch): Add events member and rename reaper |
| 3991 | to handler, since it can now be called for things like stop, trap |
| 3992 | and ptrace events. |
| 3993 | (NihReaper): Rename to NihChildHandler |
| 3994 | (NihChildEvents): Enumeration/bit flags for events member |
| 3995 | * nih/child.c (WAITOPTS): Define wait options in one place to make |
| 3996 | repeating them easier. |
| 3997 | (nih_child_add_watch): Add events argument and change type and name |
| 3998 | of function argument, set in the structure. |
| 3999 | (nih_child_poll): Rather than just working out a killed boolean (which |
| 4000 | was wrong anyway since it didn't take CLD_DUMPED into account), we |
| 4001 | store one of many events in the event argument and convert status if |
| 4002 | necessary (bit shifting for CLD_TRAPPED and ptrace events). Check |
| 4003 | this event against the events mask in the watch, and pass to the |
| 4004 | handler. |
| 4005 | * nih/tests/test_child.c (test_add_watch): Check that events and |
| 4006 | handler are initialised correctly. |
| 4007 | (test_poll): Many new test cases for exiting, killing, aborting, |
| 4008 | stopping, continuing, trapping and ptracing. |
| 4009 | |
Scott James Remnant | 2ea1ba5 | 2007-11-03 01:31:32 -0400 | [diff] [blame] | 4010 | 2007-11-03 Scott James Remnant <scott@netsplit.com> |
| 4011 | |
Scott James Remnant | fe82042 | 2007-11-03 14:11:55 -0400 | [diff] [blame] | 4012 | * nih/watch.h (NihWatch): Add created hash table so we can easily |
| 4013 | delay the create_handler until the file is closed. |
| 4014 | * nih/watch.c (nih_watch_new): Initialise the created hash table. |
| 4015 | (nih_watch_handle): When a file is created, add an entry to the |
| 4016 | created hash table and return without calling a handler -- for all |
| 4017 | paths, check for and remove any remove any existing created entry; |
| 4018 | call create_handler instead of modify_handler if this exists, and |
| 4019 | don't call delete_handler at all. |
| 4020 | * nih/tests/test_watch.c (test_new): Check created is initialised. |
| 4021 | (test_reader): Test that creating a file doesn't trigger create |
| 4022 | until it's closed and that unlinking a file before it's been closed |
| 4023 | doesn't trigger at all. |
| 4024 | |
Scott James Remnant | 2ea1ba5 | 2007-11-03 01:31:32 -0400 | [diff] [blame] | 4025 | * nih/test.h (TEST_FREE_TAG): assert that we don't use this on |
| 4026 | a NULL pointer. |
| 4027 | |
Scott James Remnant | c188dc4 | 2007-11-02 23:42:17 -0400 | [diff] [blame] | 4028 | 2007-11-02 Scott James Remnant <scott@netsplit.com> |
| 4029 | |
| 4030 | * nih/test.h (TEST_FUNCTION_FEATURE): Add macro for when we're |
| 4031 | testing a specific feature of a function. |
| 4032 | |
Scott James Remnant | f08411f | 2007-10-27 23:16:47 -0400 | [diff] [blame] | 4033 | 2007-10-27 Scott James Remnant <scott@netsplit.com> |
| 4034 | |
Scott James Remnant | 4aa755e | 2007-10-27 23:47:34 -0400 | [diff] [blame] | 4035 | * m4/compiler.m4 (NIH_COMPILER_OPTIMISATIONS): Add extra [...] |
| 4036 | |
Scott James Remnant | 0ded944 | 2007-10-27 23:36:54 -0400 | [diff] [blame] | 4037 | * m4/compiler.m4 (NIH_COMPILER_WARNINGS): Add missing [...] around |
| 4038 | the second argument to AS_IF. |
| 4039 | (NIH_COMPILER_OPTIMISATIONS): Fix wrong use of [..][..] to [....] |
| 4040 | (NIH_COMPILER_COVERAGE): Remove extraneous comma |
| 4041 | |
Scott James Remnant | f08411f | 2007-10-27 23:16:47 -0400 | [diff] [blame] | 4042 | * m4/linker.m4 (NIH_LINKER_VERSION_SCRIPT): Restore AM_CONDITIONAL |
| 4043 | that was mistakenly dropped. |
| 4044 | |
Scott James Remnant | b03595f | 2007-10-26 14:05:11 -0400 | [diff] [blame] | 4045 | 2007-10-26 Scott James Remnant <scott@netsplit.com> |
| 4046 | |
Scott James Remnant | f0cf647 | 2007-10-26 14:15:11 -0400 | [diff] [blame] | 4047 | * m4/linker.m4 (NIH_LINKER_SYMBOLIC_FUNCTIONS): Test that checks |
| 4048 | for -Bsymbolic-functions |
| 4049 | |
Scott James Remnant | 8aea848 | 2007-10-26 14:13:00 -0400 | [diff] [blame] | 4050 | * m4/linker.m4: Style fix. |
| 4051 | |
Scott James Remnant | 3f49ccd | 2007-10-26 14:12:37 -0400 | [diff] [blame] | 4052 | * m4/compiler.m4 (NIH_COMPILER_COVERAGE, NIH_COMPILER_OPTIMISATIONS) |
| 4053 | (NIH_COMPILER_WARNINGS): Update to use AS_IF. |
| 4054 | |
Scott James Remnant | 5e26a02 | 2007-10-26 14:08:26 -0400 | [diff] [blame] | 4055 | * m4/compiler.m4 (NIH_C_THREAD): Shell fix. |
| 4056 | |
Scott James Remnant | 736a4ba | 2007-10-26 14:07:52 -0400 | [diff] [blame] | 4057 | * m4/linker.m4 (NIH_LINKER_OPTIMISATIONS): Update to use AS_IF. |
| 4058 | |
Scott James Remnant | b03595f | 2007-10-26 14:05:11 -0400 | [diff] [blame] | 4059 | * m4/linker.m4 (NIH_LINKER_VERSION_SCRIPT): Update so it supports |
| 4060 | a config.cache |
| 4061 | |
Scott James Remnant | 740251c | 2007-10-24 00:15:30 +0100 | [diff] [blame] | 4062 | 2007-10-24 Scott James Remnant <scott@netsplit.com> |
| 4063 | |
| 4064 | * nih/file.c (nih_file_map): Catch a file larger than the length of |
| 4065 | size_t and raise the standard EFBIG error message. Noticed by |
| 4066 | Kees Cook. |
| 4067 | |
Scott James Remnant | e6b4b96 | 2007-10-15 01:36:41 +0100 | [diff] [blame] | 4068 | 2007-10-15 Scott James Remnant <scott@netsplit.com> |
| 4069 | |
Scott James Remnant | 691070b | 2007-10-15 23:14:14 +0100 | [diff] [blame] | 4070 | * nih/alloc.c (nih_alloc_using, nih_alloc_reparent, nih_realloc): |
| 4071 | Change the order in which children allocations are stored in the |
| 4072 | list such that the last allocation is freed first rather than |
| 4073 | the other way around. This solves issues of children being stored |
| 4074 | inside an allocated hash table which will be freed first. |
| 4075 | |
Scott James Remnant | 8ae11cc | 2007-10-15 13:28:39 +0100 | [diff] [blame] | 4076 | * m4/misc.m4 (NIH_INIT): Use AC_PROG_CC_C99 instead of NIH_C_C99 |
| 4077 | * configure.ac: Bump Autoconf dependency to 2.61 |
| 4078 | * HACKING: Likewise increase documentation |
| 4079 | |
Scott James Remnant | 6d102a9 | 2007-10-15 03:05:09 +0100 | [diff] [blame] | 4080 | * HACKING: Correct Bazaar branch now we're natively hosted on LP |
| 4081 | |
Scott James Remnant | b67e20a | 2007-10-15 02:55:55 +0100 | [diff] [blame] | 4082 | * nih/test.h (_test_allocator): Mark used in case it isn't. |
| 4083 | (_test_free_tag, _test_free_tags, _test_destructor) |
| 4084 | (TEST_FREE_TAG, TEST_FREE, TEST_NOT_FREE): Since destructors are |
| 4085 | now intended for internal use by an object, we shouldn't abuse them |
| 4086 | in test cases like we were doing - since we might not chain up |
| 4087 | properly and miss vital behaviour as a result. Instead implement |
| 4088 | some tests that use a destructor on an nih_alloc() child of the object |
| 4089 | to determine freeness. |
| 4090 | * nih/tests/test_watch.c (test_reader): Use TEST_FREE instead of |
| 4091 | a custom destructor, which are no longer favoured for this kind |
| 4092 | of work. |
| 4093 | * nih/tests/test_error.c (test_raise_again, test_pop_context): |
| 4094 | Use TEST_FREE instead of custom destructor. |
| 4095 | * nih/tests/test_timer.c (test_poll): Use TEST_FREE/TEST_NOT_FREE |
| 4096 | * nih/tests/test_child.c (test_poll): Use TEST_FREE, etc. |
| 4097 | * nih/tests/test_io.c (test_shutdown, test_watcher) |
| 4098 | (test_read_message, test_read, test_get): Use TEST_FREE, etc. |
| 4099 | |
Scott James Remnant | e6b4b96 | 2007-10-15 01:36:41 +0100 | [diff] [blame] | 4100 | * nih/hash.c, nih/timer.c, nih/signal.c, nih/child.c, nih/io.c, |
| 4101 | nih/watch.c: Document why non-allocated versions of functions |
| 4102 | are missing. |
| 4103 | * TODO: Update. |
| 4104 | |
Scott James Remnant | 72b7f50 | 2007-10-14 17:00:04 +0100 | [diff] [blame] | 4105 | 2007-10-14 Scott James Remnant <scott@netsplit.com> |
| 4106 | |
Scott James Remnant | 8a39802 | 2007-10-14 17:09:35 +0100 | [diff] [blame] | 4107 | * nih/alloc.c (nih_free): Call destructors before freeing children, |
| 4108 | this makes them more consistent with being structure clean-up |
| 4109 | functions rather than using them to detect a free. Don't return |
| 4110 | values from children destructors. |
| 4111 | * nih/tests/test_alloc.c (test_free): Adjust test, return values |
| 4112 | from children destructors are never returned. |
| 4113 | |
Scott James Remnant | 5ab1223 | 2007-10-14 17:02:51 +0100 | [diff] [blame] | 4114 | * nih/watch.c (nih_watch_new): Make the io structure an nih_alloc |
| 4115 | child of the watch, now that we don't perform any kind of lazy |
| 4116 | freeing or closing. |
| 4117 | (nih_watch_destroy): No need to close the io structure since it'll |
| 4118 | be automatically freed, just set the flag to be caught in the reader. |
| 4119 | * nih/tests/test_watch.c (test_new): Check parent of watch->io |
| 4120 | is watch, not NUL. |
| 4121 | (test_destroy): Don't use the destructor anymore, nih_alloc is tested |
| 4122 | elsewhere. |
| 4123 | (test_reader): Don't use destructor to test watch->io |
| 4124 | (my_destructor): Always call nih_watch_destroy since this is only |
| 4125 | used for that. |
| 4126 | |
Scott James Remnant | 72b7f50 | 2007-10-14 17:00:04 +0100 | [diff] [blame] | 4127 | * nih/io.c (nih_io_close): Rename to nih_io_destroy, setting a free |
| 4128 | flag in the structure if necessary before closing the descriptor |
| 4129 | and calling the error handler if there's a problem. |
| 4130 | (nih_io_reopen): Set destructor |
| 4131 | (nih_io_watcher): Rename lazy_close to caught_free and check its |
| 4132 | value after any calls to the reader, error handler or close handler |
| 4133 | functions; if true, simply bail out. Reorder leaving so that a |
| 4134 | shutdown check happens last (since this can free the structure). |
| 4135 | (nih_io_closed): Now simply calls the close handler if it exists, |
| 4136 | otherwise frees the structure. |
| 4137 | * nih/io.h (NihIo): Rename close member to free. |
| 4138 | Update prototypes. |
| 4139 | * nih/tests/test_io.c (my_reader, test_reopen): Use nih_free |
| 4140 | instead of nih_io_close. |
| 4141 | (test_reopen): Create new fds each time, since they are closed |
| 4142 | on free now. |
| 4143 | (destructor_called): Chain up to call nih_io_destroy |
| 4144 | (test_close): Rename to test_destroy and alter appropriately. |
| 4145 | (test_watcher): Adjust documentation to say we're checking that free |
| 4146 | is called in the reader. |
| 4147 | (test_send_message, test_write, test_printf): Open pipes rather |
| 4148 | than just stdout, because that will end up closed. |
| 4149 | |
Scott James Remnant | 6f40260 | 2007-10-12 00:09:40 +0100 | [diff] [blame] | 4150 | 2007-10-12 Scott James Remnant <scott@netsplit.com> |
| 4151 | |
Scott James Remnant | 978c5c8 | 2007-10-12 19:24:17 +0100 | [diff] [blame] | 4152 | * nih/watch.h (NihCreateHandler, NihModifyHandler, NihDeleteHandler): |
| 4153 | Modify doc strings to mention nih_free instead of nih_watch_free |
| 4154 | |
Scott James Remnant | 7bda197 | 2007-10-12 19:07:59 +0100 | [diff] [blame] | 4155 | * nih/tests/test_file.c (my_visitor): Set destructor for the list |
| 4156 | entries we create as we go. |
| 4157 | |
Scott James Remnant | bafd3e1 | 2007-10-12 18:20:36 +0100 | [diff] [blame] | 4158 | * nih/watch.c (nih_watch_reader): Rework the function slightly, |
| 4159 | instead of using the free pointer to free at the end of the handler, |
| 4160 | use it to detect the free after the handler returns and immediately |
| 4161 | abort -- it means we won't process remaining watches but meh. |
| 4162 | (nih_watch_handle): Get passed the caught_free flag and check it |
| 4163 | after calling any handlers to make sure we abort properly. |
| 4164 | (nih_watch_free): Rename to nih_watch_destroy and just handle the |
| 4165 | internal cleanup. |
| 4166 | (nih_watch_new): Set the destructor properly. |
| 4167 | * nih/watch.h: Update prototypes. |
| 4168 | * nih/tests/test_watch.c (test_free): Rename to test_destroy. |
| 4169 | (my_delete_handler): Use nih_free not nih_watch_free |
| 4170 | (my_destructor): Chain up to nih_watch_destroy for NihWatch. |
| 4171 | |
Scott James Remnant | 7108771 | 2007-10-12 00:12:33 +0100 | [diff] [blame] | 4172 | * nih/tests/test_watch.c (my_destructor): Neither NihWatch nor NihIo |
| 4173 | need a destructor to be called. |
| 4174 | |
Scott James Remnant | 6027f61 | 2007-10-12 00:11:22 +0100 | [diff] [blame] | 4175 | * nih/tests/test_child.c (test_poll): Fix erroneous removal of "1" |
| 4176 | |
Scott James Remnant | 6f40260 | 2007-10-12 00:09:40 +0100 | [diff] [blame] | 4177 | * TODO: Update. |
| 4178 | |
Scott James Remnant | f535ab4 | 2007-10-11 23:20:37 +0100 | [diff] [blame] | 4179 | 2007-10-11 Scott James Remnant <scott@netsplit.com> |
| 4180 | |
Scott James Remnant | 601743d | 2007-10-11 23:56:27 +0100 | [diff] [blame] | 4181 | * nih/option.c, nih/command.c, nih/config.c: Remove references to |
| 4182 | nih_alloc_set_destructor() from doc strings since this is now |
| 4183 | considered bad practice. |
| 4184 | |
Scott James Remnant | ffba4ab | 2007-10-11 23:54:40 +0100 | [diff] [blame] | 4185 | * nih/main.c (nih_main_loop_add_func): Adjust call to set destructor |
| 4186 | * nih/tests/test_main.c (test_main_loop) |
| 4187 | (test_main_loop_add_func): Call nih_free instead of nih_list_free |
| 4188 | |
Scott James Remnant | e60b587 | 2007-10-11 23:53:35 +0100 | [diff] [blame] | 4189 | * nih/watch.c (nih_watch_add, nih_watch_handle): Call nih_free |
| 4190 | instead of nih_list_free |
| 4191 | (nih_watch_add): Set destructor to nih_list_destroy for now. |
| 4192 | * nih/tests/test_watch.c (my_destructor): Call nih_list_destroy |
| 4193 | for NihWatch structure. |
| 4194 | |
Scott James Remnant | 3619f2f | 2007-10-11 23:48:56 +0100 | [diff] [blame] | 4195 | * nih/file.c (nih_dir_walk_visit): Call nih_free instead of |
| 4196 | nih_list_free |
| 4197 | (nih_dir_walk, nih_dir_walk_visit): Set destructor on object. |
| 4198 | |
Scott James Remnant | 41f8a45 | 2007-10-11 23:47:23 +0100 | [diff] [blame] | 4199 | * nih/tests/test_io.c (test_add_watch, test_select_fds) |
| 4200 | (test_handle_fds, test_shutdown, test_watcher): Call nih-free |
| 4201 | instead of nih_list_free |
| 4202 | (destructor_called): Call nih_list_destroy when passed an |
| 4203 | NihIoMessage; a bit icky since this is also called for an NihIo |
| 4204 | which doesn't have a destructor (yet) |
| 4205 | |
| 4206 | * nih/io.c (nih_io_watcher_write, nih_io_read, nih_io_get): Call |
| 4207 | nih_free instead of nih_list_free. |
| 4208 | (nih_io_add_watch): Adjust call to set destructor |
| 4209 | (nih_io_message_new): Set a destructor so the message is removed |
| 4210 | from a list when freed. |
| 4211 | |
Scott James Remnant | 43a285d | 2007-10-11 23:40:08 +0100 | [diff] [blame] | 4212 | * nih/child.c (nih_child_add_watch): Adjust call to set destructor |
| 4213 | (nih_child_poll): Call nih_free instead of nih_list_free |
| 4214 | * nih/tests/test_child.c (test_add_watch, test_poll): Call nih_free |
| 4215 | instead of nih_list_free. |
| 4216 | (my_destructor): Call nih_list_destroy(). |
| 4217 | |
Scott James Remnant | 6d6c8db | 2007-10-11 23:36:22 +0100 | [diff] [blame] | 4218 | * nih/string.c: Fix documentation as below. |
| 4219 | |
Scott James Remnant | 928ed54 | 2007-10-11 23:35:17 +0100 | [diff] [blame] | 4220 | * nih/hash.c: Fix doc string, destructors are now considered internal |
| 4221 | and shouldn't be set by callers. |
| 4222 | |
Scott James Remnant | bf794a5 | 2007-10-11 23:34:38 +0100 | [diff] [blame] | 4223 | * nih/signal.c (nih_signal_add_handler): Adjust call to set destructor |
| 4224 | * nih/tests/test_signal.c (test_add_handler): Call nih_free instead |
| 4225 | of nih_list_free |
| 4226 | |
Scott James Remnant | ee12222 | 2007-10-11 23:33:36 +0100 | [diff] [blame] | 4227 | * nih/timer.c: Fix doc strings |
| 4228 | |
Scott James Remnant | 010c261 | 2007-10-11 23:32:15 +0100 | [diff] [blame] | 4229 | * nih/timer.c (nih_timer_add_timeout, nih_timer_add_periodic) |
| 4230 | (nih_timer_add_scheduled): Adjust calls to set destructor. |
| 4231 | (nih_timer_poll): Call nih_free rather than nih_list_free. |
| 4232 | * nih/tests/test_timer.c (test_add_timeout, test_add_periodic) |
| 4233 | (test_add_scheduled, test_next_due): Call nih_free rather than |
| 4234 | nih_list_free |
| 4235 | (my_destructor): Call the list destructor. |
Scott James Remnant | cf7ec60 | 2007-10-11 23:27:45 +0100 | [diff] [blame] | 4236 | |
| 4237 | * nih/tree.c (nih_tree_destructor): Rename to nih_tree_destroy() |
| 4238 | (nih_tree_free): Drop. |
| 4239 | (nih_tree_new, nih_tree_entry_new): Set destructor. |
| 4240 | * nih/tree.h: Update prototypes. |
Scott James Remnant | 010c261 | 2007-10-11 23:32:15 +0100 | [diff] [blame] | 4241 | * nih/tests/test_tree.c (test_destructor): Rename. |
| 4242 | (test_free): Drop |
Scott James Remnant | cf7ec60 | 2007-10-11 23:27:45 +0100 | [diff] [blame] | 4243 | |
Scott James Remnant | 47173b3 | 2007-10-11 23:23:56 +0100 | [diff] [blame] | 4244 | * nih/: Documentation string fix. |
| 4245 | |
Scott James Remnant | 79d4f76 | 2007-10-11 23:22:12 +0100 | [diff] [blame] | 4246 | * nih/tests/test_hash.c (test_string_key): Replace nih_list_free |
| 4247 | call with nih_free, since we're not overriding the destructor. |
| 4248 | |
Scott James Remnant | f535ab4 | 2007-10-11 23:20:37 +0100 | [diff] [blame] | 4249 | * nih/list.c (nih_list_free): Drop this function. |
| 4250 | (nih_list_destructor): Rename to nih_list_destroy() |
| 4251 | (nih_list_new, nih_list_entry_new): Set destructor function. |
| 4252 | * nih/list.h: Update prototypes. |
| 4253 | * nih/tests/test_list.c (test_destructor): Rename. |
| 4254 | (test_free): Drop. |
| 4255 | (test_add): Replace nih_list_free calls with nih_free |
| 4256 | |
Scott James Remnant | 470e708 | 2007-10-08 13:09:16 +0100 | [diff] [blame] | 4257 | 2007-10-08 Scott James Remnant <scott@netsplit.com> |
| 4258 | |
Scott James Remnant | 8c940eb | 2007-10-08 13:34:00 +0100 | [diff] [blame] | 4259 | * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.16.1 since this |
| 4260 | version of gettext is needed for compatibility with Automake 1.10 |
| 4261 | * HACKING: Bump version in the docs too. |
| 4262 | |
Scott James Remnant | 470e708 | 2007-10-08 13:09:16 +0100 | [diff] [blame] | 4263 | * Makefile.am (ACLOCAL_AMFLAGS): Specify that aclocal install |
| 4264 | ordinarily system-wide macros into m4 (libtool.m4, specifically). |
| 4265 | This makes it easier for packagers to modify autoconfery since |
| 4266 | aclocal is no longer a destructive event. |
| 4267 | * configure.ac (AM_INIT_AUTOMAKE): Increase Automake requirement to |
| 4268 | 1.10 to ensure we have aclocal --instal |
| 4269 | * HACKING: Increase Automake version in the docs. |
| 4270 | |
Scott James Remnant | b7f0077 | 2007-06-22 13:41:57 +0100 | [diff] [blame] | 4271 | 2007-06-22 Scott James Remnant <scott@netsplit.com> |
| 4272 | |
| 4273 | * nih/tests/test_tree.c (test_next, test_prev, test_next_pre) |
| 4274 | (test_prev_pre, test_next_post, test_pre_post): Add tests for a |
| 4275 | single-node tree, because we found a bug where it didn't work. |
| 4276 | * nih/tree.c (nih_tree_next): Bug fix; check there is a right node |
| 4277 | before checking whether we've returned from it, otherwise we could |
| 4278 | confuse it with starting at the top of the tree. |
| 4279 | (nih_tree_prev): Likewise check there is a left node before checking |
| 4280 | whether we've returned from it. |
| 4281 | |
Scott James Remnant | aa70e1c | 2007-06-20 17:08:35 +0100 | [diff] [blame] | 4282 | 2007-06-20 Scott James Remnant <scott@netsplit.com> |
| 4283 | |
Scott James Remnant | 3f67965 | 2007-06-20 21:02:23 +0100 | [diff] [blame] | 4284 | * nih/config.c (nih_config_parse_stanza): Free name after use. |
| 4285 | |
Scott James Remnant | aa70e1c | 2007-06-20 17:08:35 +0100 | [diff] [blame] | 4286 | * nih/config.c (nih_config_parse_stanza): Don't dequote stanza |
| 4287 | names, since otherwise they can't be made non-special; if we don't |
| 4288 | recognise the stanza we parsed, raise the error without updating |
| 4289 | pos, since we want it to point to the start of the token. |
| 4290 | * nih/tests/test_config.c (test_parse_stanza): Update pos in test. |
| 4291 | |
Scott James Remnant | f547000 | 2007-06-18 13:10:01 +0100 | [diff] [blame] | 4292 | 2007-06-18 Scott James Remnant <scott@netsplit.com> |
| 4293 | |
| 4294 | * nih/list.h (NihListEntry): Define structure combining an NihList |
| 4295 | with a union of common types. |
| 4296 | * nih/list.c (nih_list_entry_new): Add a helper function for when |
| 4297 | we need a simple entry without any extra structure around it. |
| 4298 | * nih/tests/test_list.c (test_entry_new): Test the new function. |
| 4299 | * nih/tree.h (NihTreeEntry): Define structure combining an NihTree |
| 4300 | with a union of common types. |
| 4301 | * nih/tree.c (nih_tree_entry_new): Add a helper function for when |
| 4302 | we need a simple node without any extra structure around it. |
| 4303 | * nih/tests/test_tree.c (test_entry_new): Test the new function. |
| 4304 | |
Scott James Remnant | c3fe7ea | 2007-06-15 15:52:39 +0100 | [diff] [blame] | 4305 | 2007-06-15 Scott James Remnant <scott@netsplit.com> |
| 4306 | |
Scott James Remnant | 3cc53ec | 2007-06-15 16:08:19 +0100 | [diff] [blame] | 4307 | * nih/tests/test_tree.c (test_next, test_foreach, test_prev) |
| 4308 | (test_next_pre, test_foreach_pre, test_prev_pre, test_next_post) |
Scott James Remnant | fbcf9d5 | 2007-06-15 16:27:53 +0100 | [diff] [blame] | 4309 | (test_foreach_post, test_prev_post): Add tests for partial tree |
| 4310 | traversal, we don't expect to break out of the confines of the |
| 4311 | root that we've set, even if it has a parent. |
| 4312 | * nih/tree.c (nih_tree_next, nih_tree_prev, nih_tree_next_pre) |
| 4313 | (nih_tree_prev_pre, nih_tree_next_post, nih_tree_prev_post): Before |
| 4314 | moving up to the parent node, check whether the current node is the |
| 4315 | tree root; if it is, return NULL instead since we've iterated the |
| 4316 | sub-tree we were looking at. |
| 4317 | |
| 4318 | * nih/tests/test_tree.c (test_next, test_foreach, test_prev) |
| 4319 | (test_next_pre, test_foreach_pre, test_prev_pre, test_next_post) |
Scott James Remnant | 3cc53ec | 2007-06-15 16:08:19 +0100 | [diff] [blame] | 4320 | (test_foreach_post, test_prev_post): Use two different arrays to |
| 4321 | make it really obvious how the tree is constructed and what order |
| 4322 | we really expect it to be in. This makes it easier to get ready for |
| 4323 | the next bit ... |
| 4324 | |
Scott James Remnant | c3fe7ea | 2007-06-15 15:52:39 +0100 | [diff] [blame] | 4325 | * nih/tree.c (nih_tree_next, nih_tree_prev): Minor bug fix, set the |
| 4326 | previous to the tree's parent when visiting for the first time so that |
| 4327 | partial tree iterations might be able to work. Make algorithm code |
| 4328 | simpler and more readable. |
| 4329 | (nih_tree_next_pre, nih_tree_prev_pre): Algorithm for non-recursive |
| 4330 | pre-order tree iteration, note that unlike the above, these are not |
| 4331 | symmetrical. |
| 4332 | (nih_tree_next_post, nih_tree_prev_post): Algorithm for non-recursive |
| 4333 | post-order tree iteration, note that these aren't symmetrical with |
| 4334 | each other, but are the symmetrical equivalents of the pre-order |
| 4335 | functions. |
| 4336 | * nih/tree.h: Add prototypes for new functions. |
| 4337 | (NIH_TREE_FOREACH_PRE, NIH_TREE_FOREACH_POST): Add convenience |
| 4338 | iteration macros for pre-order and post-order iteration. |
| 4339 | * nih/tests/test_tree.c (test_next, test_foreach, test_prev): Add |
| 4340 | some documentation for the tree shape, and how we work out the node |
| 4341 | numbers. In each case, we were accidentally giving the expected |
| 4342 | first node (which fortunately always worked); to test this harder, |
| 4343 | give the root node instead! |
| 4344 | (test_next_pre, test_foreach_pre, text_prev_pre): Test pre-order |
| 4345 | tree iteration with the same basic code. |
| 4346 | (test_next_post, test_foreach_post, text_prev_post): Test post-order |
| 4347 | tree iteration with the same basic code. |
| 4348 | |
Scott James Remnant | 3e335b3 | 2007-06-12 11:10:53 +0100 | [diff] [blame] | 4349 | 2007-06-12 Scott James Remnant <scott@netsplit.com> |
| 4350 | |
Scott James Remnant | b19cd39 | 2007-06-12 14:47:17 +0100 | [diff] [blame] | 4351 | * nih/test.h (TEST_HASH_NOT_EMPTY): Add missing ; |
| 4352 | |
Scott James Remnant | d440b77 | 2007-06-12 12:17:41 +0100 | [diff] [blame] | 4353 | * nih/main.c (nih_main_unlink_pidfile): Add for completeness. |
| 4354 | * nih/main.h: Add prototype. |
| 4355 | * nih/tests/test_main.c: Use the new function here for testing. |
| 4356 | |
Scott James Remnant | 6d484be | 2007-06-12 12:12:53 +0100 | [diff] [blame] | 4357 | * nih/main.c (nih_main_pidfile): Rename to nih_main_write_pidfile |
| 4358 | (nih_main_set_pidfile, nih_main_get_pidfile) |
| 4359 | (nih_main_read_pidfile): Add companion functions to set and get the |
| 4360 | current location, and also read from it. |
| 4361 | * nih/main.h: Add prototypes. |
| 4362 | * nih/tests/test_main.c (test_set_pidfile, test_read_pidfile) |
| 4363 | (test_write_pidfile): Test the functions as best we can. |
| 4364 | |
Scott James Remnant | ea51954 | 2007-06-12 11:27:54 +0100 | [diff] [blame] | 4365 | * nih/main.c (nih_main_daemonise): Cut the pid file writing out |
| 4366 | (nih_main_pidfile): and place it into its own function, since we |
| 4367 | seem to use this elsewhere too. |
| 4368 | * nih/main.h: add prototype. |
| 4369 | |
Scott James Remnant | 3e335b3 | 2007-06-12 11:10:53 +0100 | [diff] [blame] | 4370 | * nih/main.c (nih_main_daemonise): Don't just write the pid file |
| 4371 | directly, and hope it works. Write to a temporary file, flush and |
| 4372 | sync it, then rename to the real filename. This provides a "if the |
| 4373 | pid file exists, a pid can be read from it" contract - or at least, |
| 4374 | the nearest we can to that. |
| 4375 | |
Scott James Remnant | f1c9b1e | 2007-06-11 11:39:01 +0100 | [diff] [blame] | 4376 | 2007-06-11 Scott James Remnant <scott@netsplit.com> |
| 4377 | |
| 4378 | * nih/config.c (nih_config_skip_block): Simple function to skip over |
| 4379 | a block inline without parsing it into a string. |
| 4380 | * nih/config.h: Add prototype. |
| 4381 | * nih/tests/test_config.c (test_skip_block): Test the new function. |
| 4382 | |
Scott James Remnant | e96fe91 | 2007-06-10 17:38:27 +0100 | [diff] [blame] | 4383 | 2007-06-10 Scott James Remnant <scott@netsplit.com> |
| 4384 | |
| 4385 | * nih/test.h (TEST_HASH_EMPTY, TEST_HASH_NOT_EMPTY): Add some |
| 4386 | tests for hash emptyness. |
| 4387 | |
Scott James Remnant | 1caddb6 | 2007-06-03 13:32:56 +0100 | [diff] [blame] | 4388 | 2007-06-03 Scott James Remnant <scott@netsplit.com> |
| 4389 | |
| 4390 | * nih/file.h (NihFileFilter): add missing data pointer to definition. |
| 4391 | * nih/file.c (nih_dir_walk_scan): Take the data pointer and pass it |
| 4392 | to the filter function. |
| 4393 | (nih_dir_walk, nih_dir_walk_visit): Pass data pointer to scan function. |
| 4394 | (nih_file_ignore): Accept and ignore a data pointer. |
| 4395 | * nih/tests/test_file.c (my_filter): Add data pointer. |
| 4396 | (test_ignore): Pass NULL for data pointer. |
| 4397 | * nih/watch.c (nih_watch_handle): Pass data to filter function. |
| 4398 | * nih/tests/test_watch.c (my_filter): Add data pointer. |
| 4399 | |
Scott James Remnant | 89915ab | 2007-05-27 15:44:40 +0100 | [diff] [blame] | 4400 | 2007-05-27 Scott James Remnant <scott@netsplit.com> |
| 4401 | |
Scott James Remnant | ca2cff7 | 2007-05-27 16:08:50 +0100 | [diff] [blame] | 4402 | * nih/config.c (nih_config_parse): Since we've elimated all of the |
| 4403 | uses of ssize_t in this code, we're safe to parse a file larger |
| 4404 | than SSIZE_MAX, so drop the check. |
| 4405 | * nih/errors.h (NIH_CONFIG_TOO_LONG): Drop this error, since there |
| 4406 | can be no such case anymore; technically we don't handle very large |
| 4407 | files since we can only map 4GB of memory, but we fail by mapping |
| 4408 | a smaller part of the file, rather than overrunning any buffers. |
| 4409 | |
Scott James Remnant | 0db9c6a | 2007-05-27 16:00:45 +0100 | [diff] [blame] | 4410 | * nih/config.c (nih_config_parse_block): Don't use -1 in ws to |
| 4411 | indicate we've not counted it yet, instead use the current value |
| 4412 | of lines; this elimates the last ssize_t from the code. |
| 4413 | |
Scott James Remnant | d306cc6 | 2007-05-27 15:55:19 +0100 | [diff] [blame] | 4414 | * nih/config.c (nih_config_block_end): Modify to return TRUE or |
| 4415 | FALSE, and set the end position through an argument instead. |
| 4416 | (nih_config_parse_block): Update the way we call nih_config_block_end |
| 4417 | to receive the end location via the pointer, rather than as the |
| 4418 | return value. |
| 4419 | |
Scott James Remnant | 89915ab | 2007-05-27 15:44:40 +0100 | [diff] [blame] | 4420 | * nih/config.c (nih_config_token): Change return value to an int, |
| 4421 | and return the token length through an argument pointer if given. |
| 4422 | This eliminates a need for ssize_t for this function. |
| 4423 | (nih_config_next_token, nih_config_parse_command): Update way we |
| 4424 | call nih_config_token to obtain the length through a pointer, and |
| 4425 | directly check the return value to decide whether to abandon it. |
| 4426 | * nih/config.h: Update prototype. |
| 4427 | * nih/tests/test_config.c (test_token): Update the tests to check |
| 4428 | the pointed value for the length, and the return value for error. |
| 4429 | |
Scott James Remnant | 6012918 | 2007-05-18 17:56:48 +0100 | [diff] [blame] | 4430 | 2007-05-18 Scott James Remnant <scott@netsplit.com> |
| 4431 | |
Scott James Remnant | cbc99f1 | 2007-05-18 18:39:31 +0100 | [diff] [blame] | 4432 | * nih/tests/test_string.c (test_array_append): Make sure that the |
| 4433 | array is returned unaltered (at least, apparently) if any allocation |
| 4434 | fails during the append. |
| 4435 | * nih/string.c (nih_str_array_append): Record the original length, |
| 4436 | and pass always pass our local length variable to nih_str_array_add. |
| 4437 | Before returning, overwrite the returned length; if any allocation |
| 4438 | fails, unwind other allocations and restore the NULL pointer before |
| 4439 | returning NULL. |
| 4440 | |
Scott James Remnant | 6012918 | 2007-05-18 17:56:48 +0100 | [diff] [blame] | 4441 | * nih/string.c (nih_str_array_copy, nih_str_array_append): Add a |
| 4442 | couple of functions to copy a string array, and to append one onto |
| 4443 | the end of another. Saves reimplementing this each time. |
| 4444 | * nih/string.h: Add prototypes. |
| 4445 | * nih/tests/test_string.c (test_array_copy, test_array_append): |
| 4446 | Test the new functions. |
| 4447 | |
Scott James Remnant | ee830f5 | 2007-04-24 13:05:30 +0100 | [diff] [blame] | 4448 | 2007-04-24 Scott James Remnant <scott@netsplit.com> |
| 4449 | |
| 4450 | * nih/string.c (nih_vsprintf): Add va_end to va_copy; C standard |
| 4451 | says so. |
| 4452 | |
Scott James Remnant | 9489e8b | 2007-03-13 16:56:33 +0000 | [diff] [blame] | 4453 | 2007-03-13 Scott James Remnant <scott@netsplit.com> |
| 4454 | |
Scott James Remnant | 735891b | 2007-03-13 18:37:32 +0000 | [diff] [blame] | 4455 | * nih/tests/test_io.c (test_get_family): The elmos of this world |
| 4456 | like to disable various networking protocols, so expect that and |
| 4457 | skip test cases. |
| 4458 | |
Scott James Remnant | 9489e8b | 2007-03-13 16:56:33 +0000 | [diff] [blame] | 4459 | * nih/io.h: Change int_data type to a plain old int; there's no |
| 4460 | reason for it to be a fixed width type, and we may as well think |
| 4461 | about supporting ILP64 in case someone does something silly one day. |
| 4462 | |
Scott James Remnant | 0c2a709 | 2007-03-11 12:56:21 +0000 | [diff] [blame] | 4463 | 2007-03-11 Scott James Remnant <scott@netsplit.com> |
| 4464 | |
Scott James Remnant | c2f2180 | 2007-03-11 18:57:40 +0000 | [diff] [blame] | 4465 | * m4/compiler.m4: Don't check for __thread unless --enable-threading |
| 4466 | given to configure, instead define it to empty. |
| 4467 | |
Scott James Remnant | 0c2a709 | 2007-03-11 12:56:21 +0000 | [diff] [blame] | 4468 | * TODO: Update. |
| 4469 | |
Scott James Remnant | 674fbd5 | 2007-03-09 12:56:40 +0000 | [diff] [blame] | 4470 | 2007-03-09 Scott James Remnant <scott@netsplit.com> |
| 4471 | |
| 4472 | * nih/logging.c: Make the current log priority available globally |
| 4473 | through the nih_log_priority variable. |
| 4474 | * nih/logging.h: Update. |
| 4475 | |
Scott James Remnant | 44f3efb | 2007-03-08 12:07:16 +0000 | [diff] [blame] | 4476 | 2007-03-08 Scott James Remnant <scott@netsplit.com> |
| 4477 | |
| 4478 | * nih/macros.h (_n): Add a macro to wrap ngettext() for plural forms. |
| 4479 | |
Scott James Remnant | 5291158 | 2007-03-02 11:26:15 +0000 | [diff] [blame] | 4480 | 2007-03-02 Scott James Remnant <scott@netsplit.com> |
| 4481 | |
| 4482 | * nih/tests/test_watch.c: Skip these tests if inotify is not |
| 4483 | available, since there's not much we can do. |
| 4484 | |
Scott James Remnant | 3820ef0 | 2007-02-16 16:15:18 +0000 | [diff] [blame] | 4485 | 2007-02-16 Scott James Remnant <scott@netsplit.com> |
| 4486 | |
Scott James Remnant | 7d72c6a | 2007-02-16 18:25:04 +0000 | [diff] [blame] | 4487 | * nih/tree.c (nih_tree_next, nih_tree_prev): Add non-recursive |
| 4488 | functions to iterate a tree in-order either forwards or backwards. |
| 4489 | * nih/tree.h (NIH_TREE_FOREACH): Standard macro for wrapping |
| 4490 | nih_tree_next and turning it into a for loop. |
| 4491 | * nih/tests/test_tree.c (test_next, test_foreach, test_prev): Test |
| 4492 | things with a complex tree to see whether they work out ok. |
| 4493 | |
Scott James Remnant | b365aa9 | 2007-02-16 16:15:24 +0000 | [diff] [blame] | 4494 | * nih/list.h: Fix formatting and ordering. |
| 4495 | * nih/list.c: Fix function ordering. |
| 4496 | |
Scott James Remnant | 3820ef0 | 2007-02-16 16:15:18 +0000 | [diff] [blame] | 4497 | * nih/tree.c: Add generic code to implement pure binary trees. |
| 4498 | * nih/tree.h: Structures, typedefs and prototypes. |
| 4499 | * nih/tests/test_tree.c: Binary tree test suite. |
| 4500 | * nih/libnih.h: Include tree.h |
| 4501 | * nih/Makefile.am (libnih_la_SOURCES): Build and link tree.c |
| 4502 | (nihinclude_HEADERS): Install tree.h |
| 4503 | (TESTS): Build and run binary tree test suite. |
| 4504 | (test_tree_SOURCES, test_tree_LDFLAGS, test_tree_LDADD): Details for |
| 4505 | binary tree test suite binary. |
| 4506 | |
Scott James Remnant | bcfe9c5 | 2007-02-15 17:02:00 +0000 | [diff] [blame] | 4507 | 2007-02-15 Scott James Remnant <scott@netsplit.com> |
| 4508 | |
| 4509 | * nih/watch.c (INOTIFY_EVENTS): Use IN_CLOSE_WRITE instead of |
| 4510 | IN_MODIFY; since that guarantees the file has actually been closed, |
| 4511 | and is probably on the filesystem now. |
| 4512 | |
Scott James Remnant | 7b820c9 | 2007-02-13 15:38:16 +0000 | [diff] [blame] | 4513 | 2007-02-13 Scott James Remnant <scott@netsplit.com> |
| 4514 | |
Scott James Remnant | 24a7f32 | 2007-02-13 18:00:04 +0000 | [diff] [blame] | 4515 | * nih/signal.c: Add SIGUNUSED to the list of signals that might not |
| 4516 | exist. |
| 4517 | |
Scott James Remnant | 482c5f5 | 2007-02-13 15:42:53 +0000 | [diff] [blame] | 4518 | * nih/tests/test_option.c (test_parser): gcc doesn't like using |
| 4519 | variables inside fixed for loops, so initialise it deliberately. |
| 4520 | * nih/tests/test_command.c (test_help): Was mistakenly repeatedly |
| 4521 | opening output. |
| 4522 | (test_parser): Similar for loop issue. |
| 4523 | |
Scott James Remnant | 7b820c9 | 2007-02-13 15:38:16 +0000 | [diff] [blame] | 4524 | * nih/signal.c: Update signal name list, some signals don't exist on |
| 4525 | sparc and some turn up unexpectedly. |
| 4526 | |
Johan Kiviniemi | 2b33612 | 2007-02-11 17:27:19 +0200 | [diff] [blame] | 4527 | 2007-02-11 Johan Kiviniemi <johan@kiviniemi.name> |
| 4528 | |
| 4529 | * nih/hash.h (NIH_HASH_FOREACH, NIH_HASH_FOREACH_SAFE): Added missing |
Scott James Remnant | dbd6c3b | 2007-02-11 17:01:25 +0000 | [diff] [blame] | 4530 | parenthesis around hash, in case it's a complicated expression with |
| 4531 | unsurprising precedence results. |
Johan Kiviniemi | 2b33612 | 2007-02-11 17:27:19 +0200 | [diff] [blame] | 4532 | |
Scott James Remnant | 005d6b3 | 2007-02-11 13:48:25 +0000 | [diff] [blame] | 4533 | 2007-02-11 Scott James Remnant <scott@netsplit.com> |
| 4534 | |
Scott James Remnant | c3c2cd9 | 2007-02-11 16:36:03 +0000 | [diff] [blame] | 4535 | * nih/config.c (nih_config_skip_whitespace): It turns out that when |
| 4536 | parsing, it's often useful to skip any whitespace while retaining the |
| 4537 | "step over newlines" behaviour. Seperate it out into its own |
| 4538 | function. |
| 4539 | (nih_config_next_token): Call the new function. |
| 4540 | * nih/config.h: Add prototype. |
| 4541 | * nih/tests/test_config.c (test_skip_whitespace): Check the function |
| 4542 | |
Scott James Remnant | 66869da | 2007-02-11 14:04:01 +0000 | [diff] [blame] | 4543 | * nih/config.c: Remove macro definitions |
| 4544 | * nih/config.h: and make them public instead |
| 4545 | * nih/tests/test_config.c: Use macros. |
| 4546 | |
Scott James Remnant | 7c91a1b | 2007-02-11 14:00:51 +0000 | [diff] [blame] | 4547 | * nih/config.c (nih_config_next_token): Strange hybrid function, |
| 4548 | it behaves like next_arg() but accepts the same arguments as token(); |
| 4549 | it skips whitespace, but only if the initial whitespace character is |
| 4550 | in the delim argument. |
| 4551 | (nih_config_next_arg): This becomes a wrapper around next_token. |
| 4552 | * nih/config.h: Add prototype. |
| 4553 | * nih/tests/test_config.c (test_next_token): Check the new function. |
| 4554 | |
Scott James Remnant | 005d6b3 | 2007-02-11 13:48:25 +0000 | [diff] [blame] | 4555 | * nih/config.c (nih_config_next_token): Rename to nih_config_token, |
| 4556 | since this doesn't behave like the next_arg() function, and we want |
| 4557 | a similar token function that behaves like that. |
| 4558 | * nih/config.h: Update. |
| 4559 | * nih/tests/test_config.c (test_next_token): Rename and update. |
| 4560 | |
Scott James Remnant | a65f90a | 2007-02-09 04:54:25 +0000 | [diff] [blame] | 4561 | 2007-02-09 Scott James Remnant <scott@netsplit.com> |
| 4562 | |
Scott James Remnant | 0b041a8 | 2007-02-09 17:30:41 +0000 | [diff] [blame] | 4563 | * nih/hash.h (NIH_HASH_FOREACH_SAFE): Oops, s/list/hash/ |
| 4564 | |
Scott James Remnant | 5838603 | 2007-02-09 17:02:20 +0000 | [diff] [blame] | 4565 | * nih/hash.h (NIH_HASH_FOREACH, NIH_HASH_FOREACH_SAFE): Add macros |
| 4566 | to iterate over an entire hash table. |
| 4567 | * nih/tests/test_hash.c (test_foreach, test_foreach_safe): Test the |
| 4568 | macros. |
| 4569 | |
Scott James Remnant | d2ea67d | 2007-02-09 16:46:45 +0000 | [diff] [blame] | 4570 | * nih/hash.c (nih_hash_string_key): Add a useful function to return |
| 4571 | the first member after the list header. |
| 4572 | * nih/hash.h: Add prototype. |
| 4573 | * nih/tests/test_hash.c (test_string_key): Add test case. |
| 4574 | |
Scott James Remnant | a65f90a | 2007-02-09 04:54:25 +0000 | [diff] [blame] | 4575 | * nih/file.c (nih_file_is_packaging): Check for common packaging |
| 4576 | filenames -- I swore I wrote this, but I can't find it. |
| 4577 | (nih_file_ignore): Ignore packaging files. |
| 4578 | * nih/file.h: Update. |
| 4579 | * nih/tests/test_file.c (test_is_packaging, test_ignore): Test. |
| 4580 | |
Scott James Remnant | 6538fed | 2007-02-07 02:12:14 +0000 | [diff] [blame] | 4581 | 2007-02-07 Scott James Remnant <scott@netsplit.com> |
| 4582 | |
| 4583 | * nih/logging.c (nih_logger_printf): Change printf logger to not |
| 4584 | prefix anything intended for stdout. |
| 4585 | * nih/logging.h: Rearrange. |
| 4586 | * nih/tests/test_logging.c (test_logger_printf): Make sure that |
| 4587 | we don't prefix the program name for messages that go to stdout. |
| 4588 | |
Scott James Remnant | 5467de2 | 2007-02-06 11:40:33 +0000 | [diff] [blame] | 4589 | 2007-02-06 Scott James Remnant <scott@netsplit.com> |
| 4590 | |
Scott James Remnant | 5ddca83 | 2007-02-06 23:39:10 +0000 | [diff] [blame] | 4591 | * nih/signal.c (nih_signal_from_name): Table changed to not contain |
| 4592 | SIG, so this now strips it off the front if present. |
| 4593 | * nih/tests/test_signal.c (test_to_name): Strip SIG from the front |
| 4594 | (test_from_name): Check that we can omit SIG from the front. |
| 4595 | |
Scott James Remnant | a057437 | 2007-02-06 23:33:41 +0000 | [diff] [blame] | 4596 | * nih/signal.c (nih_signal_to_name, nih_signal_from_name): Functions |
| 4597 | annoyingly missing from the standard library; convert signal names |
| 4598 | and numbers between each other (e.g. SIGTERM -> 15). |
| 4599 | * nih/signal.h: Add prototypes. |
| 4600 | * nih/tests/test_signal.c (test_to_name, test_from_name): Put the |
| 4601 | new functions through their paces. |
| 4602 | |
Scott James Remnant | c16ef2a | 2007-02-06 14:26:20 +0000 | [diff] [blame] | 4603 | * nih/string.c (nih_str_array_add, nih_str_array_addn): Correct leak |
| 4604 | when array allocation fails. |
| 4605 | |
Scott James Remnant | c2c42f5 | 2007-02-06 13:14:24 +0000 | [diff] [blame] | 4606 | * nih/string.c (nih_str_array_add, nih_str_array_addn) |
| 4607 | (nih_str_array_addp): Allow the array pointed to to be NULL, after all, |
| 4608 | realloc works anyway. Also allow len to be NULL, in which case, we |
| 4609 | count the elements automatically. |
| 4610 | * nih/tests/test_string.c (test_array_addp): Update test cases. |
| 4611 | |
Scott James Remnant | eadc99e | 2007-02-06 12:44:12 +0000 | [diff] [blame] | 4612 | * nih/config.c (nih_config_parse_args): Use nih_str_array functions. |
| 4613 | * nih/file.c (nih_dir_walk_scan): Use nih_str_array functions. |
| 4614 | * nih/option.c (nih_option_parser): Use nih_str_array functions. |
| 4615 | (nih_option_add_arg): Drop this function now. |
| 4616 | |
Scott James Remnant | f953c4e | 2007-02-06 12:28:58 +0000 | [diff] [blame] | 4617 | * nih/string.c (nih_str_array_addp): Yet another variation on a theme; |
| 4618 | this one saves duplicating allocs, which is always messy. |
| 4619 | (nih_str_array_addn): Wrap around the above function. |
| 4620 | (nih_str_array_add): Make this a wrapper around addp instead. |
| 4621 | * nih/string.h: Update. |
| 4622 | * nih/tests/test_string.c (test_array_addp): Check that one works. |
| 4623 | |
Scott James Remnant | d55a13e | 2007-02-06 12:13:41 +0000 | [diff] [blame] | 4624 | * nih/string.c (nih_str_split): Use nih_str_array functions. |
| 4625 | |
Scott James Remnant | a839df5 | 2007-02-06 12:09:48 +0000 | [diff] [blame] | 4626 | * nih/string.c (nih_str_array_addn): Add a version of nih_str_array_add |
| 4627 | that calls nih_strndup instead of nih_strdup. |
| 4628 | (nih_str_array_add): turn into a thin wrapper around the above. |
| 4629 | * nih/string.h: Update. |
| 4630 | * nih/tests/test_string.c (test_array_addn): Test new function. |
| 4631 | |
Scott James Remnant | 7d2b90d | 2007-02-06 12:06:36 +0000 | [diff] [blame] | 4632 | * nih/string.c (nih_str_array_add): Flip array and parent arguments |
| 4633 | to make it more like realloc. |
| 4634 | * nih/string.h: Update. |
| 4635 | * nih/tests/test_string.c (test_array_add): Update. |
| 4636 | |
Scott James Remnant | 3e7d905 | 2007-02-06 12:03:20 +0000 | [diff] [blame] | 4637 | * nih/string.c (nih_str_array_new, nih_str_array_add): Functions |
| 4638 | to handle the common cases of arrays of strings. |
| 4639 | * nih/string.h: Update. |
| 4640 | * nih/tests/test_string.c (test_array_new, test_array_add): Test. |
| 4641 | |
Scott James Remnant | 5467de2 | 2007-02-06 11:40:33 +0000 | [diff] [blame] | 4642 | * nih/watch.c (nih_watch_handle): Never assert on data received from |
| 4643 | an untrusted source (well, the kernel, anyway). Also make sure nobody |
| 4644 | sneaks a '/' into the name of an inotify event. |
| 4645 | |
Scott James Remnant | 15fbe67 | 2007-02-05 22:13:28 +0000 | [diff] [blame] | 4646 | 2007-02-05 Scott James Remnant <scott@netsplit.com> |
| 4647 | |
| 4648 | * nih/string.c (nih_vsprintf): Make sure vsnprintf never returns |
| 4649 | a negative value; C99 says it can't, of course, but Kees was |
| 4650 | paranoid. |
| 4651 | |
Scott James Remnant | 0f9e01c | 2007-02-03 11:31:59 +0000 | [diff] [blame] | 4652 | 2007-02-03 Scott James Remnant <scott@netsplit.com> |
| 4653 | |
Scott James Remnant | 6dd4389 | 2007-02-03 23:42:26 +0000 | [diff] [blame] | 4654 | * nih/watch.c (nih_watch_new): Tidy up ENOMEM loop. |
| 4655 | |
Scott James Remnant | 9794397 | 2007-02-03 18:36:14 +0000 | [diff] [blame] | 4656 | * nih/tests/test_file.c (test_dir_walk): Fix leak of directory caused |
| 4657 | by not removing a symlink. |
| 4658 | * nih/tests/test_watch.c (test_new, test_add): Fix leaks of |
| 4659 | directories caused by not changing permissions back so we can unlink |
| 4660 | under them. |
| 4661 | |
Scott James Remnant | 8630d28 | 2007-02-03 17:24:11 +0000 | [diff] [blame] | 4662 | * nih/watch.h (NihCreateHandler, NihModifyHandler): Add stat argument. |
| 4663 | * nih/watch.c (nih_watch_handle): stat any object created or modified, |
| 4664 | and pass the stat buf to the handler function. |
| 4665 | (nih_watch_add_visitor): Pass stat argument here too. |
| 4666 | |
| 4667 | * nih/tests/test_watch.c: Add arguments. |
| 4668 | |
Scott James Remnant | 28d252e | 2007-02-03 15:35:38 +0000 | [diff] [blame] | 4669 | * nih/option.c (nih_option_int): Function to parse integer values |
| 4670 | on the command line. |
| 4671 | * nih/option.h: Add prototype. |
| 4672 | * nih/tests/test_option.c (test_int): test case for it. |
| 4673 | |
Scott James Remnant | 0f9e01c | 2007-02-03 11:31:59 +0000 | [diff] [blame] | 4674 | * nih/file.c (nih_file_is_hidden, nih_file_is_backup) |
| 4675 | (nih_file_is_swap, nih_file_is_rcs): Functions to match common |
| 4676 | file types by their path. |
| 4677 | (nih_file_ignore): Function to combine calls to all of the above. |
| 4678 | * nih/file.h: Add prototypes. |
| 4679 | * nih/tests/test_file.c: Add test cases for the new functions. |
| 4680 | * TODO: Update. |
| 4681 | |
Scott James Remnant | 98b9ddb | 2007-02-02 16:24:37 +0000 | [diff] [blame] | 4682 | 2007-02-02 Scott James Remnant <scott@netsplit.com> |
| 4683 | |
Scott James Remnant | bfe1c79 | 2007-02-02 19:34:09 +0000 | [diff] [blame] | 4684 | * TODO: Update. |
| 4685 | |
Scott James Remnant | 700ea52 | 2007-02-02 19:31:41 +0000 | [diff] [blame] | 4686 | * nih/watch.c (nih_watch_new): Add a create argument to avoid |
| 4687 | walking a directory tree twice; store in the structure. |
| 4688 | (nih_watch_add_visitor): Call the create handler if necessary. |
| 4689 | * nih/watch.h: Update structure to include member and prototype. |
| 4690 | * nih/tests/test_watch.c (test_new): Check that, when called with |
| 4691 | create, the handler is called for each file that exists. |
| 4692 | (test_reader): Check that a directory is recursed when moved in |
| 4693 | or created with existing files. |
| 4694 | |
Scott James Remnant | 0b2a85f | 2007-02-02 17:29:40 +0000 | [diff] [blame] | 4695 | * nih/tests/test_watch.c (test_reader): Add test case for watching |
| 4696 | sub-directories again. |
| 4697 | |
Scott James Remnant | 387453f | 2007-02-02 17:22:07 +0000 | [diff] [blame] | 4698 | * nih/watch.c (nih_watch_new, nih_watch_add): Make safe against |
| 4699 | ENOMEM; otherwise it's just tricky to decide when it's good and bad |
| 4700 | to throw things out. |
| 4701 | * nih/tests/test_watch.c: Update test cases accordingly. |
| 4702 | |
Scott James Remnant | f88eeff | 2007-02-02 17:12:05 +0000 | [diff] [blame] | 4703 | * nih/watch.c (nih_watch_add): It's not an error for subdirs to be |
| 4704 | TRUE when we get passed a filename. |
| 4705 | * nih/tests/test_watch.c (test_add): Check that it works. |
| 4706 | |
Scott James Remnant | d1e8b40 | 2007-02-02 17:04:38 +0000 | [diff] [blame] | 4707 | * nih/file.c (nih_dir_walk): Initialise ret to zero, otherwise |
| 4708 | can return an uninitialised value when walking an empty directory. |
| 4709 | |
Scott James Remnant | 9a37179 | 2007-02-02 17:01:43 +0000 | [diff] [blame] | 4710 | * nih/tests/test_child.c (test_poll): Reap the child we kill, |
| 4711 | otherwise the next test might fail sometimes. |
| 4712 | |
Scott James Remnant | 80598b7 | 2007-02-02 16:58:49 +0000 | [diff] [blame] | 4713 | * nih/watch.c (nih_watch_add): Make being unable to recurse into |
| 4714 | sub-directories to watch them an error. |
| 4715 | * nih/tests/test_watch.c (test_new, test_add): Update test cases. |
| 4716 | |
Scott James Remnant | 98b9ddb | 2007-02-02 16:24:37 +0000 | [diff] [blame] | 4717 | * nih/file.c (nih_dir_walk): Rework this function to support |
| 4718 | detection of directory loops, and reporting of errors with a callback |
| 4719 | handler rather than just aborting the walk. |
| 4720 | (nih_dir_walk_scan): Build up a sorted list of paths under a directory, |
| 4721 | filtered with the filter function. Split out because it has different |
| 4722 | error handling semantics. |
| 4723 | (nih_dir_walk_visit): Visit a single path and if it's a directory, |
| 4724 | descend into it. |
| 4725 | * nih/file.h (NihFileVisitor): Add arguments to pass the top-level |
| 4726 | directory and the stat buffer of the path (to avoid stating the same |
| 4727 | things multiple times). |
| 4728 | (NihFileErrorHandler): Duplicate prototype for the error handler. |
| 4729 | * nih/errors.h (NIH_DIR_LOOP_DETECTED): Add new error. |
| 4730 | * nih/tests/test_file.c (test_dir_walk): Update test cases, improving |
| 4731 | test coverage at the same time. |
| 4732 | * nih/watch.c (nih_watch_add_visitor): Update to check the stat |
| 4733 | passed to the visitor, as well as accept the directory name, |
| 4734 | |
Scott James Remnant | e9a05d9 | 2007-02-01 17:21:06 +0000 | [diff] [blame] | 4735 | 2007-02-01 Scott James Remnant <scott@netsplit.com> |
| 4736 | |
Scott James Remnant | e0a1380 | 2007-02-01 17:24:25 +0000 | [diff] [blame] | 4737 | * nih/tests/test_io.c: Replace NIH_ZERO in test cases with assert0 |
| 4738 | |
Scott James Remnant | de33f51 | 2007-02-01 17:21:27 +0000 | [diff] [blame] | 4739 | * nih/tests/test_main.c (test_main_loop): Eliminate use of NIH_MUST |
| 4740 | * nih/tests/test_io.c (test_watcher): Remove unnecessary NIH_MUST |
| 4741 | |
Scott James Remnant | e9a05d9 | 2007-02-01 17:21:06 +0000 | [diff] [blame] | 4742 | * nih/test.h (assert0): Add an assert wrapper for the common |
| 4743 | alternate case. |
| 4744 | |
Scott James Remnant | 3e48360 | 2007-01-30 11:01:21 +0000 | [diff] [blame] | 4745 | 2007-01-30 Scott James Remnant <scott@netsplit.com> |
| 4746 | |
Scott James Remnant | 4535297 | 2007-01-30 12:17:59 +0000 | [diff] [blame] | 4747 | * nih/io.c (nih_io_buffer_resize): Always keep a buffer filled with |
| 4748 | zeros when we extend it, so we never pass uninitialised data to |
| 4749 | syscalls. |
| 4750 | |
Scott James Remnant | 0d1d420 | 2007-01-30 12:07:27 +0000 | [diff] [blame] | 4751 | * m4/misc.m4 (NIH_INIT): Detect valgrind/valgrind.h |
| 4752 | * nih/tests/test_signal.c: Detect valgrind and don't check the error |
| 4753 | values from trying to set SIG_DFL or SIG_IGN for SIGKILL; which for |
| 4754 | no readily apparent reason, works under valgrind. |
| 4755 | |
Scott James Remnant | d78b814 | 2007-01-30 11:51:59 +0000 | [diff] [blame] | 4756 | * HACKING: Add newline to end of file. |
| 4757 | |
Scott James Remnant | 5db5426 | 2007-01-30 11:48:42 +0000 | [diff] [blame] | 4758 | * nih/test.h (TEST_ALLOC_SAFE): Add macro to guard allocations so |
| 4759 | they aren't counted. |
| 4760 | * nih/tests/test_file.c (my_visitor, test_dir_walk): Use |
| 4761 | TEST_ALLOC_SAFE instead of changing the allocator by hand. |
| 4762 | * nih/tests/test_io.c (test_watcher): Use TEST_ALLOC_SAFE instead of |
| 4763 | changing the allocator by hand, |
| 4764 | |
Scott James Remnant | 3a11613 | 2007-01-30 11:41:19 +0000 | [diff] [blame] | 4765 | * nih/macros.h (NIH_MUST_NOT): Rename to NIH_ZERO |
| 4766 | * nih/io.c (nih_io_message_recv): Use NIH_ZERO, instead of == 0 |
| 4767 | * nih/main.c (nih_main_loop_init): Use NIH_ZERO, instead of == 0 |
| 4768 | * nih/tests/test_io.c: Use NIH_ZERO not NIH_MUST...== 0 |
| 4769 | |
Scott James Remnant | 6939ebb | 2007-01-30 11:32:05 +0000 | [diff] [blame] | 4770 | * nih/tests/test_io.c (test_watcher): Ensure that we don't ignore |
| 4771 | the return value from nih_io_printf; but also don't fail it. |
| 4772 | |
Scott James Remnant | 9753674 | 2007-01-30 11:29:44 +0000 | [diff] [blame] | 4773 | * HACKING: Clarify that returning to indicate insufficient memory |
| 4774 | warrants warn_unused_result. |
| 4775 | |
Scott James Remnant | 08463f3 | 2007-01-30 11:28:21 +0000 | [diff] [blame] | 4776 | * nih/io.h: Add warn_unused_result attribute to nih_io_printf. |
| 4777 | * nih/string.c: Correct doc strings. |
| 4778 | |
Scott James Remnant | 0d01e7f | 2007-01-30 11:10:44 +0000 | [diff] [blame] | 4779 | * nih/string.c (nih_vsprintf): We need to copy the arguments before |
| 4780 | iterating either time, otherwise we could return NULL after moving |
| 4781 | the current argument off the end. |
| 4782 | |
Scott James Remnant | 3e48360 | 2007-01-30 11:01:21 +0000 | [diff] [blame] | 4783 | * TODO: Update. |
| 4784 | |
Scott James Remnant | f7d81e9 | 2007-01-22 09:51:17 +0800 | [diff] [blame] | 4785 | 2007-01-22 Scott James Remnant <scott@netsplit.com> |
| 4786 | |
Scott James Remnant | 6d0c298 | 2007-01-22 05:22:20 +0000 | [diff] [blame] | 4787 | * nih/io.c (nih_io_reopen): Raises an error (usually ENOMEM), since |
| 4788 | it can also raise EBADF. |
| 4789 | * nih/tests/test_io.c (test_reopen): Make sure ENOMEM is raised. |
| 4790 | * nih/watch.c: New watch API, this is a little higher level than |
| 4791 | what previously existing in nih/file.c; but is substantially easier |
| 4792 | to use and should cover all of the corner cases. |
| 4793 | (INOTIFY_EVENTS): inotify events we always watch for. |
| 4794 | (nih_watch_new): The master function; this creates a new inotify |
| 4795 | instance and adds a watch for a path in it. |
| 4796 | (nih_watch_handle_by_wd): Obtain a watch handle by descriptor |
| 4797 | (nih_watch_handle_by_path): Obtain a watch handle by path |
| 4798 | (nih_watch_add): Another useful function, adds a second path to |
| 4799 | an existing watch; normally used just for sub-directories, but |
| 4800 | possible for anything. |
| 4801 | (nih_watch_add_visitor): nih_dir_walk() callback that calls the above |
| 4802 | (nih_watch_free): Free a watch, and the associated NihIo; closing the |
| 4803 | inotify descriptor. |
| 4804 | (nih_watch_reader): Reader function; handles the incoming stream of |
| 4805 | inotify events by locating the watch handle and dispatching through |
| 4806 | (nih_watch_handle): this function which handles all the various |
| 4807 | event ordering corner-cases and dispatches to the watch functions |
| 4808 | proper. |
| 4809 | * nih/watch.h: Typedefs, structures and prototypes for the new watch |
| 4810 | API. |
| 4811 | * nih/tests/test_watch.c: Test suite for the watch code; covers most |
| 4812 | of the paths -- though malloc checking here is tricky and could do |
| 4813 | with improving later. |
| 4814 | * nih/libnih.h: Include nih/watch.h |
| 4815 | * nih/Makefile.am (libnih_la_SOURCES): Build and link watch.c |
| 4816 | (nihinclude_HEADERS): Install watch.h |
| 4817 | (TESTS): Build and run watch test suite |
| 4818 | (test_watch_SOURCES, test_watch_LDFLAGS, test_watch_LDADD): Details |
| 4819 | for watch test suite binary. |
| 4820 | |
Scott James Remnant | a8b296e | 2007-01-22 03:59:51 +0000 | [diff] [blame] | 4821 | * nih/file.c: Strip out anything related to inotify, leaving us |
| 4822 | with just three functions; nih_file_map(), nih_file_unmap() and |
| 4823 | nih_dir_walk(). Others that will turn up here will be matching |
| 4824 | and filtering functions. |
| 4825 | * nih/file.h: Strip out typedefs, structures and prototypes for |
| 4826 | anything watch-related; add attributes to functions as necessary. |
| 4827 | * nih/tests/test_file.c: Remove watch-related test cases, and |
| 4828 | use TEST_ALLOC_FAIL for test_dir_walk(). |
| 4829 | |
Scott James Remnant | 9508a7c | 2007-01-22 03:01:24 +0000 | [diff] [blame] | 4830 | * nih/tests/test_io.c (test_shutdown): Test NIH_IO_MESSAGE using |
| 4831 | AF_UNIX socketpairs, not pipes. |
| 4832 | |
Scott James Remnant | 4a5db84 | 2007-01-22 02:47:50 +0000 | [diff] [blame] | 4833 | * HACKING: Document the requirements for function attributes and |
| 4834 | using TEST_ALLOC_FAIL in test cases. |
| 4835 | * TODO: Update. |
| 4836 | |
Scott James Remnant | b73a3e5 | 2007-01-22 02:38:28 +0000 | [diff] [blame] | 4837 | * nih/tests/test_signal.c (test_set_handler): Check that SIGCHLD |
| 4838 | gets the SA_NOCLDSTOP flag, and that SIGKILL returns an error. |
| 4839 | (test_set_default, test_set_ignore): Check SIGKILL returns error. |
| 4840 | |
Scott James Remnant | 7568b08 | 2007-01-22 02:37:57 +0000 | [diff] [blame] | 4841 | * nih/tests/test_option.c (test_parser): Check that duplicated |
| 4842 | options result in the previous string being freed. |
| 4843 | |
Scott James Remnant | 397ca83 | 2007-01-22 02:27:25 +0000 | [diff] [blame] | 4844 | * nih/main.c (nih_main_daemonise): SIGHUP can always be ignored. |
| 4845 | |
Scott James Remnant | 13c76e1 | 2007-01-22 02:27:03 +0000 | [diff] [blame] | 4846 | * nih/tests/test_io.c (test_reopen): Make sure that we can't reopen |
| 4847 | a closed file descriptor. |
| 4848 | (test_set_nonblock, test_set_cloexec): Check with closed descriptors. |
| 4849 | |
Scott James Remnant | 47e438c | 2007-01-22 02:18:10 +0000 | [diff] [blame] | 4850 | * nih/config.c: When we call nih_config_skip_comment, we can usually |
| 4851 | assert that this will never fail; so do so. |
| 4852 | |
Scott James Remnant | a178854 | 2007-01-22 02:07:49 +0000 | [diff] [blame] | 4853 | * nih/tests/test_command.c (test_help): Check a few missing pieces |
| 4854 | of the command help output to make sure it's right. |
| 4855 | |
Scott James Remnant | 4afd8c4 | 2007-01-22 01:56:32 +0000 | [diff] [blame] | 4856 | * nih/file.c (nih_dir_walk): Correct doc string to indicate that |
| 4857 | this function raises errors. |
| 4858 | |
Scott James Remnant | f7d81e9 | 2007-01-22 09:51:17 +0800 | [diff] [blame] | 4859 | * nih/alloc.h: Fix prototype orders. |
| 4860 | * nih/child.h: Add attributes to important return values. |
| 4861 | * nih/config.c: Add attributes to important return values. |
| 4862 | * nih/config.h: Add attributes to important return values. |
| 4863 | * nih/error.h: Add attributes to important return values. |
| 4864 | * nih/io.h: Add attributes to important return values. |
| 4865 | * nih/main.h: Add attributes to important return values. |
| 4866 | * nih/signal.h: Add attributes to important return values. |
| 4867 | * nih/string.h: Add attributes to important return values. |
| 4868 | * nih/timer.h: Add attributes to important return values. |
| 4869 | * nih/io.c (nih_io_reopen): Don't ignore failure to ignore SIGPIPE. |
| 4870 | (nih_io_set_cloexec, nih_io_set_nonblock): The only useful errors |
| 4871 | returned is EBADF, so just return -1 for that. |
| 4872 | * nih/main.c (nih_main_daemonise): Don't ignore failure to ignore |
| 4873 | SIGHUP. |
| 4874 | * nih/signal.c (nih_signal_set_handler, nih_signal_set_default) |
| 4875 | (nih_signal_set_ignore): The only useful error sigaction returns |
| 4876 | is EINVAL, so just return -1. |
| 4877 | (nih_signal_reset): Ignore EINVAL errors. |
| 4878 | * nih/tests/test_io.c: Use NIH_MUST around function calls that |
| 4879 | can fail. |
| 4880 | * nih/tests/test_main.c: Use NIH_MUST around function calls that |
| 4881 | can fail. |
| 4882 | |
Scott James Remnant | db1ce70 | 2007-01-21 19:49:36 +0800 | [diff] [blame] | 4883 | 2007-01-21 Scott James Remnant <scott@netsplit.com> |
| 4884 | |
| 4885 | * nih/test.h (TEST_ALLOC_FAIL): Macro that loops over a block of code |
| 4886 | as many times as malloc is called within it, causing each malloc in |
| 4887 | turn to be failed so we can increase code coverage. |
| 4888 | (nih_test_allocator): Support function for the above; allows dumping |
| 4889 | of malloc calls. |
| 4890 | * nih/tests/test_child.c (test_add_watch): Use TEST_ALLOC_FAIL |
| 4891 | and call nih_child_poll() first to not debug the init function |
| 4892 | (test_poll): Remove race conditions by making sure the signal |
| 4893 | has reached the child using waitid(). Test the "child we don't |
| 4894 | know about has died" branch, along with waitid returning 0 with no |
| 4895 | pid (needs a child process). |
| 4896 | * nih/tests/test_command.c (test_parser, test_help): Use |
| 4897 | TEST_ALLOC_FAIL |
| 4898 | * nih/tests/test_config.c (test_next_arg, test_parse_args) |
| 4899 | (test_parse_command, test_parse_block): Use TEST_ALLOC_FAIL |
| 4900 | * nih/tests/test_error.c (test_raise, test_raise_printf) |
| 4901 | (test_push_context, test_return_error): Use TEST_ALLOC_FAIL, to |
| 4902 | make sure allocations are retried. |
| 4903 | (test_pop_context): Split out from test_push_context. |
| 4904 | * nih/tests/test_hash.c (test_new): Use TEST_ALLOC_FAIL |
| 4905 | * nih/tests/test_io.c (test_add_watch, test_buffer_new) |
| 4906 | (test_buffer_resize, test_buffer_pop, test_buffer_shrink) |
| 4907 | (test_buffer_push, test_message_new, test_message_add_control) |
| 4908 | (test_message_recv, test_message_send, test_reopen, test_watcher) |
| 4909 | (test_read, test_write, test_get, test_printf): Use TEST_ALLOC_FAIL |
| 4910 | liberally, make sure every code path involving a malloc gets tested. |
| 4911 | * nih/tests/test_list.c (test_new): Use TEST_ALLOC_FAIL |
| 4912 | * nih/tests/test_logging.c (test_log_message): Use TEST_ALLOC_FAIL |
| 4913 | * nih/tests/test_main.c (test_main_loop_add_func): Use TEST_ALLOC_FAIL |
| 4914 | (test_package_string): Use TEST_ALLOC_FAIL and also check repeated |
| 4915 | calls return the same string. |
| 4916 | (test_version): Use TEST_ALLOC_FAIL to check that allocation can |
| 4917 | never fail. |
| 4918 | * nih/tests/test_option.c (test_parser, test_version, test_help): |
| 4919 | Use TEST_ALLOC_FAIL to make sure we behave |
| 4920 | * nih/tests/test_signal.c (test_add_handler): Use TEST_ALLOC_FAIL |
| 4921 | and call nih_signal_poll() first to not debug the init function |
| 4922 | * nih/tests/test_string.c (test_sprintf, test_vsprintf) |
| 4923 | (test_strdup, test_strndup, test_str_split, test_str_wrap) |
| 4924 | (test_str_screen_wrap): Use TEST_ALLOC_FAIL |
| 4925 | (test_str_screen_width): Check that we discard an illegal columns |
| 4926 | variable. |
| 4927 | * nih/tests/test_timer.c (test_add_timeout, test_add_periodic) |
| 4928 | (test_add_scheduled): Use TEST_ALLOC_FAIL and call nih_timer_poll() |
| 4929 | first to make sure we don't debug the init function |
| 4930 | * nih/config.c (nih_config_next_arg, nih_config_parse_args) |
| 4931 | (nih_config_parse_command, nih_config_parse_block): Allow us to fail |
| 4932 | reading a configuration file because we run out of memory; it's not |
| 4933 | that important. |
| 4934 | * nih/io.c (nih_io_get): Catch failure to remove the string, and |
| 4935 | don't remove the delimiter if that happens. |
| 4936 | (nih_io_printf): Fix doc, this returns zero, not a length. |
| 4937 | * nih/io.h: Fix prototype of nih_io_printf |
| 4938 | * nih/logging.c (nih_log_message): Potentially failing message output |
| 4939 | is crazy; loop until the alloc succeeds. |
| 4940 | * nih/option.c (nih_option_handle): Free the options and arguments |
| 4941 | before exiting; not really necessary, but makes valgrind happier. |
| 4942 | * nih/string.c (nih_strndup): Failed to correctly detect a failed |
| 4943 | allocation. |
| 4944 | (nih_str_split): Correct some mistakes with allocations not |
| 4945 | being checked. |
| 4946 | * nih/libnih.supp: Add tmpfile. |
| 4947 | * TODO: Update. |
| 4948 | |
Scott James Remnant | 9156abc | 2007-01-11 02:05:14 +0000 | [diff] [blame] | 4949 | 2007-01-11 Scott James Remnant <scott@netsplit.com> |
| 4950 | |
| 4951 | * nih/file.h (NihDirWatch): New structure that defines a high-level |
| 4952 | watch on a directory with various handlers to be called. |
| 4953 | (NihCreateHandler, NihChangeHandler, NihDeleteHandler): Typedefs. |
| 4954 | * nih/file.c (nih_dir_add_watch): Function to create an NihDirWatch |
| 4955 | structure and fill it in. |
| 4956 | (nih_dir_add_file_watch): Add a watch on a single directory, |
| 4957 | catching errors and logging a warning if we can't watch it. |
| 4958 | (nih_dir_watcher): Deal with inotify events within a directory tree, |
| 4959 | taking care of issues such as re-organising of the directory structure |
| 4960 | without ending up with duplicate watches. |
| 4961 | (nih_file_reader): Only call the first matching watcher; we hit a |
| 4962 | limitation in the inotify API caused by our usage of a single |
| 4963 | descriptor. Will fix that shortly. |
| 4964 | * nih/tests/test_file.c (test_dir_add_watch): Test that we can add |
| 4965 | watches and have everything filled in nicely. |
| 4966 | |
Scott James Remnant | 097784a | 2007-01-10 19:12:15 +0000 | [diff] [blame] | 4967 | 2007-01-10 Scott James Remnant <scott@netsplit.com> |
| 4968 | |
Scott James Remnant | a33dcf1 | 2007-01-10 23:26:10 +0000 | [diff] [blame] | 4969 | * nih/file.c (nih_dir_walk): Function to walk a directory tree |
| 4970 | calling a function for each object found. |
| 4971 | * nih/file.h (NihFileFilter, NihFileVisitor): typedefs for |
| 4972 | function pointers used for nih_dir_walk. |
| 4973 | * nih/tests/test_file.c (test_walk): Test the walker. |
| 4974 | |
Scott James Remnant | 38c4555 | 2007-01-10 22:51:57 +0000 | [diff] [blame] | 4975 | * nih/file.c (nih_file_reader): Pass the cookie to the watcher. |
| 4976 | * nih/file.h (NihFileWatcher): Add cookie argument. |
| 4977 | * nih/tests/test_file.c (test_add_watch): Check the cookie is |
| 4978 | passed for a rename. |
| 4979 | |
Scott James Remnant | 097784a | 2007-01-10 19:12:15 +0000 | [diff] [blame] | 4980 | * nih/file.c (nih_file_add_watch): Fix this to not add the inotify |
| 4981 | watch unless it can allocate memory to handle it. |
| 4982 | |
Scott James Remnant | f3a6248 | 2007-01-09 16:16:47 +0000 | [diff] [blame] | 4983 | 2007-01-09 Scott James Remnant <scott@netsplit.com> |
| 4984 | |
Scott James Remnant | f075fd8 | 2007-01-09 20:11:58 +0000 | [diff] [blame] | 4985 | * nih/config.c (nih_config_get_stanza): Catch entries with a zero |
| 4986 | length name, and return one instead of NULL if it exists. |
| 4987 | * nih/tests/test_config.c (test_parse_stanza): Make sure that "" |
| 4988 | in a stanza table acts as a catch-all. |
| 4989 | |
Scott James Remnant | f3a6248 | 2007-01-09 16:16:47 +0000 | [diff] [blame] | 4990 | * nih/test.h (TEST_FILENAME): Use dashes not colons, to make things |
| 4991 | more clear. |
| 4992 | |
Scott James Remnant | e5234c2 | 2007-01-08 11:39:23 +0000 | [diff] [blame] | 4993 | 2007-01-08 Scott James Remnant <scott@netsplit.com> |
| 4994 | |
Scott James Remnant | 623868b | 2007-01-08 13:19:30 +0000 | [diff] [blame] | 4995 | * nih/config.c (nih_config_has_token): add a very small test function |
| 4996 | so parsers can peek to see whether there is a next argument or not. |
| 4997 | (nih_config_skip_comment, nih_config_parse_args) |
| 4998 | (nih_config_parse_file): Use the new test function to make it more |
| 4999 | obvious what we're doing. |
| 5000 | * nih/config.h: Add prototype. |
| 5001 | * nih/tests/test_config.c (test_has_token): Add test cases. |
| 5002 | |
Scott James Remnant | 32d5be8 | 2007-01-08 12:45:09 +0000 | [diff] [blame] | 5003 | * nih/config.c: Allow all functions to be called with a zero length |
| 5004 | file, we're completely guarded against pos going past the length, |
| 5005 | so this cannot be a bad thing. Plus this allows zero-length tokens |
| 5006 | to be extracted trivially. |
| 5007 | (nih_config_next_arg): Raise an error if called in a position where |
| 5008 | there is no argument. If you want to speculatively check for args, |
| 5009 | peek first. |
| 5010 | (nih_config_parse_stanza): No need to check for an empty stanza now, |
| 5011 | nih_config_next_arg() handles that for us. |
| 5012 | (nih_config_skip_comment): Function to allow us to skip only a |
| 5013 | comment, while raising an error if we hit anything else. |
| 5014 | (nih_config_parse_args, nih_config_parse_command): Skip comment only, |
| 5015 | to guard against parser errors. |
| 5016 | * nih/config.h: Update. |
| 5017 | * nih/tests/test_config.c (test_next_arg): Check the new error is |
| 5018 | raised, instead of the empty string being returned. |
| 5019 | (test_parse_stanza): Check the expected token error is raised. |
| 5020 | (test_skip_comment): Test the new function. |
| 5021 | * nih/errors.h: Add new errors. |
| 5022 | |
Scott James Remnant | 4e6f18f | 2007-01-08 11:39:42 +0000 | [diff] [blame] | 5023 | * nih/errors.h: Fix capitalisation of error messages. |
| 5024 | |
Scott James Remnant | e5234c2 | 2007-01-08 11:39:23 +0000 | [diff] [blame] | 5025 | * nih/tests/test_config.c (test_parse_command): Add missing free |
| 5026 | calls to strings obtained. |
| 5027 | |
Scott James Remnant | 14962b3 | 2007-01-07 03:35:15 +0000 | [diff] [blame] | 5028 | 2007-01-07 Scott James Remnant <scott@netsplit.com> |
| 5029 | |
Scott James Remnant | bf7ed8e | 2007-01-07 21:36:32 +0000 | [diff] [blame] | 5030 | * nih/config.c: Convert this file to use size_t where appropriate |
| 5031 | instead of ssize_t, and raise exceptions for parsing errors rather |
| 5032 | than logging them. |
| 5033 | (nih_config_parse): Check a size is not greater then SSIZE_MAX (2GB) |
| 5034 | to avoid overflows. |
| 5035 | * nih/config.h: Update prototypes and handler function typedef. |
| 5036 | * nih/errors.h: Add new error codes and strings. |
| 5037 | * nih/tests/test_config.c: Adjust test cases. |
| 5038 | |
Scott James Remnant | 2dad869 | 2007-01-07 11:36:43 +0000 | [diff] [blame] | 5039 | * nih/config.c (nih_config_parse_file): Function to parse a mapped |
| 5040 | file or string line-by-line starting from the given position. |
| 5041 | (nih_config_parse): Function to map a file into memory and parse it |
| 5042 | * nih/config.h: Add prototypes. |
| 5043 | * nih/tests/test_config.c (test_parse_file): Test the function with |
| 5044 | a small variety of different valid files. |
| 5045 | (test_parse): Check we can parse a file, and get an error if it |
| 5046 | doesn't exist. |
| 5047 | |
Scott James Remnant | a10a774 | 2007-01-07 03:41:56 +0000 | [diff] [blame] | 5048 | * nih/config.c (nih_config_parse_stanza): Take a data pointer and |
| 5049 | pass it to the handler, otherwise we can't fill in structures. |
| 5050 | * nih/config.h: Update. |
| 5051 | * nih/tests/test_config.c (test_parse_stanza): Check the data |
| 5052 | pointer is passed properly. |
| 5053 | |
Scott James Remnant | 91e0f50 | 2007-01-07 03:38:17 +0000 | [diff] [blame] | 5054 | * nih/tests/test_option.c (test_version, test_help): Capture the |
| 5055 | return value from nih_option_parser, as we've set gcc attributes to |
| 5056 | not let us do otherwise. |
| 5057 | |
Scott James Remnant | 14962b3 | 2007-01-07 03:35:15 +0000 | [diff] [blame] | 5058 | * nih/config.h: Add structures, typedefs and macros to allow lists |
| 5059 | of configuration stanzas to be built up. |
| 5060 | * nih/config.c (nih_config_parse_args): Split argument parsing into |
| 5061 | (nih_config_next_arg): This new function that wraps next_token and |
| 5062 | also skips following whitespace. |
| 5063 | (nih_config_next_line): Another new function that skips to the end |
| 5064 | of the line, replacing severael copies of this code. |
| 5065 | (nih_config_get_stanza): Simple function to find a stanza in a table |
| 5066 | by its name. |
| 5067 | (nih_config_parse_stanza): Simple stanza dispatch function; parses an |
| 5068 | argument at the current position, looks it up in the table, then |
| 5069 | calls the function. |
| 5070 | * nih/tests/test_config.c (test_next_arg): Check this function works, |
| 5071 | we know it does because it was covered by other tests, but it's worth |
| 5072 | having its own as well. |
| 5073 | (test_next_line): Check this function works too. |
| 5074 | (test_parse_stanza): Make sure the dispatcher works properly. |
| 5075 | * nih/config.c: Write from the code that was used for upstart, |
| 5076 | making them exported functions to act as a configuration file kit. |
| 5077 | (nih_config_parse_args): Fix a bug where lineno wasn't incremented |
| 5078 | for an embedded newline in between arguments. Fix another bug where |
| 5079 | a line containing only whitespace or whitespace and a comment would |
| 5080 | hit an assertion - not a problem in practice, but it's a bug. |
| 5081 | * nih/config.h: Function prototypes. |
| 5082 | * nih/libnih.h: Include config.h |
| 5083 | * nih/tests/test_config.c: Write an all new test suite that tests |
| 5084 | the individual parsing functions for their functionality, rather |
| 5085 | than trying to squeeze it into something larger. |
| 5086 | * nih/Makefile.am (libnih_la_SOURCES): Build and link config.c |
| 5087 | (nihinclude_HEADERS): Install config.h |
| 5088 | (TESTS): Build and run config test suite |
| 5089 | (test_config_SOURCES, test_config_LDFLAGS, test_config_LDADD): Config |
| 5090 | test suite binary details. |
| 5091 | |
Scott James Remnant | 939ff8e | 2007-01-06 19:28:37 +0000 | [diff] [blame] | 5092 | 2007-01-06 Scott James Remnant <scott@netsplit.com> |
| 5093 | |
Scott James Remnant | 14962b3 | 2007-01-07 03:35:15 +0000 | [diff] [blame] | 5094 | * nih/tests/test_io.c (test_watcher): Missing a priority that needed |
| 5095 | changing to message. |
| 5096 | |
Scott James Remnant | 68e6f92 | 2007-01-06 21:14:37 +0000 | [diff] [blame] | 5097 | * nih/command.h: Warn against unused results. |
| 5098 | |
Scott James Remnant | 397a060 | 2007-01-06 21:14:13 +0000 | [diff] [blame] | 5099 | * nih/option.h: Warn against unused results. |
| 5100 | |
Scott James Remnant | 939ff8e | 2007-01-06 19:28:37 +0000 | [diff] [blame] | 5101 | * nih/logging.h (NihLogLevel): Add a message level between info |
| 5102 | and warn, as we can't just re-use warn as that goes to stderr! |
| 5103 | (nih_message): Change to use the new message level. |
| 5104 | * nih/logging.c (nih_logger_syslog): Output messages at the notice |
| 5105 | level, rather than the warning level. |
| 5106 | (nih_log_init): Change the default priority to message. |
| 5107 | * nih/tests/test_logging.c (test_log_message): Check that messages |
| 5108 | are logged with the new message priority; reset to the new default. |
| 5109 | (test_logger_printf): Make sure that ordinary messages go to stdout |
| 5110 | and warning messages go to stderr. |
| 5111 | (test_set_logger, test_set_priority): Reset to the new default. |
| 5112 | * nih/tests/test_option.c (test_quiet, test_verbose, test_debug): |
| 5113 | Check that messages are also logged, as well as warning; and set |
| 5114 | the new default priority. |
| 5115 | * nih/tests/test_error.c (test_raise_again, test_push_context): |
| 5116 | Set log priority to the new default. |
| 5117 | * nih/tests/test_io.c (test_watcher): Reset priority to the new |
| 5118 | default. |
| 5119 | |
Scott James Remnant | cd88dd3 | 2007-01-05 17:42:36 +0000 | [diff] [blame] | 5120 | 2007-01-05 Scott James Remnant <scott@netsplit.com> |
| 5121 | |
Scott James Remnant | 095a907 | 2007-01-05 18:47:11 +0000 | [diff] [blame] | 5122 | * nih/tests/test_io.c (test_shutdown): Uncomment the test for |
| 5123 | shutdown when all messages are processed by the watcher. |
| 5124 | |
Scott James Remnant | 0bab143 | 2007-01-05 18:41:31 +0000 | [diff] [blame] | 5125 | * nih/io.c (nih_io_message_recv): Remove note about the remote end |
| 5126 | being closed; when in message mode, this doesn't usually happen. |
| 5127 | (nih_io_watcher): Only check for a zero length return if we're in |
| 5128 | stream mode, otherwise it just means we got a zero length message. |
| 5129 | (nih_io_watcher_read): Accept zero length messages and return them. |
| 5130 | * nih/tests/test_io.c (test_watcher): Remove tests that tried to |
| 5131 | mix a message-mode io and a dgram socket, that way lies disaster. |
| 5132 | |
Scott James Remnant | a2e399e | 2007-01-05 17:56:38 +0000 | [diff] [blame] | 5133 | * nih/io.c (nih_io_watcher_read, nih_io_watcher_write): Initialise |
| 5134 | len to zero, as valgrind can be fussy about this when we call things |
| 5135 | directly. |
| 5136 | |
Scott James Remnant | cd88dd3 | 2007-01-05 17:42:36 +0000 | [diff] [blame] | 5137 | * nih/io.h (NihIoMessage): Add a user data field to the message |
| 5138 | structure so we can carry the pid around when queuing notification |
| 5139 | messages in upstart. |
| 5140 | |
Scott James Remnant | 12d53b0 | 2007-01-02 15:29:33 +0000 | [diff] [blame] | 5141 | 2007-01-02 Scott James Remnant <scott@netsplit.com> |
| 5142 | |
Scott James Remnant | f1d97b5 | 2007-01-02 18:46:01 +0000 | [diff] [blame] | 5143 | * nih/alloc.h, nih/child.h, nih/command.h, nih/file.h, nih/hash.h: |
| 5144 | nih/io.h, nih/logging.h, nih/main.h, nih/option.h, nih/signal.h: |
| 5145 | nih/timer.h: Give names for all arguments in function pointer typedefs |
| 5146 | so the documentation strings make more sense. |
| 5147 | |
Scott James Remnant | 45b62a8 | 2007-01-02 16:51:24 +0000 | [diff] [blame] | 5148 | * nih/test.h (TEST_EQ_MEM, TEST_NE_MEM): Cast argument for number |
| 5149 | of bytes to size_t. |
| 5150 | |
Scott James Remnant | 12d53b0 | 2007-01-02 15:29:33 +0000 | [diff] [blame] | 5151 | * configure.ac (AC_COPYRIGHT): Update copyright to 2007. |
| 5152 | |
Scott James Remnant | 2a00129 | 2006-12-29 10:36:40 +0000 | [diff] [blame] | 5153 | 2006-12-29 Scott James Remnant <scott@netsplit.com> |
| 5154 | |
Scott James Remnant | 7a21d4e | 2006-12-29 11:55:11 +0000 | [diff] [blame] | 5155 | * nih/errors.h: Drop the NIH_IO_MESSAGE_TRUNCATED error. |
| 5156 | |
Scott James Remnant | e503225 | 2006-12-29 11:54:25 +0000 | [diff] [blame] | 5157 | * nih/io.h (NihIoMessage): Rename msg_buf member to data, and change |
| 5158 | ctrl_buf member to be an array of cmsg structures called control. |
| 5159 | * nih/io.c: Update references to NihIoMessage members. |
| 5160 | (nih_io_message_push_control): Rename to nih_io_message_add_control |
| 5161 | (nih_io_message_add_control): Rewrite to add the control message |
| 5162 | header onto the end of an array, rather than a control buffer, |
| 5163 | (nih_io_message_recv): After receiving the message, extract all |
| 5164 | control messages and put them into the array. |
| 5165 | (nih_io_message_send): Take control messages from the array into a |
| 5166 | single buffer and send them. |
| 5167 | |
| 5168 | * nih/tests/test_io.c: Update references to NihIoMessage members. |
| 5169 | (test_message_new): Check that the control member is initialised to |
| 5170 | a one-element array containing NULL. |
| 5171 | (test_message_push_control): Rename to test_message_add_control. |
| 5172 | (test_message_add_control): Check the array is extended. |
| 5173 | |
Scott James Remnant | 2a00129 | 2006-12-29 10:36:40 +0000 | [diff] [blame] | 5174 | * nih/io.c (nih_io_message_recv): Loop over a call to recvmsg() with |
| 5175 | MSG_PEEK in its arguments to avoid ever returning truncated messages. |
| 5176 | * nih/tests/test_io.c (test_message_recv): Adjust test for truncated |
| 5177 | messages to make sure they do in fact work. |
| 5178 | (test_watcher): Remove the oversized message error check. |
| 5179 | |
Scott James Remnant | 0a10bc4 | 2006-12-21 00:24:05 +0000 | [diff] [blame] | 5180 | 2006-12-21 Scott James Remnant <scott@netsplit.com> |
| 5181 | |
Scott James Remnant | 209c9b1 | 2006-12-21 18:21:47 +0000 | [diff] [blame] | 5182 | * nih/tests/test_option.c (test_verbose): Add missing call to free |
| 5183 | args. |
| 5184 | |
Scott James Remnant | 5c5f7a9 | 2006-12-21 17:47:43 +0000 | [diff] [blame] | 5185 | * nih/io.c (nih_io_message_send): Change to return the ssize_t |
| 5186 | received from sendmsg(), rather than an int. |
| 5187 | (nih_io_watcher_read): Move read functionality out of |
| 5188 | nih_io_watcher into a separate function that can deal with both |
| 5189 | stream and message mode. |
| 5190 | (nih_io_watcher_write): Move write functionality out of nih_io_watcher |
| 5191 | into a separate function that can deal with both stream and message |
| 5192 | mode. |
| 5193 | (nih_io_watcher): Call the separate functions, and handle calling |
| 5194 | the reader when in message mode. In addition, we now check the |
| 5195 | error code when writing to a socket as well; there are useful errors |
| 5196 | there (like ECONNREFUSED). |
| 5197 | * nih/io.h: Update prototype of nih_io_message_send. |
| 5198 | * nih/tests/test_io.c (test_message_send): Update return checks. |
| 5199 | (test_watcher): Test that the error handled can now be called when |
| 5200 | writing data to a socket, as well as just when reading. Test |
| 5201 | message mode behaviour. |
| 5202 | |
Scott James Remnant | be45d1f | 2006-12-21 01:00:11 +0000 | [diff] [blame] | 5203 | * nih/io.c (nih_io_send_message): Watch socket for writability. |
| 5204 | (nih_io_write): Extend this function to work in message mode; |
| 5205 | it allocates a new message, stores the data in that buffer, and |
| 5206 | adds it to the send queue. |
| 5207 | (nih_io_printf): Remove restriction that this only be called in |
| 5208 | stream mode; the fact this calls nih_io_write is sufficient to |
| 5209 | ensure correct behaviour. |
| 5210 | * nih/tests/test_io.c (test_send_message): Check that we're testing |
| 5211 | for writability. |
| 5212 | (test_write): Test that this works in message mode. |
| 5213 | (test_printf): Check that this works too, even though this only |
| 5214 | really calls nih_io_write. |
| 5215 | |
Scott James Remnant | 292fec2 | 2006-12-21 00:42:36 +0000 | [diff] [blame] | 5216 | * nih/io.c (nih_io_get): Extend so that this can operate in message |
| 5217 | mode on the oldest message in the queue. |
| 5218 | * nih/tests/test_io.c (test_get): Check that this works properly |
| 5219 | in message mode; complete with shutdown check. |
| 5220 | |
Scott James Remnant | 0a10bc4 | 2006-12-21 00:24:05 +0000 | [diff] [blame] | 5221 | * nih/io.c (nih_io_message_new): Do not assign a default list |
| 5222 | destructor, it's not in a hidden list and there are bad consequences |
| 5223 | of freeing a child with a default destructor if the list its in gets |
| 5224 | freed first; new rule - default destructors only if the list is hidden |
| 5225 | and never freed! |
| 5226 | (nih_io_closed, nih_io_shutdown): Don't call the close handler if |
| 5227 | the structure is already marked to be closed; there seems little |
| 5228 | point, and we could accidentally call it multiple times. |
| 5229 | (nih_io_read_message, nih_io_read, nih_io_get): Check whether we |
| 5230 | need to shutdown the socket here, in case the watcher isn't polled |
| 5231 | again. |
| 5232 | * nih/tests/test_io.c (test_shutdown): Check that shutdown works |
| 5233 | with message-mode structures (part of this disabled for now). |
| 5234 | (test_read_message, test_read, test_get): Check that a shutdown |
| 5235 | socket is closed when these are called. |
| 5236 | |
Scott James Remnant | 6618ee6 | 2006-12-20 12:28:33 +0000 | [diff] [blame] | 5237 | 2006-12-20 Scott James Remnant <scott@netsplit.com> |
| 5238 | |
Scott James Remnant | 594cae0 | 2006-12-20 23:26:52 +0000 | [diff] [blame] | 5239 | * nih/io.c (nih_io_read): Extend so that it can be called in |
| 5240 | message mode, it reads from the first message until it has been |
| 5241 | exhausted; at which point it frees the message and the next call |
| 5242 | would read from the next. |
| 5243 | * nih/tests/test_io.c (test_read): Check that the new functionality |
| 5244 | works properly. |
| 5245 | |
Scott James Remnant | 5d10da0 | 2006-12-20 22:53:53 +0000 | [diff] [blame] | 5246 | * nih/io.c (nih_io_first_message): Simple static function to obtain |
| 5247 | the oldest message in the receive queue. |
| 5248 | (nih_io_read_message, nih_io_send_message): Functions to take the |
| 5249 | oldest message out of the receive queue and append a message to the |
| 5250 | send queue. |
| 5251 | * nih/io.h: Add prototypes. |
| 5252 | * nih/tests/test_io.c (test_read_message, test_send_message): Check |
| 5253 | the new functions do what they say on the tin. |
| 5254 | |
Scott James Remnant | eb09822 | 2006-12-20 14:24:03 +0000 | [diff] [blame] | 5255 | General clean-up of nih_io, fixing a few API issues and making it |
| 5256 | more suitable for using in message mode. |
| 5257 | |
| 5258 | * nih/io.c (nih_io_buffer_pop, nih_io_buffer_shrink): Remove the |
| 5259 | silly restrictions that these cannot be called with a length greater |
| 5260 | than the buffer size, instead just truncate it to the buffer size. |
| 5261 | (nih_io_buffer_pop): Length is now updated to the actual number of |
| 5262 | bytes being returned. |
| 5263 | (nih_io_message_add_control): Rename to nih_io_message_push_control. |
| 5264 | (nih_io_message_recv): Change the len parameter to a pointer that's |
| 5265 | updated with the actual number of bytes read. |
| 5266 | (nih_io_stream_watcher): Rename back to nih_io_watcher. |
| 5267 | (nih_io_reopen): Use a single watcher function again, initialise close |
| 5268 | to NULL. Treat failure to set a descriptor non-blocking as a failure |
| 5269 | to open; otherwise we'll end up screwing up the main loop. |
| 5270 | (nih_io_watcher): Remove the restriction that this is only called |
| 5271 | when in the stream mode. Leave data in the receive buffer if there's |
| 5272 | no reader function, it's now valid to query the buffer size and read |
| 5273 | by other means. Catch the ENOMEM error and ignore it. Set and keep |
| 5274 | an eye on the structure close member, if it is TRUE before we return, |
| 5275 | close the socket. This also means we check for shutdown sockets in |
| 5276 | the case of error, which we probably should have done. |
| 5277 | (nih_io_maybe_shutdown): Rename to nih_io_shutdown_check. |
| 5278 | (nih_io_close): If the close member of the structure is not NULL |
| 5279 | we're inside a watcher function, so need to set the variable this |
| 5280 | points to to TRUE instead of closing or freeing the structure. |
| 5281 | (nih_io_read): Change the len parameter to be updated with the |
| 5282 | actual number of bytes being returned. |
| 5283 | * nih/io.h: Renamed function prototype. Updated documentation for |
| 5284 | function typedefs to clarify that they may all call nih_io_close, |
| 5285 | but may not call nih_free. |
| 5286 | * nih/errors.h: Rename NIH_TRUNCATED_MESSAGE to |
| 5287 | NIH_IO_MESSAGE_TRUNCATED, we should probably namespace these. |
| 5288 | * nih/tests/test_io.c (test_buffer_pop, test_buffer_shrink): Check |
| 5289 | that we can pop or shrink the entire buffer if we ask for more. |
| 5290 | (test_message_add_control): Rename to test_push_control. |
| 5291 | (test_message_recv): Check that the cases of remote end closed, |
| 5292 | error received or truncated message are handled properly. |
| 5293 | (test_message_send): Check that an error is handled. |
| 5294 | (test_stream_watcher): Rename back to test_watcher. |
| 5295 | (test_reopen): Check that the socket is not being shutdown or closed. |
| 5296 | (test_shutdown): Drain the buffer before calling handle on it, as |
| 5297 | it's not done automatically now. |
| 5298 | (test_close): Check that a lazy close is performed if io->close is |
| 5299 | not NULL. |
| 5300 | * nih/file.c (nih_file_reader): Update call to nih_io_read. |
| 5301 | |
Scott James Remnant | 6618ee6 | 2006-12-20 12:28:33 +0000 | [diff] [blame] | 5302 | * nih/logging.h (nih_assert_notreached): Rename to |
| 5303 | nih_assert_not_reached, this was annoying me. |
| 5304 | |
Scott James Remnant | 73caada | 2006-12-19 17:59:48 +0000 | [diff] [blame] | 5305 | 2006-12-19 Scott James Remnant <scott@netsplit.com> |
| 5306 | |
Scott James Remnant | 610ec39 | 2006-12-19 22:14:17 +0000 | [diff] [blame] | 5307 | * nih/io.c (nih_io_read, nih_io_write, nih_io_get, nih_io_printf): |
| 5308 | Ensure the NihIo structure is in stream mode; as these only really |
| 5309 | make sense if there's a limitless buffer. |
| 5310 | |
Scott James Remnant | 54cbe38 | 2006-12-19 21:39:28 +0000 | [diff] [blame] | 5311 | * nih/tests/test_io.c (test_shutdown): Make sure the socket is |
| 5312 | shut down immediately. |
| 5313 | * nih/io.c (nih_io_shutdown): Bugfix, should close the socket |
| 5314 | immediately if there's nothing in the queue, otherwise it may |
| 5315 | hang around forever if it never polls. |
| 5316 | |
Scott James Remnant | 499cf16 | 2006-12-19 21:28:19 +0000 | [diff] [blame] | 5317 | * nih/io.c (nih_io_reopen): Receive the type from the arguments, |
| 5318 | instead of hard-coding to be stream. Set up the structure accordingly. |
| 5319 | * nih/io.h: Update prototype. |
| 5320 | * nih/tests/test_io.c (test_reopen): Check message mode is allocated |
| 5321 | properly. |
| 5322 | * nih/file.c (nih_file_init): Open in stream mode. |
| 5323 | |
Scott James Remnant | 687f1f8 | 2006-12-19 21:10:30 +0000 | [diff] [blame] | 5324 | * nih/io.c (nih_io_message_new): Catch failure to allocate message |
| 5325 | or control buffer. |
| 5326 | (nih_io_message_add_control): No need to try and allocate the control |
| 5327 | buffer here. |
| 5328 | (nih_io_message_recv): Only need to resize the buffers here as well. |
| 5329 | (nih_io_message_send): No need to deal with there being no message |
| 5330 | or control buffer here either. |
| 5331 | * nih/tests/test_io.c: Fix test assumptions based on above. |
| 5332 | * nih/libnih.supp: Add missing nih_io_init suppression. |
| 5333 | |
| 5334 | * nih/tests/test_io.c (test_message_add_control): Non need to check |
| 5335 | allocation of the buffer itself. |
| 5336 | |
Scott James Remnant | 332f2b0 | 2006-12-19 20:40:51 +0000 | [diff] [blame] | 5337 | * nih/io.c (nih_io_message_add_control): Function to add a control |
| 5338 | message to the control buffer, to save mucking around with difficult |
| 5339 | bits ourselves. |
| 5340 | * nih/io.h: Add prototype. |
| 5341 | * nih/tests/test_io.c (test_message_add_control): Check that it |
| 5342 | works properly. |
| 5343 | |
Scott James Remnant | 054bbbc | 2006-12-19 18:14:32 +0000 | [diff] [blame] | 5344 | * nih/io.c (nih_io_buffer_shrink): Make an exported function, resize |
| 5345 | the buffer once done to save on memory. |
| 5346 | (nih_io_buffer_pop, nih_io_stream_watcher): No need to explicitly |
| 5347 | resize here now, as it gets called from shrink. |
| 5348 | * nih/io.h: Add prototype. |
| 5349 | * nih/tests/test_io.c (test_buffer_shrink): Test shrink. |
| 5350 | |
Scott James Remnant | 73caada | 2006-12-19 17:59:48 +0000 | [diff] [blame] | 5351 | * nih/io.c (nih_io_message_recv, nih_io_message_send): Functions |
| 5352 | to send and receive a message over a socket, hiding the difficult |
| 5353 | bits of dealing with msghdr/iovec. |
| 5354 | (nih_io_get_family): Function to detect the family of a socket. |
| 5355 | * nih/io.h: Update. |
| 5356 | * nih/errors.h: Add truncated message error. |
| 5357 | * nih/tests/test_io.c (test_message_recv, test_message_send): Check |
| 5358 | that we can send and receive messages by using socket pairs. |
| 5359 | (test_get_family): Check that we can get the families of the standard |
| 5360 | three socket types. |
| 5361 | |
Scott James Remnant | 85a241a | 2006-12-18 14:48:39 +0000 | [diff] [blame] | 5362 | 2006-12-18 Scott James Remnant <scott@netsplit.com> |
| 5363 | |
| 5364 | * nih/io.h (NihIoMessage): Structure that represents an individual |
| 5365 | message in a queue; has a buffer for the message, and for ancillary |
| 5366 | control data, as well as an address that the message is being sent |
| 5367 | to or received from. |
| 5368 | (NihIoType): Enum to select whether an NihIo structure is in stream |
| 5369 | mode or message mode. |
| 5370 | (NihIo): Add a type member to select whether this is in stream or |
| 5371 | message mode, and a union to select whether we're using buffers |
| 5372 | or message queues. |
| 5373 | * nih/io.c (nih_io_message_new): Allocate an NihIoMessage and its |
| 5374 | child buffers. |
| 5375 | (nih_io_reopen): Initialise the type to NIH_IO_STREAM. |
| 5376 | (nih_io_watcher): Rename to nih_io_stream_watcher. |
| 5377 | * nih/tests/test_io.c (test_message_new): Check that the new message |
| 5378 | structure is initialised properly. |
| 5379 | (test_reopen): Check that we get a stream structure by default. |
| 5380 | (test_watcher): Rename to test_stream_watcher. |
| 5381 | |
Scott James Remnant | d79e0ae | 2006-12-17 14:23:52 +0000 | [diff] [blame] | 5382 | 2006-12-17 Scott James Remnant <scott@netsplit.com> |
| 5383 | |
Scott James Remnant | 8b5bec6 | 2006-12-17 18:53:24 +0000 | [diff] [blame] | 5384 | * nih/logging.h (nih_assert_notreached): Add an assertion for the |
| 5385 | use in default bits of switches, etc. |
| 5386 | |
Scott James Remnant | d614c61 | 2006-12-17 16:52:31 +0000 | [diff] [blame] | 5387 | * nih/test.h (TEST_EQ_U, TEST_NE_U): Versions of the original macros |
| 5388 | that cast to size_t for display, instead of ssize_t. |
| 5389 | |
Scott James Remnant | d79e0ae | 2006-12-17 14:23:52 +0000 | [diff] [blame] | 5390 | * nih/tests/test_logging.c, nih/tests/test_string.c: Set local |
| 5391 | variables to avoid gcc thinking that they may be unused when |
| 5392 | using TEST_DIVERT_*. |
| 5393 | |
Scott James Remnant | 5a34b9c | 2006-12-14 11:39:27 +0000 | [diff] [blame] | 5394 | 2006-12-14 Scott James Remnant <scott@netsplit.com> |
| 5395 | |
| 5396 | * HACKING: Correct some typos. |
| 5397 | |
Scott James Remnant | 104bb08 | 2006-12-13 18:19:48 +0000 | [diff] [blame] | 5398 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 5399 | |
| 5400 | * nih/test.h (TEST_FILENAME): Wrap with do { ... } while (0) |
| 5401 | in case this gets used as a single line statement. |
| 5402 | |
Scott James Remnant | d4d63c6 | 2006-12-13 18:05:21 +0000 | [diff] [blame] | 5403 | 2006-12-13 Johan Kiviniemi <johan@kiviniemi.name> |
| 5404 | |
| 5405 | * nih/test.h (TEST_FILE_RESET): Wrap with do { ... } while (0) |
| 5406 | in case this gets used as a single line statement. |
| 5407 | |
Scott James Remnant | c5f3137 | 2006-12-13 16:54:12 +0000 | [diff] [blame] | 5408 | 2006-12-13 Scott James Remnant <scott@netsplit.com> |
| 5409 | |
| 5410 | * nihify: Link to the nih ChangeLog. |
| 5411 | |
Scott James Remnant | 724bf55 | 2006-12-12 11:20:40 +0000 | [diff] [blame] | 5412 | 2006-12-12 Scott James Remnant <scott@netsplit.com> |
| 5413 | |
Scott James Remnant | 1a00336 | 2006-12-12 17:18:11 +0000 | [diff] [blame] | 5414 | * nih/test.h (TEST_CHILD_WAIT, TEST_CHILD_RELEASE): Sometimes the |
| 5415 | primitive "when the child is running" locking provided by TEST_CHILD |
| 5416 | isn't sufficient, and we actually need to perform some actions in |
| 5417 | the child before we let the parent carry on. These two macros |
| 5418 | allow that. |
| 5419 | |
Scott James Remnant | 1edabdd | 2006-12-12 12:24:44 +0000 | [diff] [blame] | 5420 | * nih/libnih.supp: Include a valgrind suppressions file. |
| 5421 | * nih/Makefile.am (EXTRA_DIST): Distribute the suppressions file. |
| 5422 | |
Scott James Remnant | 561f23e | 2006-12-12 12:06:22 +0000 | [diff] [blame] | 5423 | * nih/tests/test_alloc.c (test_realloc): Fix missing free. |
| 5424 | |
Scott James Remnant | 724bf55 | 2006-12-12 11:20:40 +0000 | [diff] [blame] | 5425 | * configure.ac (AM_GNU_GETTEXT_VERSION): Quote version number. |
| 5426 | |
Scott James Remnant | 50b58d5 | 2006-12-09 10:19:58 +0000 | [diff] [blame] | 5427 | 2006-12-09 Scott James Remnant <scott@netsplit.com> |
| 5428 | |
| 5429 | * nih/test.h (TEST_DIVERT_STDOUT_FD, TEST_DIVERT_STDERR_FD): Flush |
| 5430 | before dup2ing the original file descriptor back, otherwise we end |
| 5431 | up with the content still in the buffer later. |
| 5432 | |
Scott James Remnant | a8d6d84 | 2006-12-08 17:07:13 +0000 | [diff] [blame] | 5433 | 2006-12-08 Scott James Remnant <scott@netsplit.com> |
| 5434 | |
Scott James Remnant | 7e75a6a | 2006-12-08 18:11:05 +0000 | [diff] [blame] | 5435 | * HACKING: Document that test cases are expected. |
| 5436 | |
Scott James Remnant | a4710a4 | 2006-12-08 18:05:43 +0000 | [diff] [blame] | 5437 | * nih/tests/test_command.c: Port to the new test framework. |
| 5438 | |
Scott James Remnant | 7f798c9 | 2006-12-08 17:23:37 +0000 | [diff] [blame] | 5439 | * nih/tests/test_option.c: Drop unused include. |
| 5440 | |
Scott James Remnant | a8d6d84 | 2006-12-08 17:07:13 +0000 | [diff] [blame] | 5441 | * nih/tests/test_option.c: Port to the new test framework. |
| 5442 | |
Scott James Remnant | 000e9a4 | 2006-12-07 11:43:37 +0000 | [diff] [blame] | 5443 | 2006-12-07 Scott James Remnant <scott@netsplit.com> |
| 5444 | |
Scott James Remnant | 4aa61bc | 2006-12-07 17:42:19 +0000 | [diff] [blame] | 5445 | * nih/tests/test_io.c: Port to the new test framework. |
| 5446 | |
Scott James Remnant | 5c797d9 | 2006-12-07 16:00:15 +0000 | [diff] [blame] | 5447 | * nih/tests/test_hash.c: Drop use of assert. |
| 5448 | |
Scott James Remnant | 43819d3 | 2006-12-07 13:39:30 +0000 | [diff] [blame] | 5449 | * nih/tests/test_timer.c (test_poll): Formatting fix. |
| 5450 | |
Scott James Remnant | 5295921 | 2006-12-07 13:28:58 +0000 | [diff] [blame] | 5451 | * nih/tests/test_string.c: Port to the new test framework. |
| 5452 | |
Scott James Remnant | 07dfc47 | 2006-12-07 13:28:45 +0000 | [diff] [blame] | 5453 | * nih/test.h (TEST_DIVERT_STDOUT_FD, TEST_DIVERT_STDERR_FD): Macros |
| 5454 | to divert to a file descriptor instead of a file. |
| 5455 | (TEST_DIVERT_STDOUT, TEST_DIVERT_STDERR): Redefine as wrappers around |
| 5456 | the new macros. |
| 5457 | |
Scott James Remnant | ec3da3f | 2006-12-07 12:57:11 +0000 | [diff] [blame] | 5458 | * nih/tests/test_timer.c: Port to the new test framework. |
| 5459 | |
Scott James Remnant | c7cab09 | 2006-12-07 12:45:19 +0000 | [diff] [blame] | 5460 | * nih/tests/test_signal.c: Port to the new test framework. |
| 5461 | |
Scott James Remnant | 3ca3880 | 2006-12-07 12:14:32 +0000 | [diff] [blame] | 5462 | * nih/tests/test_main.c: Port to the new test framework. |
| 5463 | |
Scott James Remnant | 8b786d3 | 2006-12-07 12:12:02 +0000 | [diff] [blame] | 5464 | * nih/test.h: Cast strlen return value to int when used to give |
| 5465 | the length of a string in printf. |
| 5466 | |
Scott James Remnant | e65ede7 | 2006-12-07 11:43:50 +0000 | [diff] [blame] | 5467 | * nih/tests/test_logging.c: Port to the new test framework. |
| 5468 | |
Scott James Remnant | 000e9a4 | 2006-12-07 11:43:37 +0000 | [diff] [blame] | 5469 | * nih/test.h (TEST_DIVERT_STDOUT, TEST_DIVERT_STDERR): Crazy macros |
| 5470 | to divert stdout or stderr to a different file, making sure it's |
| 5471 | flushed before both dups. |
| 5472 | (TEST_EQ_STRN, TEST_NE_STRN): Functions to check a string up to a |
| 5473 | particular point. |
| 5474 | (TEST_FILE_EQ, TEST_FILE_EQ_N, TEST_FILE_NE, TEST_FILE_NE_N): |
| 5475 | Functions to grab a line from a file and check it against a string. |
| 5476 | (TEST_FILE_END): Function to determine end of file. |
| 5477 | (TEST_FILE_RESET): Another function so I don't need to remember the |
| 5478 | runes to flush, rewind and truncate a file. |
| 5479 | |
Scott James Remnant | c81a255 | 2006-12-06 13:40:16 +0000 | [diff] [blame] | 5480 | 2006-12-06 Scott James Remnant <scott@netsplit.com> |
| 5481 | |
Scott James Remnant | e43ba4c | 2006-12-06 16:30:57 +0000 | [diff] [blame] | 5482 | * nih/tests/test_file.c: Port to the new test framework. |
| 5483 | |
Scott James Remnant | 257f223 | 2006-12-06 16:29:50 +0000 | [diff] [blame] | 5484 | * nih/test.h (TEST_EQ_MEM, TEST_NE_MEM): Tests that wrap memcmp. |
| 5485 | (TEST_FILENAME): Macro to generate a filename. |
| 5486 | |
Scott James Remnant | 787f237 | 2006-12-06 15:57:32 +0000 | [diff] [blame] | 5487 | * nih/tests/test_error.c: Port to the new test framework. |
| 5488 | |
Scott James Remnant | 881b8a1 | 2006-12-06 15:36:27 +0000 | [diff] [blame] | 5489 | * nih/tests/test_alloc.c, nih/tests/test_list.c, nih/tests/test_hash.c: |
| 5490 | Undo over-zealous removing of includes. |
| 5491 | |
Scott James Remnant | ac8e7a1 | 2006-12-06 15:33:45 +0000 | [diff] [blame] | 5492 | * nih/tests/test_child.c: Port to the new test framework. |
| 5493 | |
Scott James Remnant | 6e450a9 | 2006-12-06 15:31:17 +0000 | [diff] [blame] | 5494 | * nih/test.h (TEST_CHILD): Macro to spawn an interlocked child |
| 5495 | process, so we don't keep having to remember how to. |
| 5496 | |
Scott James Remnant | c81a255 | 2006-12-06 13:40:16 +0000 | [diff] [blame] | 5497 | * nih/test.h (TEST_ALLOC_SIZE, TEST_ALLOC_PARENT): Include the |
| 5498 | expression that generated the pointer, as well as the pointer. |
| 5499 | (TEST_LIST_EMPTY, TEST_LIST_NOT_EMPTY): Check whether a list is |
| 5500 | empty or not. |
| 5501 | * nih/tests/test_list.c (test_empty, test_foreach_safe): Use the |
| 5502 | new list test macros instead of TEST_TRUE/TEST_FALSE. |
| 5503 | * nih/tests/test_hash.c (test_new): Likewise. |
| 5504 | |
Scott James Remnant | afcf58b | 2006-12-05 12:22:33 +0000 | [diff] [blame] | 5505 | 2006-12-05 Scott James Remnant <scott@netsplit.com> |
| 5506 | |
Scott James Remnant | 27a4c11 | 2006-12-05 23:37:30 +0000 | [diff] [blame] | 5507 | * nih/tests/test_hash.c: Port to the new test framework. |
| 5508 | |
Scott James Remnant | f119d69 | 2006-12-05 21:38:02 +0000 | [diff] [blame] | 5509 | * nih/tests/test_list.c: Port to the new test framework. |
| 5510 | |
Scott James Remnant | c051f68 | 2006-12-05 20:50:25 +0000 | [diff] [blame] | 5511 | * nih/tests/test_alloc.c: Port to the new test framework. |
| 5512 | (test_set_allocator): Test that the allocator is called with zero |
| 5513 | as the argument. |
| 5514 | |
Scott James Remnant | 8107b44 | 2006-12-05 20:49:36 +0000 | [diff] [blame] | 5515 | * nih/test.h: Include config.h on behalf of the test suites. |
| 5516 | |
Scott James Remnant | 9d4deb3 | 2006-12-05 20:48:53 +0000 | [diff] [blame] | 5517 | * nih/test.h (TEST_EQ_STR, TEST_NE_STR): String comparison tests. |
| 5518 | |
Scott James Remnant | fd51d01 | 2006-12-05 19:59:04 +0000 | [diff] [blame] | 5519 | * nih/test.h (TEST_FAILED): abort is much better than exit |
| 5520 | |
Scott James Remnant | 8884c31 | 2006-12-05 19:11:27 +0000 | [diff] [blame] | 5521 | * nih/test.h (INIT_TEST): Drop this, we'll just return directly. |
| 5522 | (TEST_FAILED): Return directly on failure. |
| 5523 | (CALL_TEST): Drop this again. |
| 5524 | |
Scott James Remnant | d91c313 | 2006-12-05 19:01:26 +0000 | [diff] [blame] | 5525 | * nih/test.h (CALL_TEST): Add "call a function" macro. |
| 5526 | |
Scott James Remnant | 67a9b5c | 2006-12-05 18:58:35 +0000 | [diff] [blame] | 5527 | * nih/test.h: Macros that implement a simple test framework based |
| 5528 | on the patterns I was using anyway. |
| 5529 | * nih/Makefile.am (nihinclude_HEADERS): Install nih/test.h |
| 5530 | |
Scott James Remnant | 83c7786 | 2006-12-05 14:44:47 +0000 | [diff] [blame] | 5531 | * nih/tests/test_command.c (test_parser, test_help): flush stdout |
| 5532 | or stderr before calling dup2(). |
| 5533 | |
Scott James Remnant | 5149f69 | 2006-12-05 14:42:45 +0000 | [diff] [blame] | 5534 | * nih/tests/test_option.c (test_parser, test_version, test_help): |
| 5535 | flush stdout or stderr before calling dup2(). |
| 5536 | |
Scott James Remnant | de99cbb | 2006-12-05 14:40:13 +0000 | [diff] [blame] | 5537 | * nih/tests/test_io.c: Formatting fix. |
| 5538 | |
Scott James Remnant | 10630ad | 2006-12-05 14:38:01 +0000 | [diff] [blame] | 5539 | * nih/file.c (nih_file_map): Tidy up; in particular don't allow |
| 5540 | opening in just write mode, seeing as that doesn't work. |
| 5541 | * nih/tests/test_file.c (test_unmap): Test unmap separately. |
| 5542 | (test_map): Update for new checks. |
| 5543 | |
Scott James Remnant | 73eab77 | 2006-12-05 14:22:15 +0000 | [diff] [blame] | 5544 | * nih/file.c (nih_file_add_watch): No need to set ENOMEM if |
| 5545 | nih_new fails, that will be already set. |
| 5546 | (nih_file_reader): Clarify why nih_io_read must return a pointer. |
| 5547 | |
Scott James Remnant | 6e92788 | 2006-12-05 14:06:04 +0000 | [diff] [blame] | 5548 | * nih/tests/test_string.c (test_str_screen_width) |
| 5549 | (test_str_screen_wrap): flush stdout before calling dup2(). |
| 5550 | |
Scott James Remnant | e5fca7a | 2006-12-05 14:02:18 +0000 | [diff] [blame] | 5551 | * nih/tests/test_main.c (test_suggest_help, test_version): flush |
| 5552 | stdout or stderr before calling dup2(). |
| 5553 | |
Scott James Remnant | f7a83e0 | 2006-12-05 13:59:30 +0000 | [diff] [blame] | 5554 | * nih/tests/test_logging.c (test_logger_printf): flush stdout or |
| 5555 | stderr before calling dup2(), otherwise we don't know which stream |
| 5556 | the buffered output will be going to. |
| 5557 | |
Scott James Remnant | 32965ca | 2006-12-05 13:25:09 +0000 | [diff] [blame] | 5558 | * nih/tests/test_error.c (test_push_context): Check that unhandled |
| 5559 | errors within a context are notified and freed if the context is |
| 5560 | popped. |
| 5561 | |
Scott James Remnant | b862b9a | 2006-12-05 13:11:49 +0000 | [diff] [blame] | 5562 | * nih/alloc.c (nih_alloc_reparent): Function to reparent a pointer |
| 5563 | to a new parent or just orphan it. |
| 5564 | * nih/alloc.h: Update. |
| 5565 | * nih/tests/test_alloc.c (test_reparent): Make sure it works. |
| 5566 | |
Scott James Remnant | 82a3f31 | 2006-12-05 12:48:22 +0000 | [diff] [blame] | 5567 | * nih/tests/test_alloc.c (test_alloc_using): Check that this works |
| 5568 | properly if the allocator returns NULL. |
| 5569 | (test_realloc): A few cases to check here; make sure that it works |
| 5570 | if the pointer to realloc is NULL, actually test the children |
| 5571 | reparenting code here and test the reallocator returning NULL. |
| 5572 | |
Scott James Remnant | afcf58b | 2006-12-05 12:22:33 +0000 | [diff] [blame] | 5573 | * README: Correct typo. |
| 5574 | |
Scott James Remnant | dd9fe39 | 2006-11-12 11:21:00 -0800 | [diff] [blame] | 5575 | 2006-11-12 Scott James Remnant <scott@netsplit.com> |
| 5576 | |
Scott James Remnant | 049d7c9 | 2006-11-12 16:36:40 -0800 | [diff] [blame] | 5577 | * nih/Makefile.am (INCLUDES, DEFS): Drop these two variables |
| 5578 | (AM_CPPFLAGS): in favour of this combined variable. |
| 5579 | |
Scott James Remnant | 12758ed | 2006-11-12 15:48:41 -0800 | [diff] [blame] | 5580 | * configure.ac (AM_INIT_AUTOMAKE): Include nostdinc so we don't get |
| 5581 | Automake's broken default includes. |
| 5582 | * nih/Makefile.am (INCLUDES): Include $top_builddir and $top_srcdir, |
| 5583 | everything else wants relative paths from there. |
| 5584 | (DEFAULT_INCLUDES): Drop override now we don't need it. |
| 5585 | |
Scott James Remnant | dd9fe39 | 2006-11-12 11:21:00 -0800 | [diff] [blame] | 5586 | * m4/compiler.m4 (NIH_C_THREAD): Define a macro in the manner of |
| 5587 | AC_C_CONST that will #define __thread to empty if it isn't supported |
| 5588 | by the compiler. |
| 5589 | * m4/misc.m4 (NIH_INIT): libnih uses __thread. |
| 5590 | |
Scott James Remnant | 3262cee | 2006-10-13 14:25:07 +0100 | [diff] [blame] | 5591 | 2006-10-13 Scott James Remnant <scott@netsplit.com> |
| 5592 | |
| 5593 | * nih/command.h: Adjust type of NihCommandAction to include const. |
| 5594 | * nih/tests/test_command.c (my_action): Update. |
| 5595 | |
Scott James Remnant | b5d843c | 2006-10-12 15:09:15 +0100 | [diff] [blame] | 5596 | 2006-10-12 Scott James Remnant <scott@netsplit.com> |
| 5597 | |
| 5598 | * configure.ac: Expand AC_GNU_SOURCE so we get _GNU_SOURCE and so |
| 5599 | that gettext doesn't complain. |
| 5600 | (AM_GNU_GETTEXT_VERSION): Increase to 0.15 |
| 5601 | (AC_PREREQ): Increase to 2.60 |
| 5602 | * HACKING: Update autoconf and gettext requirements. |
| 5603 | |
Scott James Remnant | 24ba628 | 2006-10-11 11:43:22 +0100 | [diff] [blame] | 5604 | 2006-10-11 Scott James Remnant <scott@netsplit.com> |
| 5605 | |
Scott James Remnant | 297f636 | 2006-10-11 17:36:28 +0100 | [diff] [blame] | 5606 | * nih/string.c (nih_str_screen_wrap): Don't quite fill the screen, |
| 5607 | instead leave a character spare as it looks somehow neater that way. |
| 5608 | * nih/option.c (nih_option_group_help): Likewise. |
| 5609 | * nih/tests/test_string.c (test_str_screen_wrap): Update tests. |
| 5610 | * nih/tests/test_option.c (test_help): Fix wrapping test. |
| 5611 | |
Scott James Remnant | 7674efd | 2006-10-11 16:49:32 +0100 | [diff] [blame] | 5612 | * TODO: Update. |
| 5613 | |
Scott James Remnant | ec11a81 | 2006-10-11 16:44:23 +0100 | [diff] [blame] | 5614 | * nih/command.c: Implement a command parser that uses the first |
| 5615 | non-option argument (or program name) and selects different help |
| 5616 | and options based on that. |
| 5617 | * nih/command.h: Structures and prototypes. |
| 5618 | * nih/libnih.h: Include command.h |
| 5619 | * nih/tests/test_command.c: Test suite for command parser. |
| 5620 | * nih/Makefile.am (libnih_la_SOURCES): Build and link command.c |
| 5621 | (nihinclude_HEADERS): Install command.h |
| 5622 | (TESTS): Build and run command test cases |
| 5623 | (test_command_SOURCES, test_command_LDFLAGS, test_command_LDADD): |
| 5624 | Details for command test suite binary. |
| 5625 | |
Scott James Remnant | a4febfc | 2006-10-11 15:48:30 +0100 | [diff] [blame] | 5626 | * nih/tests/test_option.c: Keep a copy of last_option otherwise |
| 5627 | it's freed while we're not around. |
| 5628 | |
Scott James Remnant | 55a9874 | 2006-10-11 14:09:55 +0100 | [diff] [blame] | 5629 | * nih/option.c (nih_option_set_footer): Add a footer string. |
| 5630 | (nih_option_help): Also add the footer string. |
| 5631 | * nih/option.h: Update. |
| 5632 | * nih/tests/test_option.c (test_help): Check the footer. |
| 5633 | |
Scott James Remnant | 9dfd41d | 2006-10-11 14:00:37 +0100 | [diff] [blame] | 5634 | * nih/option.c (nih_option_set_usage_stem): Add function to set |
| 5635 | the "[OPTION]..." bit of the usage line. |
| 5636 | (nih_option_help): Use the usage stem if set. |
| 5637 | * nih/option.h: Update. |
| 5638 | * nih/tests/test_option.c (test_help): Check the usage stem. |
| 5639 | |
Scott James Remnant | b690259 | 2006-10-11 12:35:24 +0100 | [diff] [blame] | 5640 | * nih/option.c (nih_option_join): Add function to combine two lists |
| 5641 | of options. |
| 5642 | (nih_option_parser): Join the options and default_options lists, |
| 5643 | don't play with arrays of lists. |
| 5644 | (nih_option_get_short, nih_option_get_long): Simply by just iterating |
| 5645 | the one array. |
| 5646 | (nih_option_help, nih_option_group_help): Again simply by just |
| 5647 | iterating the one array. |
| 5648 | * nih/option.h: Update. |
| 5649 | * nih/tests/test_option.c (test_parser): Don't check addresses of |
| 5650 | options as they've moved. |
| 5651 | |
Scott James Remnant | cf9d1bd | 2006-10-11 11:48:33 +0100 | [diff] [blame] | 5652 | * nih/option.c (nih_option_set_usage, nih_option_set_synopsis) |
| 5653 | (nih_option_set_help): Allow NULL to be set to override existing |
| 5654 | strings. |
| 5655 | |
Scott James Remnant | 24ba628 | 2006-10-11 11:43:22 +0100 | [diff] [blame] | 5656 | * nih/option.c (nih_option_help): Make static. |
| 5657 | * nih/option.h: Update. |
| 5658 | |
Scott James Remnant | 4889094 | 2006-10-10 12:28:39 +0100 | [diff] [blame] | 5659 | 2006-10-10 Scott James Remnant <scott@netsplit.com> |
| 5660 | |
Scott James Remnant | 28a55e9 | 2006-10-10 18:29:29 +0100 | [diff] [blame] | 5661 | * TODO: Update. |
| 5662 | |
Scott James Remnant | 6b000dd | 2006-10-10 18:29:11 +0100 | [diff] [blame] | 5663 | * nih/option.c (nih_option_group_help): Use a factor of the screen |
| 5664 | width when formatting help options, but keep at least 20 chars |
| 5665 | visible at all times. |
| 5666 | |
Scott James Remnant | 9a19664 | 2006-10-10 18:24:37 +0100 | [diff] [blame] | 5667 | * nih/string.c (nih_str_screen_width): Add function to return just |
| 5668 | the screen width. |
| 5669 | (nih_str_screen_wrap): Use that function. |
| 5670 | * nih/string.h: Update. |
| 5671 | * nih/tests/test_string.c (test_str_screen_width): Check function. |
| 5672 | |
Scott James Remnant | d1342ff | 2006-10-10 18:10:48 +0100 | [diff] [blame] | 5673 | * nih/option.c (nih_option_set_synopsis): Function to set a synopsis |
| 5674 | string that follows the usage. |
| 5675 | (nih_option_set_help): Function to set the help string that follows |
| 5676 | the options. |
| 5677 | (nih_option_help): Output synopsis and help strings. |
| 5678 | * nih/option.h: Update. |
| 5679 | * nih/tests/test_option.c (test_help): Check behaviour |
| 5680 | |
Scott James Remnant | 110e57a | 2006-10-10 17:42:58 +0100 | [diff] [blame] | 5681 | * TODO: Update. |
| 5682 | |
Scott James Remnant | 34caaa3 | 2006-10-10 17:35:07 +0100 | [diff] [blame] | 5683 | * nih/main.c (nih_main_version): Use nih_str_screen_wrap to output |
| 5684 | the GPL preamble bit. |
| 5685 | * nih/tests/test_main.c (test_version): Unset COLUMNS just in case. |
| 5686 | |
Scott James Remnant | d264458 | 2006-10-10 17:29:15 +0100 | [diff] [blame] | 5687 | * nih/string.c (nih_str_screen_wrap): Add wrapper around |
| 5688 | nih_str_wrap that obtains the screen width and uses that for len. |
| 5689 | * nih/string.h: Add prototype. |
| 5690 | * nih/tests/test_string.c (test_str_screen_wrap): Test new function. |
| 5691 | * nih/Makefile.am (test_string_LDADD): Link with -lutil so we can |
| 5692 | use openpty in our "fake terminal" tests. |
| 5693 | |
Scott James Remnant | 1f880f2 | 2006-10-10 16:52:46 +0100 | [diff] [blame] | 5694 | * nih/tests/test_option.c: Fix minor test case memory leak. |
| 5695 | |
Scott James Remnant | 981fa8e | 2006-10-10 16:48:32 +0100 | [diff] [blame] | 5696 | * nih/tests/test_child.c (test_poll, test_poll): Use better |
| 5697 | interlocks then usleep. |
| 5698 | |
Scott James Remnant | 5fadcfa | 2006-10-10 16:42:44 +0100 | [diff] [blame] | 5699 | * nih/tests/test_option.c (main): Enable test of --debug, oops. |
| 5700 | |
Scott James Remnant | ad5cc38 | 2006-10-10 16:39:39 +0100 | [diff] [blame] | 5701 | * nih/main.c (nih_main_daemonise): Document why this is better than |
| 5702 | daemon(), and thus not nih. |
| 5703 | * nih/tests/test_main.c (test_daemonise): Test the daemonise |
| 5704 | function works properly. |
| 5705 | |
Scott James Remnant | 1e5829a | 2006-10-10 15:53:13 +0100 | [diff] [blame] | 5706 | * nih/timer.h: Fix comments. |
| 5707 | |
| 5708 | * nih/hash.c (nih_hash_new): This needs a parent pointer too. |
| 5709 | * nih/hash.h: Update prototype. |
| 5710 | * nih/tests/test_hash.c: Update test cases. |
| 5711 | |
Scott James Remnant | 6a8ebf6 | 2006-10-10 15:42:23 +0100 | [diff] [blame] | 5712 | * nih/child.c: Clarify child_watches item types. |
| 5713 | * nih/file.c: Clarify file_watches item types. |
| 5714 | * nih/io.c: Clarify io_watches item types. |
| 5715 | * nih/main.c: Clarify loop_functions item types. |
| 5716 | * nih/timer.c: Clarify timers item types. |
| 5717 | |
Scott James Remnant | 65f621b | 2006-10-10 15:39:57 +0100 | [diff] [blame] | 5718 | * nih/signal.h (NihSignalCb): Rename to NihSignalHandler. |
| 5719 | (NihSignal): Change callback name to handler and type |
| 5720 | to NihSignalHandler. |
| 5721 | * nih/signal.c (nih_signal_add_callback): Rename to |
| 5722 | nih_signal_add_handler. |
| 5723 | * nih/tests/test_signal.c: Update. |
| 5724 | |
Scott James Remnant | 602eda4 | 2006-10-10 15:33:56 +0100 | [diff] [blame] | 5725 | * nih/list.c (nih_list_new): Take a parent pointer like everything |
| 5726 | else, showing its age slightly. |
| 5727 | * nih/list.h: Update prototype. |
| 5728 | * nih/tests/test_list.c: Update test cases. |
| 5729 | * nih/child.c (nih_child_init): Pass NULL to nih_list_new(). |
| 5730 | * nih/error.c (nih_error_init): Pass NULL to nih_list_new(). |
| 5731 | * nih/file.c (nih_file_init): Pass NULL to nih_list_new(). |
| 5732 | * nih/io.c (nih_io_init): Pass NULL to nih_list_new(). |
| 5733 | * nih/main.c (nih_main_loop_init): Pass NULL to nih_list_new(). |
| 5734 | * nih/signal.c (nih_signal_init): Pass NULL to nih_list_new(). |
| 5735 | * nih/timer.c (nih_timer_init): Pass NULL to nih_list_new(). |
| 5736 | * nih/tests/test_hash.c: Pass NULL to nih_list_new(). |
| 5737 | |
Scott James Remnant | 9180a36 | 2006-10-10 15:29:05 +0100 | [diff] [blame] | 5738 | * nih/alloc.c, nih/alloc.h, nih/child.c, nih/child.h, nih/error.c, |
| 5739 | nih/error.h, nih/file.c, nih/file.h, nih/hash.c, nih/hash.h, |
| 5740 | nih/io.c, nih/io.h, nih/list.c, nih/list.h, nih/main.c, nih/main.h, |
| 5741 | nih/option.c, nih/option.h, nih/signal.c, nih/signal.h, nih/string.c, |
| 5742 | nih/string.h, nih/timer.c, nih/timer.h: Clean up documentation and |
| 5743 | parent return values. |
| 5744 | |
Scott James Remnant | 32682c8 | 2006-10-10 14:42:20 +0100 | [diff] [blame] | 5745 | * HACKING: Detail function documentation requirement and format. |
| 5746 | |
Scott James Remnant | 4889094 | 2006-10-10 12:28:39 +0100 | [diff] [blame] | 5747 | * nih/tests/test_signal.c (test_set_default, test_set_ignore) |
| 5748 | (test_reset): amd64 seems to set the SA_NODEFER flag even when |
| 5749 | you pass zero, so just check we clear important bits. |
| 5750 | |
Scott James Remnant | c945ac6 | 2006-09-27 21:24:37 +0100 | [diff] [blame] | 5751 | 2006-09-27 Scott James Remnant <scott@netsplit.com> |
| 5752 | |
| 5753 | * m4/misc.m4 (NIH_INIT): Add easier macro for using libnih. |
| 5754 | * m4/compiler.m4: Remove hack to include misc.m4 |
| 5755 | * configure.ac: Drop the macro set and replace with NIH_INIT |
| 5756 | * README: Update. |
| 5757 | * nihify: Warn if NIH_INIT not present. |
| 5758 | |
Scott James Remnant | a20ab6d | 2006-09-25 21:57:30 +0100 | [diff] [blame] | 5759 | 2006-09-25 Scott James Remnant <scott@netsplit.com> |
| 5760 | |
Scott James Remnant | 0138942 | 2006-09-25 21:59:00 +0100 | [diff] [blame] | 5761 | * TODO (main): Update. |
| 5762 | |
Scott James Remnant | a20ab6d | 2006-09-25 21:57:30 +0100 | [diff] [blame] | 5763 | * nih/logging.h (nih_message): Add nih_message as an alias for |
| 5764 | nih_warn. |
| 5765 | * nih/tests/test_logging.c (test_log_message): Check new macro. |
| 5766 | |
Scott James Remnant | 3cdf5c5 | 2006-09-20 04:28:07 +0100 | [diff] [blame] | 5767 | 2006-09-20 Michael Biebl <mbiebl@gmail.com> |
| 5768 | |
| 5769 | * nih/tests/test_file.c: Include nih/inotify.h when sys/inotify.h |
| 5770 | is not available. |
| 5771 | |
Scott James Remnant | 4f65422 | 2006-09-19 17:54:11 +0100 | [diff] [blame] | 5772 | 2006-09-19 Michael Biebl <mbiebl@gmail.com> |
| 5773 | |
| 5774 | * nih/Makefile.am (nihinclude_HEADERS): Install inotify.h just in |
| 5775 | case it's required |
| 5776 | |
Scott James Remnant | a8530bb | 2006-09-18 19:41:39 +0100 | [diff] [blame] | 5777 | 2006-09-18 Michael Biebl <mbiebl@gmail.com> |
| 5778 | |
| 5779 | * configure.ac: Check for sys/inotify.h |
| 5780 | * nih/inotify.h: Taken from udev, this defines the syscalls |
| 5781 | and flags, etc. for inotify on glibc 2.3 |
| 5782 | * nih/file.c, nih/file.h: Include nih/inotify.h if we do not have |
| 5783 | sys/inotify.h |
| 5784 | |
Scott James Remnant | c347726 | 2006-09-13 16:54:49 +0100 | [diff] [blame] | 5785 | 2006-09-13 Scott James Remnant <scott@netsplit.com> |
| 5786 | |
| 5787 | * nih/child.c (nih_child_poll): Zero the siginfo_t struct before |
| 5788 | every call to waitid(), the kernel doesn't do it for us when |
| 5789 | running the compat syscall (but does for the native one *sigh). |
| 5790 | |
Scott James Remnant | 2e513b6 | 2006-09-08 03:39:18 +0100 | [diff] [blame] | 5791 | 2006-09-08 Scott James Remnant <scott@netsplit.com> |
| 5792 | |
Scott James Remnant | 24865e3 | 2006-09-08 17:50:11 +0100 | [diff] [blame] | 5793 | * TODO: Update. |
| 5794 | |
Scott James Remnant | 29910f9 | 2006-09-08 03:49:20 +0100 | [diff] [blame] | 5795 | * nih/option.c (nih_option_help): Allow the usage string to be |
| 5796 | customised. |
| 5797 | (nih_option_set_usage): Using this function. |
| 5798 | * nih/option.h: Update. |
| 5799 | * nih/tests/test_option.c (test_help): Test the usage string. |
| 5800 | |
Scott James Remnant | 7f9a436 | 2006-09-08 03:42:45 +0100 | [diff] [blame] | 5801 | * nih/main.c (nih_main_daemonise): Use program_name for the pid file. |
| 5802 | * nih/main.h: Update. |
| 5803 | |
Scott James Remnant | 2e513b6 | 2006-09-08 03:39:18 +0100 | [diff] [blame] | 5804 | * nih/main.c (nih_main_daemonise): Add a daemonise function, |
| 5805 | pretty standard really. |
| 5806 | * nih/main.h: Update. |
| 5807 | |
Scott James Remnant | 1f38a00 | 2006-09-07 21:26:09 +0100 | [diff] [blame] | 5808 | 2006-09-07 Scott James Remnant <scott@netsplit.com> |
| 5809 | |
| 5810 | * AUTHORS: Mention the ChangeLog file. |
| 5811 | |
Scott James Remnant | 1725236 | 2006-09-04 07:15:40 +0100 | [diff] [blame] | 5812 | 2006-09-04 Scott James Remnant <scott@netsplit.com> |
| 5813 | |
Scott James Remnant | 4dc1674 | 2006-09-04 07:46:00 +0100 | [diff] [blame] | 5814 | * README: Add some documentation for the curious. |
| 5815 | |
Scott James Remnant | 1c7d2df | 2006-09-04 07:25:17 +0100 | [diff] [blame] | 5816 | * nih/file.c (nih_file_add_watch): Set nih_file_remove_watch as |
| 5817 | the default destructor so that nih_free can be called or work in |
| 5818 | a tree. |
| 5819 | (nih_file_remove_watch): Modify to not call nih_free and work if |
| 5820 | called multiple times. |
| 5821 | |
Scott James Remnant | f81341b | 2006-09-04 07:18:08 +0100 | [diff] [blame] | 5822 | * nih/signal.c (nih_signal_set_default, nih_signal_set_ignore): |
| 5823 | Set flags to zero when defaulting or ignoring signals. |
| 5824 | * nih/tests/test_signal.c (test_set_default, test_set_ignore) |
| 5825 | (test_reset): Modify test cases appropriately. |
| 5826 | |
Scott James Remnant | 1725236 | 2006-09-04 07:15:40 +0100 | [diff] [blame] | 5827 | * nih/hash.h: Add missing attribute for nih_hash_new |
| 5828 | * nih/list.h: Add missing attribute for nih_list_new |
| 5829 | |
Scott James Remnant | 8f7df05 | 2006-09-01 19:47:47 +0100 | [diff] [blame] | 5830 | 2006-09-01 Scott James Remnant <scott@netsplit.com> |
| 5831 | |
| 5832 | * nih/option.c (nih_option_group_help): Cast linelen to not induce |
| 5833 | a warning. |
| 5834 | |
Scott James Remnant | 133ff0e | 2006-08-31 02:01:57 +0100 | [diff] [blame] | 5835 | 2006-08-31 Scott James Remnant <scott@netsplit.com> |
| 5836 | |
Scott James Remnant | 4816f9a | 2006-09-01 03:07:51 +0100 | [diff] [blame] | 5837 | * nih/main.c (nih_main_loop_interrupt): Always initialise the |
| 5838 | interrupt pipe. |
| 5839 | (nih_main_loop_init): Move interrupt pipe initialisation to here |
| 5840 | so that it's always available. |
| 5841 | (nih_main_loop): Drop the extra call to nih_signal_poll(). |
| 5842 | |
Scott James Remnant | 420cffe | 2006-08-31 23:50:46 +0100 | [diff] [blame] | 5843 | * nih/option.c (nih_option_get_short, nih_option_get_long): Allow |
| 5844 | catch-all options. |
| 5845 | * nih/tests/test_option.c (test_parser): Test catch-all options. |
| 5846 | |
Scott James Remnant | 4593ff2 | 2006-08-31 18:57:06 +0100 | [diff] [blame] | 5847 | * TODO: Update. |
| 5848 | |
Scott James Remnant | 133ff0e | 2006-08-31 02:01:57 +0100 | [diff] [blame] | 5849 | * nih/option.c (nih_option_handle_arg): Free any existing option |
| 5850 | value. |
| 5851 | |
Scott James Remnant | 5b5c2e0 | 2006-08-30 01:57:36 +0100 | [diff] [blame] | 5852 | 2006-08-30 Scott James Remnant <scott@netsplit.com> |
| 5853 | |
Scott James Remnant | 99dada9 | 2006-08-30 16:12:47 +0100 | [diff] [blame] | 5854 | * nih/option.c (nih_option_debug): Add a hidden --debug option that |
| 5855 | sets the logging level up really high. |
| 5856 | (nih_option_handle): Just compare the names rather than offset |
| 5857 | within a list that can change. |
| 5858 | * nih/option.h: Update. |
| 5859 | * nih/tests/test_option.c (test_debug): Check that it works. |
| 5860 | |
Scott James Remnant | aa35203 | 2006-08-30 02:05:40 +0100 | [diff] [blame] | 5861 | * nih/option.c (nih_option_group_help): Output "Options" where we |
| 5862 | only have the one group. |
| 5863 | |
Scott James Remnant | 5b5c2e0 | 2006-08-30 01:57:36 +0100 | [diff] [blame] | 5864 | * nih/option.c (nih_option_group_help): Don't output options without |
| 5865 | help strings. |
| 5866 | * nih/tests/test_option.c (test_help): Update. |
| 5867 | |
Scott James Remnant | c3aaba8 | 2006-08-25 14:41:29 +0200 | [diff] [blame] | 5868 | 2006-08-25 Scott James Remnant <scott@netsplit.com> |
| 5869 | |
| 5870 | * nih/io.c (nih_io_watcher): Clean up the handling of the out of |
| 5871 | memory condition while extending the buffer so that we just return |
| 5872 | to be called again rather than end up performing some random action. |
| 5873 | |
Scott James Remnant | 59f3e4f | 2006-08-24 02:23:24 +0200 | [diff] [blame] | 5874 | 2006-08-24 Scott James Remnant <scott@netsplit.com> |
| 5875 | |
Scott James Remnant | 4ff39ce | 2006-08-24 02:53:51 +0200 | [diff] [blame] | 5876 | * nihify (src_dir): Also copy m4/Makefile.am |
| 5877 | |
Scott James Remnant | 55a481d | 2006-08-24 02:31:01 +0200 | [diff] [blame] | 5878 | * nih/file.c (nih_file_remove_watch): Raise the error before |
| 5879 | performing other actions so errno is not lost. |
| 5880 | |
Scott James Remnant | 0a63a3d | 2006-08-24 02:23:48 +0200 | [diff] [blame] | 5881 | * nih/io.c (nih_io_watcher): Fix a pretty critical bug, we weren't |
| 5882 | saving the value of errno so it was usually zero by the time we |
| 5883 | looked at it. |
| 5884 | |
Scott James Remnant | 59f3e4f | 2006-08-24 02:23:24 +0200 | [diff] [blame] | 5885 | * nih/logging.c (nih_logger_syslog): Useful alternative to |
| 5886 | nih_logger_printf. |
| 5887 | * nih/logging.h: Update. |
| 5888 | |
Scott James Remnant | 377333d | 2006-08-23 19:47:28 +0200 | [diff] [blame] | 5889 | 2006-08-23 Scott James Remnant <scott@netsplit.com> |
| 5890 | |
Scott James Remnant | 1997231 | 2006-08-23 21:55:49 +0200 | [diff] [blame] | 5891 | * nih/tests/test_string.c: Add missing free calls. |
| 5892 | |
Scott James Remnant | 61e4547 | 2006-08-23 21:51:33 +0200 | [diff] [blame] | 5893 | * nih/tests/test_io.c (test_watcher): Silence the error message. |
| 5894 | * nih/tests/test_option.c (test_parser): Add some forgotten calls |
| 5895 | to nih_free |
| 5896 | |
Scott James Remnant | 94e3768 | 2006-08-23 21:43:41 +0200 | [diff] [blame] | 5897 | * nih/main.c (nih_main_init_full): Free the package string when |
| 5898 | overwriting it. |
| 5899 | |
Scott James Remnant | a82b009 | 2006-08-23 21:39:00 +0200 | [diff] [blame] | 5900 | * nih/tests/test_logging.c: Keep a copy of the last message |
| 5901 | otherwise we're reading free'd memory (again). |
| 5902 | |
Scott James Remnant | f8880bb | 2006-08-23 21:34:20 +0200 | [diff] [blame] | 5903 | * nih/tests/test_list.c: Memory cleanups. |
| 5904 | |
Scott James Remnant | 5bc4691 | 2006-08-23 21:30:12 +0200 | [diff] [blame] | 5905 | * nih/signal.c (nih_signal_set_default, nih_signal_set_ignore): |
| 5906 | Don't initialise the signals list, there's no need. |
| 5907 | |
Scott James Remnant | a26ebc2 | 2006-08-23 20:47:20 +0200 | [diff] [blame] | 5908 | * nih/tests/test_hash.c: Various missing calls to nih_free. |
| 5909 | |
Scott James Remnant | 0344eb4 | 2006-08-23 20:41:11 +0200 | [diff] [blame] | 5910 | * nih/file.c (nih_file_remove_watch): Fix another wrong call to |
| 5911 | nih_free. |
| 5912 | |
Scott James Remnant | e5f85e3 | 2006-08-23 20:33:34 +0200 | [diff] [blame] | 5913 | * nih/tests/test_child.c (test_poll): Free the watcher. |
| 5914 | |
Scott James Remnant | c391227 | 2006-08-23 20:26:39 +0200 | [diff] [blame] | 5915 | * nih/file.c (nih_file_remove_watch): Remove from the containing |
| 5916 | list before freeing. |
| 5917 | * nih/tests/test_file.c (my_watcher): Make sure we copy the name |
| 5918 | as it will be freed by the time we get back to the test. |
| 5919 | |
Scott James Remnant | b5f985a | 2006-08-23 20:21:39 +0200 | [diff] [blame] | 5920 | * nih/list.c (nih_list_free): Don't throw away the destructor |
| 5921 | return value. |
| 5922 | |
Scott James Remnant | a790a31 | 2006-08-23 20:01:04 +0200 | [diff] [blame] | 5923 | * nih/tests/test_error.c: Further missing calls to nih_free |
| 5924 | |
Scott James Remnant | 85f1047 | 2006-08-23 19:56:34 +0200 | [diff] [blame] | 5925 | * nih/tests/test_alloc.c: Correct a few missing nih_free's |
| 5926 | |
Scott James Remnant | 377333d | 2006-08-23 19:47:28 +0200 | [diff] [blame] | 5927 | * nih/file.c (nih_file_map): Correct a thinko, have to mask |
| 5928 | flags by O_ACCMODE and compare for equality to extract the open |
| 5929 | access mode. |
| 5930 | |
Scott James Remnant | ecce628 | 2006-08-22 12:23:07 +0200 | [diff] [blame] | 5931 | 2006-08-22 Scott James Remnant <scott@netsplit.com> |
| 5932 | |
| 5933 | * nih/file.c (nih_file_map, nih_file_unmap): Add an easier to use |
| 5934 | wrapper around mmap() when we just want the file in memory. |
| 5935 | * nih/file.h: Add prototypes. |
| 5936 | * nih/tests/test_file.c (test_map): Test the functions. |
| 5937 | |
Scott James Remnant | 097a7e1 | 2006-08-21 01:25:23 +0200 | [diff] [blame] | 5938 | 2006-08-21 Scott James Remnant <scott@netsplit.com> |
| 5939 | |
| 5940 | * nih/file.c: Wrap the inotify syscalls with something a little |
| 5941 | friendlier to deal with. |
| 5942 | * nih/file.h: Typedefs, structures and prototypes. |
| 5943 | * nih/libnih.h: Include file.h |
| 5944 | * nih/io.h: Correct typo in argument name. |
| 5945 | * nih/Makefile.am (libnih_la_SOURCES): Build and link file.c |
| 5946 | (nihinclude_HEADERS): Install file.h |
| 5947 | (TESTS): Build and run file test cases |
| 5948 | (test_file_SOURCES, test_file_LDFLAGS, test_file_LDADD): Details |
| 5949 | for file test case binary |
| 5950 | |
Scott James Remnant | 0cf12e8 | 2006-08-19 17:41:41 +0100 | [diff] [blame] | 5951 | 2006-08-19 Scott James Remnant <scott@netsplit.com> |
| 5952 | |
Scott James Remnant | abcffd8 | 2006-08-19 19:10:02 +0100 | [diff] [blame] | 5953 | * nih/option.c (nih_option_parser): Finish option processing when |
| 5954 | the first non-option argument is found (command-mode) |
| 5955 | * nih/option.h: Update. |
| 5956 | * nih/tests/test_option.c (test_parser): Test command-mode. |
| 5957 | |
Scott James Remnant | 4dcce34 | 2006-08-19 18:59:07 +0100 | [diff] [blame] | 5958 | * nih/option.c: Implement a simple, yet flexible option parser. |
| 5959 | * nih/option.h: Typedefs, structures and prototypes. |
| 5960 | * nih/libnih.h: Include option.h |
| 5961 | * nih/tests/test_option.c: Test it all pretty thoroughly. |
| 5962 | * nih/Makefile.am (libnih_la_SOURCES): Build and link option.c |
| 5963 | (nihinclude_HEADERS): Install option.h |
| 5964 | (TESTS): Run the option test cases |
| 5965 | (test_option_SOURCES, test_option_LDFLAGS, test_option_LDADD): |
| 5966 | Details for the option test case binary. |
| 5967 | * TODO: Update. |
| 5968 | |
Scott James Remnant | 0cf12e8 | 2006-08-19 17:41:41 +0100 | [diff] [blame] | 5969 | * nih/string.c (nih_str_wrap): Implement a function to wrap a |
| 5970 | string into the desired number of characters wide. |
| 5971 | * nih/string.h: Update. |
| 5972 | * nih/tests/test_string.c (test_str_wrap): Test the new function |
| 5973 | to make sure it does the right things. |
| 5974 | |
Scott James Remnant | 13b0e07 | 2006-08-18 18:50:11 +0100 | [diff] [blame] | 5975 | 2006-08-18 Scott James Remnant <scott@netsplit.com> |
| 5976 | |
Scott James Remnant | 293072c | 2006-08-18 20:37:51 +0100 | [diff] [blame] | 5977 | * TODO: Update. |
| 5978 | |
Scott James Remnant | 034abdf | 2006-08-18 20:36:40 +0100 | [diff] [blame] | 5979 | * nih/main.h (nih_main_init_gettext): Macro that expands to the |
| 5980 | usual gettext initialisation spiel if ENABLE_NLS is set, or nothing |
| 5981 | if not. |
| 5982 | (nih_main_init): Expand nih_main_init_gettext as well, we almost |
| 5983 | always want to do that, after all. |
| 5984 | * nih/macros.h: Include locale.h if ENABLE_NLS is set, as that |
| 5985 | contains setlocale, amongst other things. |
| 5986 | * nih/tests/test_main.c (test_init_gettext): Check the macro does |
| 5987 | the right things. |
| 5988 | |
Scott James Remnant | 104d3dc | 2006-08-18 19:48:17 +0100 | [diff] [blame] | 5989 | * nih/io.h (NihIoCb): Rename to NihIoWatcher. |
| 5990 | (NihIoReadCb): Rename to NihIoReader. |
| 5991 | (NihIoCloseCb): Rename to NihIoCloseHandler. |
| 5992 | (NihIoErrorCb): Rename to NihIoErrorHandler. |
| 5993 | (NihIoWatch): Rename callback member to watcher. |
| 5994 | (NihIo): Rename read_cb member to reader, close_cb member to |
| 5995 | close_handler and error_cb member to error_handler. |
| 5996 | * nih/io.c: Update to use new names. |
| 5997 | (nih_io_cb): Rename to nih_io_watcher. |
| 5998 | * nih/tests/test_io.c: Update to use new names. |
| 5999 | |
Scott James Remnant | 13b0e07 | 2006-08-18 18:50:11 +0100 | [diff] [blame] | 6000 | * TODO: Update. |
| 6001 | |
Scott James Remnant | eeaebb6 | 2006-08-16 00:49:21 +0100 | [diff] [blame] | 6002 | 2006-08-16 Scott James Remnant <scott@netsplit.com> |
| 6003 | |
Scott James Remnant | 10a9f97 | 2006-08-16 16:49:38 +0100 | [diff] [blame] | 6004 | * nih/main.c (nih_main_loop_add_func): Add a loop function |
| 6005 | (nih_main_loop): Run the loop functions. |
| 6006 | * nih/main.h (NihMainLoopCb, NihMainLoopFunc): Typedefs and |
| 6007 | structures for main loop callbacks. |
| 6008 | * nih/tests/test_main.c (test_main_loop_add_func): Check that |
| 6009 | the loop function is allocated correctly. |
| 6010 | (test_main_loop): Make sure it actually gets called. |
| 6011 | |
Scott James Remnant | c469755 | 2006-08-16 03:56:22 +0100 | [diff] [blame] | 6012 | * nih/io.c (nih_io_cb): Add a couple of check assertions. |
| 6013 | |
Scott James Remnant | eeaebb6 | 2006-08-16 00:49:21 +0100 | [diff] [blame] | 6014 | * nih/macros.h (N_): Should be defined to be a no-op. |
| 6015 | |
Scott James Remnant | 5cabc80 | 2006-08-14 00:16:18 +0100 | [diff] [blame] | 6016 | 2006-08-14 Scott James Remnant <scott@netsplit.com> |
| 6017 | |
Scott James Remnant | a3b7769 | 2006-08-14 21:10:57 +0100 | [diff] [blame] | 6018 | * nih/alloc.c (nih_realloc): Yet another fix to realloc, we |
| 6019 | forgot to reinitialise our entry in the parent's children list in |
| 6020 | the case of no parent. After fixing this and tracing the code, I |
| 6021 | realised that the previous fix was inelegant and there is a way to |
| 6022 | deal with children without modifying the pointers until after the |
| 6023 | reallocation. Documented the reasoning in the function. |
| 6024 | |
Scott James Remnant | 5cabc80 | 2006-08-14 00:16:18 +0100 | [diff] [blame] | 6025 | * nih/io.c (nih_io_reopen): Report on the error rather than just |
| 6026 | suppressing it. |
| 6027 | (nih_io_error): Likewise, report on the error. |
| 6028 | |
Scott James Remnant | f2642c4 | 2006-08-12 00:50:21 +0100 | [diff] [blame] | 6029 | 2006-08-12 Scott James Remnant <scott@netsplit.com> |
| 6030 | |
Scott James Remnant | f0766ce | 2006-08-12 19:41:55 +0100 | [diff] [blame] | 6031 | * nih/main.c (nih_main_loop_close): Drop this function |
| 6032 | (nih_main_loop): Instead mark them close on exec. |
| 6033 | * nih/main.h: Update. |
| 6034 | |
Scott James Remnant | f0857b0 | 2006-08-12 19:37:47 +0100 | [diff] [blame] | 6035 | * nih/main.c (nih_main_loop): Change the main loop to use select |
| 6036 | instead of poll, as its semantics are a lot easier to deal with. |
| 6037 | We also use allow select to be interrupted by writing to a pipe |
| 6038 | from the signal handlers, for when Linux gets around to supporting |
| 6039 | SA_RESTART properly. |
| 6040 | (nih_main_loop_interrupt): Write to the pipe so the select call gets |
| 6041 | interrupted. |
| 6042 | (nih_main_loop_exit): Interrupt the main loop, in case we're |
| 6043 | waiting forever. |
| 6044 | (nih_main_loop_close): Close the interrupt pipe, used in children. |
| 6045 | * nih/main.h: Update. |
| 6046 | * nih/io.c (nih_io_add_watch): Change type of events parameter. |
| 6047 | (nih_io_poll_fds): Remove this function. |
| 6048 | (nih_io_select_fds): And replace with this that sets the select |
| 6049 | file descriptor sets instead. |
| 6050 | (nih_io_handle_fds): Now receives select file descriptor sets, and |
| 6051 | becomes rather more obvious in the process. Restore the previous |
| 6052 | behaviour where a callback isn't called unless requests events |
| 6053 | occur. |
| 6054 | (nih_io_reopen): Always poll for reading so we pick up errors. |
| 6055 | (nih_io_cb): Change type of events parameter and events settings. |
| 6056 | (nih_io_write): Change event settings. |
| 6057 | * nih/io.h: Update. |
| 6058 | (NihIoEvents): replace the previous poll events with a new enum. |
| 6059 | * nih/signal.c (nih_signal_handler): Interrupt the select call in |
| 6060 | the main loop. |
| 6061 | * nih/tests/test_io.c: Update with new test cases. |
| 6062 | * nih/tests/test_child.c: Use select() rather than poll() |
| 6063 | |
Scott James Remnant | f6bc0c5 | 2006-08-12 14:48:57 +0100 | [diff] [blame] | 6064 | * nih/tests/test_io.c (test_buffer_push, test_write): Correct |
| 6065 | uninitialised return value. |
| 6066 | |
Scott James Remnant | 1e6b91b | 2006-08-12 02:26:28 +0100 | [diff] [blame] | 6067 | * nih/main.c (nih_main_loop): Correct a memory leak, we forgot |
| 6068 | to clean up the poll fds list. |
| 6069 | |
Scott James Remnant | f75da13 | 2006-08-12 01:58:37 +0100 | [diff] [blame] | 6070 | * nih/io.c (nih_io_handle_fds): Always call the callback, even if |
| 6071 | unexpected events happen, otherwise we'll miss ERR, HUP, etc. |
| 6072 | (nih_io_shutdown): Allow a socket to be closed lazily, so we can |
| 6073 | send (or receive) a whole bunch of stuff and expect the structure to |
| 6074 | go away afterwards. |
| 6075 | (nih_io_cb): If the shutdown flag has been marked and we run out |
| 6076 | of things in either buffer, act as if one end was closed. |
| 6077 | (nih_io_reopen): Mark sockets as not shutdown by default. |
| 6078 | * nih/io.h: Update. |
| 6079 | * nih/tests/test_io.c (test_shutdown): Test behaviour. |
| 6080 | (test_handle_fds): Take out some of the tests due to changed |
| 6081 | behaviour. While "clever" I think overall this is undesirable. |
| 6082 | |
Scott James Remnant | f2642c4 | 2006-08-12 00:50:21 +0100 | [diff] [blame] | 6083 | * nih/io.c (nih_io_set_cloexec): Function to set the FD_CLOEXEC flag. |
| 6084 | * nih/io.h: Update. |
| 6085 | * nih/tests/test_io.c (test_set_cloexec): Test the function. |
| 6086 | |
Scott James Remnant | 60d62fb | 2006-08-11 23:03:39 +0100 | [diff] [blame] | 6087 | 2006-08-11 Scott James Remnant <scott@netsplit.com> |
| 6088 | |
Scott James Remnant | af2d3b5 | 2006-08-11 23:08:24 +0100 | [diff] [blame] | 6089 | * nih/alloc.h, nih/child.h, nih/hash.h, nih/logging.h, nih/signal.h, |
| 6090 | nih/timer.h: Document arguments to function pointers. |
| 6091 | |
Scott James Remnant | 60d62fb | 2006-08-11 23:03:39 +0100 | [diff] [blame] | 6092 | * nih/io.c: Add a whole bunch of code to provide us with a high- |
| 6093 | throughput, async file/socket layer; largely copied from the |
| 6094 | dircproxy code (well, it works!). This allows read and write calls |
| 6095 | to happen inside the main loop based on whenever poll thinks either |
| 6096 | is possible, while user space can just write what it likes or get |
| 6097 | called when there's data in the recv buffer. |
| 6098 | * nih/io.h: Add the new typedefs, structures and prototypes. |
| 6099 | * nih/tests/test_io.c: Lots of test cases for this stuff. |
| 6100 | |
Scott James Remnant | edc0579 | 2006-08-10 03:12:48 +0100 | [diff] [blame] | 6101 | 2006-08-10 Scott James Remnant <scott@netsplit.com> |
| 6102 | |
Scott James Remnant | 3cbb3a1 | 2006-08-10 03:28:32 +0100 | [diff] [blame] | 6103 | * nih/alloc.c (nih_realloc): Fix a fairly critical bug, we weren't |
| 6104 | dealing with the fact that the children list head can move; |
| 6105 | do some fancy shifting to make that work. |
| 6106 | |
Scott James Remnant | edc0579 | 2006-08-10 03:12:48 +0100 | [diff] [blame] | 6107 | * nih/string.c (nih_str_split): Add a function to split a string |
| 6108 | based on delimiters into an array. |
| 6109 | * nih/string.h: Update. |
| 6110 | * nih/tests/test_string.c (test_str_split): Test the new function. |
| 6111 | |
Scott James Remnant | 5ae01a9 | 2006-08-09 17:48:05 +0100 | [diff] [blame] | 6112 | 2006-08-09 Scott James Remnant <scott@netsplit.com> |
| 6113 | |
Scott James Remnant | 61edf23 | 2006-08-09 17:48:15 +0100 | [diff] [blame] | 6114 | * nih/tests/test_child.c (test_poll): Add extra sleep calls for |
| 6115 | safety. |
| 6116 | |
Scott James Remnant | 5ae01a9 | 2006-08-09 17:48:05 +0100 | [diff] [blame] | 6117 | * nih/libnih.h: Include errors.h |
| 6118 | |
Scott James Remnant | a984d77 | 2006-08-04 05:29:36 +0100 | [diff] [blame] | 6119 | 2006-08-04 Scott James Remnant <scott@netsplit.com> |
| 6120 | |
| 6121 | * nih/errors.h: Include errno.h for helpfulness. |
| 6122 | |
Scott James Remnant | 76fb5ab | 2006-08-03 19:12:48 +0100 | [diff] [blame] | 6123 | 2006-08-03 Scott James Remnant <scott@netsplit.com> |
| 6124 | |
Scott James Remnant | 06054ae | 2006-08-03 19:43:46 +0100 | [diff] [blame] | 6125 | * nih/child.c (nih_child_add_watch): Also takes a parent now. |
| 6126 | * nih/child.h: Update. |
| 6127 | * nih/tests/test_child.c: Update. |
| 6128 | |
Scott James Remnant | a34d416 | 2006-08-03 19:25:16 +0100 | [diff] [blame] | 6129 | * nih/io.c (nih_io_add_watch): And once more, with feeling; takes |
| 6130 | a parent for the watch. |
| 6131 | * nih/io.h: Update. |
| 6132 | * nih/tests/test_io.c: Update. |
| 6133 | |
Scott James Remnant | ee7c344 | 2006-08-03 19:22:35 +0100 | [diff] [blame] | 6134 | * nih/signal.c (nih_signal_add_callback): Give this the same treatment, |
| 6135 | it takes the parent for the signal callback. |
| 6136 | * nih/signal.h: Update. |
| 6137 | * nih/tests/test_signal.c: Update. |
| 6138 | |
Scott James Remnant | 6840fe3 | 2006-08-03 19:20:03 +0100 | [diff] [blame] | 6139 | * nih/timer.c (nih_timer_add_timeout, nih_timer_add_periodic) |
| 6140 | (nih_timer_add_scheduled): Use nih_alloc properly by taking a parent |
| 6141 | for the timer object and setting a destructor on it so that it's |
| 6142 | automatically removed when the parent is freed. |
| 6143 | * nih/timer.h: Update. |
| 6144 | * nih/tests/test_timer.c: Update function calls. |
| 6145 | * nih/tests/test_main.c (test_main_loop): Update also. |
| 6146 | |
Scott James Remnant | fade70e | 2006-08-03 19:14:42 +0100 | [diff] [blame] | 6147 | * nih/list.c (nih_list_destructor): Add a destructor function that |
| 6148 | just cuts the entry out of the list in preperation for being freed. |
| 6149 | * nih/list.h: Update. |
| 6150 | * nih/tests/test_list.c (test_destructor): Test the behaviour of |
| 6151 | the new function. |
| 6152 | |
Scott James Remnant | 76fb5ab | 2006-08-03 19:12:48 +0100 | [diff] [blame] | 6153 | * nih/tests/test_error.c: Include fixes. |
| 6154 | |
Scott James Remnant | 441e1ac | 2006-08-02 02:29:50 +0100 | [diff] [blame] | 6155 | 2006-08-02 Scott James Remnant <scott@netsplit.com> |
| 6156 | |
Scott James Remnant | 30f0191 | 2006-08-02 18:47:34 +0100 | [diff] [blame] | 6157 | * nih/signal.c (nih_signal_set_handler, nih_signal_set_default) |
| 6158 | (nih_signal_set_ignore): Reset sa_flags so that we don't pass |
| 6159 | uninitialised data for SIGALRM. |
| 6160 | (nih_signal_reset): Add function to reset signals back to their |
| 6161 | default state. |
| 6162 | * nih/signal.h: Update. |
| 6163 | * nih/tests/test_signal.c (test_reset): Add test case. |
| 6164 | |
Scott James Remnant | 11afc02 | 2006-08-02 18:38:51 +0100 | [diff] [blame] | 6165 | * nih/error.c (nih_error_raise_system): Be a lot more careful in |
| 6166 | this function! Save the value of errno in case we overwrite it |
| 6167 | and call nih_error_init() |
| 6168 | |
Scott James Remnant | 81cb8c6 | 2006-08-02 08:40:47 +0100 | [diff] [blame] | 6169 | * nih/signal.c (nih_signal_set_handler): Add the SA_NOCLDSTOP |
| 6170 | signal for SIGCHLD. |
| 6171 | |
Scott James Remnant | 3f16fca | 2006-08-02 08:20:54 +0100 | [diff] [blame] | 6172 | * nih/main.c (nih_main_loop): Drop the code that masked out the |
| 6173 | child signal, it was inherently racy and there's no particular |
| 6174 | reason to do it anyway since we use SA_RESTART in signal.c for |
| 6175 | most things. |
| 6176 | |
Scott James Remnant | a6194c4 | 2006-08-02 08:11:09 +0100 | [diff] [blame] | 6177 | * nih/signal.c (nih_signal_set_handler, nih_signal_set_default) |
| 6178 | (nih_signal_set_ignore): don't set SA_RESTART for SIGALRM. |
| 6179 | |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6180 | * nih/signal.c (nih_signal_set_handler, nih_signal_set_default) |
| 6181 | (nih_signal_set_ignore): use nih_return_system_error to make the |
Scott James Remnant | 468da98 | 2006-08-02 05:17:51 +0100 | [diff] [blame] | 6182 | code rather cleaner. |
| 6183 | |
| 6184 | * nih/error.h (nih_return_error): Add missing doc for retval |
| 6185 | (nih_return_system_error): Add additional useful function. |
| 6186 | * nih/tests/test_error.c (test_return_system_error): Add test |
| 6187 | case for the new macro. |
| 6188 | |
Scott James Remnant | 8b11f49 | 2006-08-02 02:59:24 +0100 | [diff] [blame] | 6189 | * nih/child.c (nih_child_poll): Convert to use waitid() so that |
| 6190 | we can obtain the information about the dead child without reaping |
| 6191 | it until we're done processing; useful because it means /proc/$PID |
| 6192 | and the child itself is still around during the handlers. |
| 6193 | * nih/child.h (NihReaper): Gains a new third argument that indicates |
| 6194 | whether the child exited normally or was killed. |
| 6195 | * nih/tests/test_child.c (test_poll): Update. |
| 6196 | |
Scott James Remnant | d2dd1b5 | 2006-08-02 02:51:40 +0100 | [diff] [blame] | 6197 | * nihify: Add a few useful sanity checks so that it works with |
| 6198 | relative paths and already-nihified directories. |
| 6199 | |
Scott James Remnant | c4bb109 | 2006-08-02 02:46:02 +0100 | [diff] [blame] | 6200 | * m4/misc.m4: Remove older force code. |
| 6201 | |
Scott James Remnant | 1dd73a6 | 2006-08-02 02:44:19 +0100 | [diff] [blame] | 6202 | * TODO: Updated. |
| 6203 | |
Scott James Remnant | e470462 | 2006-08-02 02:40:53 +0100 | [diff] [blame] | 6204 | * m4/Makefile.am (dist_aclocal_DATA): Distribute misc.m4, long |
| 6205 | missed. |
| 6206 | |
Scott James Remnant | d2dd1b5 | 2006-08-02 02:51:40 +0100 | [diff] [blame] | 6207 | * nihify: Add useful script for symlinking into source trees until |
| 6208 | we intend to get released. |
Scott James Remnant | 8ec197b | 2006-08-02 02:40:33 +0100 | [diff] [blame] | 6209 | |
Scott James Remnant | 441e1ac | 2006-08-02 02:29:50 +0100 | [diff] [blame] | 6210 | * HACKING: Correct typo (our -> out) |
| 6211 | |
Scott James Remnant | 70bc30c | 2006-07-28 02:46:48 +0100 | [diff] [blame] | 6212 | 2006-07-28 Scott James Remnant <scott@netsplit.com> |
| 6213 | |
Scott James Remnant | 1c5b624 | 2006-07-28 06:38:45 +0100 | [diff] [blame] | 6214 | * nih/main.c (nih_main_term_signal): Handy signal callback. |
| 6215 | * nih/main.h: Update. |
| 6216 | * nih/tests/test_main.c (my_timeout): Cheat and ensure the latest |
| 6217 | exit status is used. |
| 6218 | |
Scott James Remnant | 52832a0 | 2006-07-28 06:33:01 +0100 | [diff] [blame] | 6219 | * nih/main.c (nih_main_loop): Implement a main loop by calling |
| 6220 | various other functions in the right manner. |
| 6221 | (nih_main_loop_exit): Function to break the main loop. |
| 6222 | * nih/main.h: Update. |
| 6223 | * nih/tests/test_main.c (test_main_loop): Add a trivial test case |
| 6224 | for the main loop, it's damned difficult to test, but at least this |
| 6225 | ensures the bases are touched. |
| 6226 | |
Scott James Remnant | 1d5b190 | 2006-07-28 06:16:35 +0100 | [diff] [blame] | 6227 | * nih/signal.c (nih_signal_poll): Add missing call to |
| 6228 | nih_signal_init() |
| 6229 | * nih/child.c (nih_child_poll): Add missing call to nih_child_init() |
| 6230 | * nih/io.c (nih_io_poll_fds, nih_io_handle_fds): Add missing calls |
| 6231 | to nih_io_init() |
| 6232 | |
Scott James Remnant | e22dea5 | 2006-07-28 06:11:37 +0100 | [diff] [blame] | 6233 | * nih/io.c: Code for watching file descriptors and sockets for |
| 6234 | events through poll(), but not actually the poll() call itself. |
| 6235 | * nih/io.h: Typedefs, structures and prototypes. |
| 6236 | * nih/libnih.h: Include io.h |
| 6237 | * nih/tests/test_io.c: Test cases for I/O watches. |
| 6238 | * nih/Makefile.am (libnih_la_SOURCES): Build and link io.c |
| 6239 | (nihinclude_HEADERS): Install io.h |
| 6240 | (TESTS): Build and run I/O test cases |
| 6241 | (test_io_SOURCES, test_io_LDFLAGS, test_io_LDADD): Details for I/O |
| 6242 | test case binary. |
| 6243 | |
Scott James Remnant | 2929993 | 2006-07-28 06:11:26 +0100 | [diff] [blame] | 6244 | * nih/tests/test_timer.c (test_poll): Free entry after testing. |
| 6245 | |
Scott James Remnant | 88f0459 | 2006-07-28 04:32:33 +0100 | [diff] [blame] | 6246 | * nih/child.c (nih_child_poll): When the reaper is for a particular |
| 6247 | process, be sure to remove it from the list. |
| 6248 | * nih/tests/test_child.c (test_poll): Test for that. |
| 6249 | |
Scott James Remnant | c5bfa47 | 2006-07-28 04:21:36 +0100 | [diff] [blame] | 6250 | * nih/child.c: Simple bit of code to wait for children to |
| 6251 | terminate and dispatch the reaper functions for them. |
| 6252 | * nih/child.h: Typedefs, structures and prototypes. |
| 6253 | * nih/libnih.h: Include child.h |
| 6254 | * nih/tests/test_child.c: Test cases for child handling code. |
| 6255 | * nih/Makefile.am (libnih_la_SOURCES): Build and link child.c |
| 6256 | (nihinclude_HEADERS): Install child.h |
| 6257 | (TESTS): Build and run child test cases |
| 6258 | (test_child_SOURCES, test_child_LDFLAGS, test_child_LDADD): Details |
| 6259 | for child test case binary. |
| 6260 | |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6261 | * nih/timer.c (nih_timer_add_timeout, nih_timer_add_periodic) |
| 6262 | (nih_timer_add_scheduled): Change argument order so that the time |
Scott James Remnant | 37e8eb5 | 2006-07-28 02:52:06 +0100 | [diff] [blame] | 6263 | information is first, to match signal functions. |
| 6264 | * nih/timer.h: Update. |
| 6265 | * nih/tests/test_timer.c: Update. |
| 6266 | |
Scott James Remnant | ee5dec7 | 2006-07-28 02:48:43 +0100 | [diff] [blame] | 6267 | * nih/signal.h: Include the system signal.h for ease of use. |
| 6268 | |
Scott James Remnant | 70bc30c | 2006-07-28 02:46:48 +0100 | [diff] [blame] | 6269 | * nih/signal.c: Code for handling signals inside the main loop, |
| 6270 | rather than trying to fit delicate code in a signal handler; and |
| 6271 | for making it generally easier to handle signals. |
| 6272 | * nih/signal.h: Typedefs and prototypes. |
| 6273 | * nih/libnih.h: Include signal.h |
| 6274 | * nih/Makefile.am (libnih_la_SOURCES): Build and link signal.c |
| 6275 | (nihinclude_HEADERS): Install signal.h |
| 6276 | (TESTS): Build and run signal test cases |
| 6277 | (test_signal_SOURCES, test_signal_LDFLAGS, test_signal_LDADD): Details |
| 6278 | for signal test case binary. |
| 6279 | |
Scott James Remnant | 3a0f878 | 2006-07-27 18:39:54 +0100 | [diff] [blame] | 6280 | 2006-07-27 Scott James Remnant <scott@netsplit.com> |
| 6281 | |
Scott James Remnant | 4eeca5e | 2006-07-27 23:28:00 +0100 | [diff] [blame] | 6282 | * nih/timer.c: Code for timeouts, periodic and scheduled timers, |
| 6283 | note that the actual scheduling part of scheduled timers it not |
| 6284 | implemented yet (we need to think a bit more about it) |
| 6285 | * nih/timer.h: Structures, macros and prototypes. |
| 6286 | * nih/libnih.h: Include timer.h |
| 6287 | * nih/tests/test_timer.c: Test cases for timer code. |
| 6288 | * nih/Makefile.am (libnih_la_SOURCES): Build and link timer.c |
| 6289 | (nihinclude_HEADERS): Install timer.h |
| 6290 | (TESTS): Build and run timer test cases |
| 6291 | (test_timer_SOURCES, test_timer_LDFLAGS, test_timer_LDADD): Details |
| 6292 | for timer test case binary. |
| 6293 | |
Scott James Remnant | 2bd715e | 2006-07-27 22:58:33 +0100 | [diff] [blame] | 6294 | * nih/alloc.c (nih_free): Use new safe list iteration macro. |
| 6295 | |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6296 | * nih/hash.c (nih_hash_add_unique, nih_hash_replace) |
| 6297 | (nih_hash_search): Use new list iteration macros. |
Scott James Remnant | 7f12ab6 | 2006-07-27 22:58:15 +0100 | [diff] [blame] | 6298 | |
Scott James Remnant | 48eb897 | 2006-07-27 22:57:27 +0100 | [diff] [blame] | 6299 | * nih/list.h (NIH_LIST_FOREACH): New macro that expands to the usual |
| 6300 | list iteration for loop, prevents mistakes. |
| 6301 | (NIH_LIST_FOREACH_SAFE): Macro that does the same as above, but also |
| 6302 | includes a "next" variable to allow safe iteration; especially useful |
| 6303 | to prevent us getting this wrong! |
| 6304 | * nih/tests/test_list.c (test_foreach, test_foreach_safe): Add test |
| 6305 | cases for iteration. |
| 6306 | |
Scott James Remnant | c2b73bc | 2006-07-27 18:49:27 +0100 | [diff] [blame] | 6307 | * nih/error.c (nih_error_init): Make inline and check value first. |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6308 | (nih_error_raise, nih_error_raise_printf, nih_error_raise_again) |
| 6309 | (nih_error_push_context): Unconditionally call nih_error_init. |
Scott James Remnant | c2b73bc | 2006-07-27 18:49:27 +0100 | [diff] [blame] | 6310 | |
Scott James Remnant | 361a64b | 2006-07-27 18:48:02 +0100 | [diff] [blame] | 6311 | * nih/alloc.c (nih_alloc_init): Make inline and check value first. |
| 6312 | (nih_alloc): Unconditionally call nih_alloc_init. |
| 6313 | |
Scott James Remnant | c840e39 | 2006-07-27 18:47:21 +0100 | [diff] [blame] | 6314 | * nih/logging.c (nih_log_init): Use the proper functions to |
| 6315 | initialise details, check values first; also make inline. |
| 6316 | (nih_log_message): Unconditionally call nih_log_init. |
| 6317 | |
Scott James Remnant | c2e442b | 2006-07-27 18:40:22 +0100 | [diff] [blame] | 6318 | * nih/Makefile.am (DEFS): Append to the default DEFS list, rather |
| 6319 | than overriding, otherwise we lose HAVE_CONFIG_H |
| 6320 | |
Scott James Remnant | 3a0f878 | 2006-07-27 18:39:54 +0100 | [diff] [blame] | 6321 | * nih/macros.h: Check for ENABLE_NLS instead of HAVE_GETTEXT and |
| 6322 | include libintl.h if defined as well. |
| 6323 | |
Scott James Remnant | 0efbb8f | 2006-07-20 02:30:05 +0100 | [diff] [blame] | 6324 | 2006-07-20 Scott James Remnant <scott@netsplit.com> |
| 6325 | |
Scott James Remnant | a56ead6 | 2006-07-20 02:54:06 +0100 | [diff] [blame] | 6326 | * nih/string.c (nih_strv_free): Add a function to free an array |
| 6327 | of strings. |
| 6328 | * nih/string.h: Update. |
| 6329 | * nih/tests/test_string.c (test_strv_free): Test the function. |
| 6330 | |
Scott James Remnant | 81616de | 2006-07-20 02:41:06 +0100 | [diff] [blame] | 6331 | * nih/error.c: Error handling code. |
| 6332 | * nih/error.h: Structures, macros and prototypes. |
| 6333 | * nih/errors.h: Error enum and message definitions. |
| 6334 | * nih/libnih.h: Include error.h and errors.h |
| 6335 | * nih/tests/test_error.c: Error handling test cases. |
| 6336 | * nih/Makefile.am (libnih_la_SOURCES): Build and link error.h |
| 6337 | (nihinclude_HEADERS): Install error.h |
| 6338 | (TESTS): Build and run error handling test cases. |
| 6339 | (test_error_SOURCES, test_error_LDFLAGS, test_error_LDADD): Binary |
| 6340 | for error handling test cases. |
| 6341 | |
Scott James Remnant | 15802c2 | 2006-07-20 02:40:30 +0100 | [diff] [blame] | 6342 | * nih/macros.h (NIH_MUST, NIH_MUST_NOT): Add handy macros to spin |
| 6343 | until we get a true or false value from an assignment. Usually |
| 6344 | used around a call to memory allocation functions that we can't |
| 6345 | deal with failing. |
| 6346 | |
Scott James Remnant | 9d80a0f | 2006-07-20 02:38:29 +0100 | [diff] [blame] | 6347 | * nih/main.c (nih_main_package_string): Change package_string |
| 6348 | to be a module-level static so it can be reset by a call to |
| 6349 | nih_main_init_full. Always return if not NULL. |
| 6350 | * nih/tests/test_main.c (test_package_string): Call nih_main_init_full |
| 6351 | instead of futzing with variables so the static string is reset. |
| 6352 | |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6353 | * nih/alloc.c (nih_alloc_using, nih_alloc, nih_realloc) |
| 6354 | (nih_alloc_size, nih_alloc_parent): Make various argument pointers |
Scott James Remnant | 533137c | 2006-07-20 02:37:00 +0100 | [diff] [blame] | 6355 | const. |
| 6356 | * nih/alloc.h: Update. |
| 6357 | |
Scott James Remnant | 36a4350 | 2006-07-20 02:35:37 +0100 | [diff] [blame] | 6358 | * nih/libnih.h, nih/logging.c, nih/main.c: Update to include |
| 6359 | string.h not strutil.h |
| 6360 | |
Scott James Remnant | 0efbb8f | 2006-07-20 02:30:05 +0100 | [diff] [blame] | 6361 | * nih/strutil.c: Renamed to nih/string.c |
| 6362 | * nih/strutil.h: Renamed to nih/string.h |
| 6363 | * nih/tests/test_strutil.c: Renamed to nih/tests/test_string.h |
| 6364 | * nih/Makefile.am (DEFAULT_INCLUDES): Override to stop automake doing |
| 6365 | silly things like putting -I. in the pre-processor flags. |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6366 | (libnih_la_SOURCES, nihinclude_HEADERS, TESTS) |
| 6367 | (test_string_SOURCES, test_string_LDFLAGS, test_string_LDADD): Update. |
Scott James Remnant | 0efbb8f | 2006-07-20 02:30:05 +0100 | [diff] [blame] | 6368 | |
Scott James Remnant | e7bb309 | 2006-07-19 23:18:32 +0100 | [diff] [blame] | 6369 | 2006-07-19 Scott James Remnant <scott@netsplit.com> |
| 6370 | |
| 6371 | * nih/alloc.h, nih/logging.h, nih/strutil.h: Reformat attribute |
| 6372 | declarations to not upset emacs indentation. |
| 6373 | |
Scott James Remnant | 06424b4 | 2006-07-17 21:12:55 +0100 | [diff] [blame] | 6374 | 2006-07-17 Scott James Remnant <scott@netsplit.com> |
| 6375 | |
| 6376 | * nih/strutil.c (nih_strdup): Implement an nih_alloc-based strdup. |
| 6377 | (nih_strdup): and strndup. |
| 6378 | * nih/strutil.h: Update. |
| 6379 | * nih/tests/test_strutil.c: Test new functions. |
| 6380 | |
Scott James Remnant | ab30a42 | 2006-07-13 01:54:58 +0100 | [diff] [blame] | 6381 | 2006-07-13 Scott James Remnant <scott@netsplit.com> |
| 6382 | |
Scott James Remnant | bda41e1 | 2006-07-13 22:41:30 +0100 | [diff] [blame] | 6383 | * nih/alloc.c (nih_free): Remove the entry from the parent's list. |
| 6384 | |
Scott James Remnant | b51443b | 2006-07-13 22:40:33 +0100 | [diff] [blame] | 6385 | * nih/logging.h (nih_assert): Reexpress to avoid polluting if |
| 6386 | statements without an else. |
| 6387 | |
Scott James Remnant | caa78bf | 2006-07-13 22:40:15 +0100 | [diff] [blame] | 6388 | * nih/alloc.c (nih_realloc): Implement a function that reallocates |
| 6389 | a block of memory with the original allocator. |
| 6390 | (nih_alloc_init): Don't double-check the allocator. |
| 6391 | * nih/alloc.h: Update. |
| 6392 | * nih/tests/test_alloc.c (test_realloc): Check behaviour of realloc. |
| 6393 | |
Scott James Remnant | 45ff495 | 2006-07-13 22:11:09 +0100 | [diff] [blame] | 6394 | * nih/alloc.c (NihAllocCtx): Drop the name pointer, we never used |
| 6395 | that anyway. |
| 6396 | (nih_alloc_using): Drop name parameter. |
| 6397 | (nih_alloc_named): Rename to nih_alloc. |
| 6398 | (nih_alloc_set_name): Drop this function. |
| 6399 | (nih_alloc_name): And this one. |
| 6400 | * nih/alloc.h (nih_new): Simplify. |
| 6401 | (nih_alloc): Drop entirely now it's unneeded. |
| 6402 | * nih/tests/test_alloc.c: Update. |
| 6403 | * nih/tests/test_list.c (test_new): Test using nih_alloc_size |
| 6404 | rather than nih_alloc_name. |
| 6405 | |
Scott James Remnant | 26b95ff | 2006-07-13 02:07:18 +0100 | [diff] [blame] | 6406 | * nih/logging.h: Put the log priorities back in ascending order, |
| 6407 | but use the zero to mean "unknown". Fix up the descriptions to be |
| 6408 | a little more consistent. |
| 6409 | * nih/logging.c: Rename max_priority back to min_priority so it |
| 6410 | all makes more sense again. |
| 6411 | (nih_log_init): Warning is the default minimum priority to show. |
| 6412 | (nih_log_set_priority): Set minimum priority. |
| 6413 | (nih_log_message): Discard messages below the minimum priority. |
| 6414 | (nih_logger_printf): Use stderr when priority is greater than or |
| 6415 | equal to warning. |
| 6416 | * nih/tests/test_logging.c: Update to match. |
| 6417 | |
Scott James Remnant | ab30a42 | 2006-07-13 01:54:58 +0100 | [diff] [blame] | 6418 | * nih/logging.c (nih_log_message): Use nih_vsprintf which makes the |
| 6419 | function not core dump (always good, that). |
| 6420 | |
Scott James Remnant | 76586af | 2006-07-12 23:40:14 +0100 | [diff] [blame] | 6421 | 2006-07-12 Scott James Remnant <scott@netsplit.com> |
| 6422 | |
Scott James Remnant | 595e01b | 2006-07-12 23:41:05 +0100 | [diff] [blame] | 6423 | * nih/main.c (nih_main_package_string): Use nih_sprintf and make |
| 6424 | the function rather simpler. |
| 6425 | |
Scott James Remnant | 0e32c79 | 2006-07-12 23:40:35 +0100 | [diff] [blame] | 6426 | * nih/tests/test_alloc.c (main): Formatting fix. |
| 6427 | |
Scott James Remnant | 76586af | 2006-07-12 23:40:14 +0100 | [diff] [blame] | 6428 | * nih/strutil.c (nih_sprintf): Function to wrap sprintf, allocating |
| 6429 | the necessary space using nih_alloc first. |
| 6430 | (nih_vsprintf): Function to wrap vsprintf, allocating the necessary |
| 6431 | space using nih_alloc first. |
| 6432 | * nih/strutil.h: Prototypes. |
| 6433 | * nih/libnih.h: Include strutil.h |
| 6434 | * nih/Makefile.am (libnih_la_SOURCES): Build and link strutil.c |
| 6435 | (nihinclude_HEADERS): Install strutil.h |
| 6436 | (TESTS): Build and run strutil test cases |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6437 | (test_strutil_SOURCES, test_strutil_LDFLAGS) |
| 6438 | (test_strutil_LDADD): Binary for strutil test cases. |
Scott James Remnant | 76586af | 2006-07-12 23:40:14 +0100 | [diff] [blame] | 6439 | |
Scott James Remnant | 4944c0c | 2006-07-05 04:02:24 +0100 | [diff] [blame] | 6440 | 2006-07-05 Scott James Remnant <scott@netsplit.com> |
| 6441 | |
Scott James Remnant | d236e77 | 2006-07-05 13:49:50 +0100 | [diff] [blame] | 6442 | * nih/logging.c (nih_log_message): Don't bother catching |
| 6443 | vsnprintf's return value, C99 doesn't allow it to fail. |
| 6444 | * nih/main.c (nih_main_package_string): Likewise for here. |
| 6445 | |
Scott James Remnant | 4944c0c | 2006-07-05 04:02:24 +0100 | [diff] [blame] | 6446 | * nih/logging.c (nih_log_message): Don't use a static variable |
| 6447 | for no apparent reason, just free afterwards. Catch vsnprintf and |
| 6448 | malloc failing. |
| 6449 | * nih/main.c (nih_main_package_string): Catch snprintf and realloc |
| 6450 | failing here too. |
| 6451 | |
Scott James Remnant | 0d13698 | 2006-05-30 14:28:49 +0100 | [diff] [blame] | 6452 | 2006-05-30 Scott James Remnant <scott@netsplit.com> |
| 6453 | |
Scott James Remnant | beea067 | 2006-05-30 14:59:16 +0100 | [diff] [blame] | 6454 | * nih/logging.h (nih_assert): Assertion macro that uses our logging |
| 6455 | rather than stderr. |
| 6456 | * nih/alloc.c, nih/hash.c, nih/list.c, nih/logging.c, nih/main.c: |
| 6457 | Use nih_assert rather than assert. |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6458 | * nih/Makefile.am (test_alloc_LDFLAGS, test_list_LDFLAGS) |
| 6459 | (test_hash_LDFLAGS, test_main_LDFLAGS, test_logging_LDFLAGS): Link |
Scott James Remnant | beea067 | 2006-05-30 14:59:16 +0100 | [diff] [blame] | 6460 | libraries statically. |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6461 | (test_alloc_LDADD, test_list_LDADD, test_hash_LDADD) |
| 6462 | (test_main_LDADD, test_logging_LDADD): Just link to the library. |
Scott James Remnant | beea067 | 2006-05-30 14:59:16 +0100 | [diff] [blame] | 6463 | |
Scott James Remnant | 0d13698 | 2006-05-30 14:28:49 +0100 | [diff] [blame] | 6464 | * nih/macros.h (NIH_STRINGIFY): Correct typo (-s -> _s) |
| 6465 | (NIH_LIKELY, NIH_UNLIKELY): Add branch prediction macros. |
| 6466 | |
Scott James Remnant | b31cf30 | 2006-05-29 17:59:02 +0100 | [diff] [blame] | 6467 | 2006-05-29 Scott James Remnant <scott@netsplit.com> |
| 6468 | |
Scott James Remnant | bdcdadc | 2006-05-29 19:15:12 +0100 | [diff] [blame] | 6469 | * nih/alloc.c (nih_alloc_init): Restore this function, it's better |
| 6470 | style to keep variables in shared libraries as zero. |
| 6471 | (nih_alloc_named): Call nih_alloc_init once more. |
| 6472 | * nih/logging.h: Reorder such that NONE is the lowest value. |
| 6473 | * nih/logging.c (min_priority): Rename to max_priority and set value |
| 6474 | to NIH_LOG_NONE (zero). |
| 6475 | (nih_log_init): Initialise the default logger and priority. |
| 6476 | (nih_log_set_priority): Assert priority is greater than NONE. |
| 6477 | (nih_log_message): Initialise the logging if necessary. |
| 6478 | (nih_logger_printf): Check priority with <= |
| 6479 | |
Scott James Remnant | 712e14f | 2006-05-29 18:51:50 +0100 | [diff] [blame] | 6480 | * TODO: Update. |
| 6481 | |
Scott James Remnant | bcf7661 | 2006-05-29 18:51:29 +0100 | [diff] [blame] | 6482 | * nih/logging.c: Code for formatting log messages and filtering |
| 6483 | based on priority. |
| 6484 | * nih/logging.h: Prototypes and macros. |
| 6485 | * nih/libnih.h: Include logging.h |
| 6486 | * nih/tests/test_logging.c: Logging test cases. |
| 6487 | * nih/Makefile.am (libnih_la_SOURCES): Build and link logging.c |
| 6488 | (nihinclude_HEADERS): Install logging.h |
| 6489 | (TESTS): Build and run logging test cases. |
| 6490 | (test_logging_SOURCES, test_logging_LDADD): Binary for logging |
| 6491 | test cases. |
| 6492 | |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6493 | * nih/tests/test_main.c (test_package_string, test_suggest_help) |
| 6494 | (test_version): Add missing comments before tests. |
Scott James Remnant | 1b60ce1 | 2006-05-29 18:42:37 +0100 | [diff] [blame] | 6495 | (test_suggest_help, test_version): Close the duplicated stdout/stderr |
| 6496 | before leaving the test. |
| 6497 | |
Scott James Remnant | b31cf30 | 2006-05-29 17:59:02 +0100 | [diff] [blame] | 6498 | * nih/alloc.h: Declare nih_alloc_named and nih_alloc_using with |
| 6499 | the warn_unused_result and malloc attributes. |
| 6500 | |
Scott James Remnant | 502c056 | 2006-05-27 12:15:25 +0100 | [diff] [blame] | 6501 | 2006-05-27 Scott James Remnant <scott@netsplit.com> |
| 6502 | |
| 6503 | * m4/compiler.m4 (NIH_COMPILER_WARNINGS): Drop -pedantic as we |
| 6504 | usually want gcc extensions (all the world IS gcc). |
| 6505 | |
Scott James Remnant | 3a9480e | 2006-05-26 17:18:45 +0100 | [diff] [blame] | 6506 | 2006-05-26 Scott James Remnant <scott@netsplit.com> |
| 6507 | |
Scott James Remnant | b374f2c | 2006-05-26 17:53:11 +0100 | [diff] [blame] | 6508 | * nih/main.c (nih_main_init_full): Only take the basename of |
| 6509 | the program name, not the full path. |
| 6510 | (nih_main_package_string): Use an allocated piece of memory rather |
| 6511 | than some on the stack, with C99-style snprintf to do the right thing |
| 6512 | with it. |
| 6513 | * nih/tests/test_main.c (test_init): Include check for basename. |
| 6514 | (test_package_string): Drop tests involving basename here. |
| 6515 | |
Scott James Remnant | b008712 | 2006-05-26 17:44:09 +0100 | [diff] [blame] | 6516 | * m4/compiler.m4 (NIH_TRY_C99): Macro that tries compiling |
| 6517 | some code full of C99 features. |
| 6518 | (NIH_C_C99): Use the above macro to determine whether the compiler |
| 6519 | supports C99, or whether it can do it with a compiler flag. |
| 6520 | * configure.ac: Make sure the compiler does C99. |
| 6521 | |
Scott James Remnant | 6c7870a | 2006-05-26 17:42:30 +0100 | [diff] [blame] | 6522 | * nih/list.c: Add missing prototype for nih_list_cut. |
| 6523 | * nih/hash.c: Add missing prototype for fnv_hash. |
| 6524 | |
Scott James Remnant | 13cd7a8 | 2006-05-26 17:34:38 +0100 | [diff] [blame] | 6525 | * nih/macros.h (_, N_): Define gettext-wrapper macros if |
| 6526 | HAVE_GETTEXT, otherwise define them to just expand to their string. |
| 6527 | |
Scott James Remnant | 88d73e8 | 2006-05-26 17:34:16 +0100 | [diff] [blame] | 6528 | * nih/main.h: Drop comments for global variables. |
| 6529 | * nih/main.c: Provide proper docstrings for them here. |
| 6530 | |
Scott James Remnant | 3a9480e | 2006-05-26 17:18:45 +0100 | [diff] [blame] | 6531 | * nih/alloc.c (nih_alloc_init): Drop this function, instead just |
| 6532 | initialise the static variable directly. |
| 6533 | (nih_alloc_set_allocator): Correct parameter name in docstring, |
| 6534 | don't call nih_alloc_init (it's already initialised). |
| 6535 | |
Scott James Remnant | 2fbdd9e | 2006-05-24 10:42:39 +0100 | [diff] [blame] | 6536 | 2006-05-24 Scott James Remnant <scott@netsplit.com> |
| 6537 | |
| 6538 | * nih/main.c (nih_main_package_string): Clarify documentation. |
| 6539 | |
Scott James Remnant | 8017ccf | 2006-05-23 09:12:43 +0100 | [diff] [blame] | 6540 | 2006-05-23 Scott James Remnant <scott@netsplit.com> |
| 6541 | |
| 6542 | * nih/main.c: Add code for the various little functions that we |
| 6543 | usually call from main(). |
| 6544 | * nih/main.h: Prototypes and macros. |
| 6545 | * nih/libnih.h: Include main.h |
| 6546 | * nih/Makefile.am (libnih_la_SOURCES): Build and link main.c |
| 6547 | (nihinclude_HEADERS): Install main.h |
| 6548 | (TESTS): Build and run main test-cases |
| 6549 | (test_main_SOURCES, test_main_LDADD): Code for main tests. |
| 6550 | * m4/misc.m4 (AC_COPYRIGHT): Wraps the Autoconf AC_COPYRIGHT macro |
| 6551 | but also defines PACKAGE_COPYRIGHT |
| 6552 | * m4/compiler.m4: Temporary hack to make sure misc.m4 gets dragged |
| 6553 | in as aclocal doesn't notice it, will go away once we get something |
| 6554 | that aclocal will notice. |
| 6555 | |
Scott James Remnant | 839c8f0 | 2006-04-26 16:58:50 +0100 | [diff] [blame] | 6556 | 2006-04-26 Scott James Remnant <scott@netsplit.com> |
| 6557 | |
Scott James Remnant | b643f5e | 2006-04-26 18:32:44 +0100 | [diff] [blame] | 6558 | * nih/hash.c: Add code for FNV hash tables that uses NihList for |
| 6559 | the actual bins so is largely polymorphic. |
| 6560 | * nih/hash.h: Prototypes, macros and structures. |
| 6561 | * nih/macros.h: Include stdint.h as well, we use that a lot. |
| 6562 | * nih/libnih.h: Include hash.h |
| 6563 | * nih/tests/test_hash.c: Test cases for new hash table code. |
| 6564 | * nih/Makefile.am (libnih_la_SOURCES): Build and link hash.c |
| 6565 | (nihinclude_HEADERS): Install hash.h |
| 6566 | (TESTS): Build and run hash table test-cases. |
| 6567 | (test_hash_SOURCES, test_hash_LDADD): Code for hash table tests. |
| 6568 | * TODO: Update. |
| 6569 | |
Scott James Remnant | e8c0653 | 2006-04-26 17:32:02 +0100 | [diff] [blame] | 6570 | * nih/tests/test_list.c (test_empty): Fix faulty test case that |
| 6571 | actually proved one-entry lists were showing up as empty! |
| 6572 | * nih/list.h (NIH_LIST_EMPTY): Compare the next and previous pointers |
| 6573 | against the list pointer itself! |
| 6574 | |
Scott James Remnant | 839c8f0 | 2006-04-26 16:58:50 +0100 | [diff] [blame] | 6575 | * nih/list.c (nih_list_cut): Add an inline function that does the |
| 6576 | job of nih_list_remove without calling nih_list_init afterwards. |
| 6577 | (nih_list_remove): Call nih_list_cut rather than modifying pointers. |
| 6578 | (nih_list_free): Use nih_list_cut for efficiency, no point fixing |
| 6579 | the pointers if we're just going to free it. |
| 6580 | (nih_list_add, nih_list_add_after): Use nih_list_cut as the pointers |
| 6581 | get modified afterwards anyway, more efficient this way. |
| 6582 | |
Scott James Remnant | 011adce | 2006-04-25 03:49:54 +0100 | [diff] [blame] | 6583 | 2006-04-25 Scott James Remnant <scott@netsplit.com> |
| 6584 | |
Scott James Remnant | f089f70 | 2006-04-25 21:36:49 +0100 | [diff] [blame] | 6585 | * nih/list.c: Remove unnecessary include of stdlib.h |
| 6586 | |
Scott James Remnant | 92a3c14 | 2006-04-25 19:43:04 +0100 | [diff] [blame] | 6587 | * nih/list.c (nih_list_new): Fix formatting of docstring. |
| 6588 | * nih/alloc.c (nih_alloc_using, nih_alloc_parent): Fix formatting |
| 6589 | of docstring. |
| 6590 | (nih_alloc_named): Fix docstring to mention NULL can be returned. |
| 6591 | * nih/tests/test_alloc.c, nih/tests/test_list.c: Add missing blank |
| 6592 | line before includes. |
| 6593 | |
Scott James Remnant | 9a1fb11 | 2006-04-25 03:52:14 +0100 | [diff] [blame] | 6594 | * nih/alloc.c (nih_alloc_using): Return NULL if the allocation |
| 6595 | fails. |
| 6596 | * nih/list.c (nih_list_new): Also return NULL if the allocation |
| 6597 | fails. |
| 6598 | |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6599 | * nih/alloc.c (nih_alloc_set_allocator, nih_alloc_using) |
| 6600 | (nih_free, nih_alloc_set_name, nih_alloc_set_destructor) |
| 6601 | (nih_alloc_name, nih_alloc_size, nih_alloc_parent): Use assert |
Scott James Remnant | 011adce | 2006-04-25 03:49:54 +0100 | [diff] [blame] | 6602 | to uncover programming errors. |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6603 | * nih/list.c (nih_list_init, nih_list_remove, nih_list_free) |
| 6604 | (nih_list_add, nih_list_add_after): Use assert to uncover |
Scott James Remnant | 011adce | 2006-04-25 03:49:54 +0100 | [diff] [blame] | 6605 | programming errors. |
| 6606 | (nih_list_new): Comment that nih_new may return NULL and we need |
| 6607 | to make sure we catch that. |
| 6608 | |
Scott James Remnant | 12ffa34 | 2006-04-24 22:33:20 +0100 | [diff] [blame] | 6609 | 2006-04-24 Scott James Remnant <scott@netsplit.com> |
| 6610 | |
Scott James Remnant | 220b43b | 2006-04-24 22:54:39 +0100 | [diff] [blame] | 6611 | * m4/Makefile.am (dist_aclocal_DATA): Add missing \ |
| 6612 | * nih/Makefile.am (INCLUDES): Include top_srcdir otherwise we |
| 6613 | can't be built out of tree. |
| 6614 | |
Scott James Remnant | c6e0444 | 2006-04-24 22:51:27 +0100 | [diff] [blame] | 6615 | * m4/Makefile.am (dist_aclocal_DATA): Install the m4 files into |
| 6616 | the aclocal directory, not a package specific one. |
| 6617 | * m4/compiler.m4, m4/linker.m4: Fix closing comment style. |
| 6618 | |
Scott James Remnant | 12ffa34 | 2006-04-24 22:33:20 +0100 | [diff] [blame] | 6619 | * TODO: Add TODO file. |
| 6620 | * nih/list.h (NIH_LIST_EMPTY): Document what this actually does. |
| 6621 | |
Scott James Remnant | ff10cd3 | 2006-04-19 10:12:23 +0100 | [diff] [blame] | 6622 | 2006-04-19 Scott James Remnant <scott@netsplit.com> |
| 6623 | |
| 6624 | * nih/list.c (nih_list_entry_new): Removed. This makes the list |
| 6625 | code more focussed and generic, but also we'll nearly always want |
| 6626 | the data member to be an nih_alloc child of the list, rather than |
| 6627 | the other way around! |
Scott James Remnant | d4b03b9 | 2006-08-02 08:15:26 +0100 | [diff] [blame] | 6628 | * nih/list.h (NihListEntry, nih_list_add_new) |
| 6629 | (nih_list_add_new_after): Likewise, remove the structure and helper |
Scott James Remnant | ff10cd3 | 2006-04-19 10:12:23 +0100 | [diff] [blame] | 6630 | macros; if we find ourselves wanting this, we can put it in a new |
| 6631 | file and just make it polymorphic like we plan for hashes. |
| 6632 | * nih/tests/test_list.c: Replace all uses of NihListEntry with plain |
| 6633 | NihList, we never checked the data members anyway. |
| 6634 | (test_entry_new): Remove test case. |
| 6635 | (test_add): Remove test of nih_list_add_new macro. |
| 6636 | (test_add_after): Remove test of nih_list_add_new_after macro. |
| 6637 | (test_empty): Check macro works with any list entry. |
| 6638 | (test_remove): Test removal of the last list entry, and removal |
| 6639 | on an already empty list. |
| 6640 | (test_free): Don't check the pointers of a block we've just freed! |
| 6641 | |
Scott James Remnant | f10cd87 | 2006-04-18 18:37:04 +0100 | [diff] [blame] | 6642 | 2006-04-18 Scott James Remnant <scott@netsplit.com> |
| 6643 | |
| 6644 | * nih/alloc.c (nih_alloc_init): Call nih_alloc_set_allocator. |
| 6645 | * nih/alloc.h (NihDestructor): Clarify docstring to not refer |
| 6646 | to internal structures. |
| 6647 | * nih/list.h (NIH_LIST_EMPTY): Add convenience macro for this |
| 6648 | common operation. |
| 6649 | * nih/tests/test_list.c (test_empty): Test the new macro. |
| 6650 | |
Scott James Remnant | b365c5f | 2006-04-16 08:16:18 +0100 | [diff] [blame] | 6651 | 2006-04-16 Scott James Remnant <scott@netsplit.com> |
| 6652 | |
Scott James Remnant | 84ccd44 | 2006-04-16 12:41:13 +0100 | [diff] [blame] | 6653 | * nih/list.c (nih_list_new, nih_list_entry_new): Call nih_new rather |
| 6654 | than malloc so the list can be a context for data members. |
| 6655 | (nih_list_free): Call nih_free rather than free. |
| 6656 | * nih/tests/test_list.c: Test cases should not be static. |
| 6657 | (test_new, test_entry_new): Check the new object was allocated using |
| 6658 | our nih_alloc function. |
| 6659 | (test_remove): Test a second removal. |
| 6660 | (destructor_called): Function to test whether destructor was called. |
| 6661 | (test_free): Test now that we can use an NihDestructor. |
| 6662 | * nih/Makefile.am (test_list_LDADD): Link alloc.o now that lists |
| 6663 | depend on the allocator. |
| 6664 | |
Scott James Remnant | 2a9b765 | 2006-04-16 12:32:45 +0100 | [diff] [blame] | 6665 | * nih/list.c, nih/list.h: Fix docstrings to use references where |
| 6666 | useful. Split functions into blocks separated by a newline. |
| 6667 | |
Scott James Remnant | f7c2d22 | 2006-04-16 12:28:24 +0100 | [diff] [blame] | 6668 | * nih/alloc.h: Update and fix formatting. |
| 6669 | (NihAllocDestructor): Rename to NihDestructor. |
| 6670 | * nih/alloc.c (nih_alloc_init): Make safe against repeated calls. |
| 6671 | (nih_alloc_set_allocator): New function to set the default allocator, |
| 6672 | overriding any set already. |
| 6673 | (nih_alloc_set_destructor): Update type of destructor argument.. |
| 6674 | (NihAllocCtx): Update type of destructor member. |
| 6675 | * nih/tests/test_alloc.c (my_realloc): Wrapper around realloc so |
| 6676 | we can check custom allocators are called properly. |
| 6677 | (test_alloc_using): Test allocation with a custom allocator. |
| 6678 | (test_free): Check that the block is freed using the allocator, |
| 6679 | also update destructor checking. |
| 6680 | (test_set_allocator): Test new allocator is used. |
| 6681 | |
Scott James Remnant | cf980f2 | 2006-04-16 12:00:16 +0100 | [diff] [blame] | 6682 | * nih/alloc.c (nih_alloc_using): New one-shot function to use a given |
| 6683 | realloc-style function to make a named block of memory of a given size. |
| 6684 | (nih_alloc_named): Replace with a thin-wrapper around nih_alloc_using |
| 6685 | that passes in the default allocator. |
| 6686 | (NihAllocCtx): Add new allocator member to store the allocator used, |
| 6687 | so we free with the right one. |
| 6688 | (nih_alloc_init): Set the default allocator to realloc(). Drop |
| 6689 | pool initialisation code. |
| 6690 | (nih_free): Call the context's original allocator with zero size. |
| 6691 | (used_pool, unused_pool, NIH_ALLOC_SMALLEST): Remove, these really |
| 6692 | belong in distinct memory handling code. |
| 6693 | (nih_alloc_set, nih_alloc_new): Drop functions only needed if we're |
| 6694 | doing our own memory management. |
| 6695 | (nih_alloc_size, nih_alloc_parent): Add a couple of useful functions. |
| 6696 | * nih/alloc.h (NihAllocator): Typedef for allocator function prototype. |
| 6697 | (nih_alloc): Rename to nih_new. |
| 6698 | (nih_alloc_size): Rename to nih_alloc. |
| 6699 | * nih/tests/test_alloc.c (test_alloc_named, test_new, test_alloc): Test |
| 6700 | behaviour of standard functions with and without parents. |
| 6701 | (destructor_called): Allow it to be called multiple times, change |
| 6702 | to static to enforce modularity. |
| 6703 | (child_destructor_called): Another function for testing multiple |
| 6704 | destructors. |
| 6705 | (test_free): Test nih_free using alloc destructors. |
| 6706 | (test_alloc_set_name): Rename to just test_set_name for consistency. |
| 6707 | |
Scott James Remnant | b365c5f | 2006-04-16 08:16:18 +0100 | [diff] [blame] | 6708 | * nih/macros.h (NIH_STRINGIFY): Generic hack to turn a numeric |
| 6709 | macro into a string. |
| 6710 | * nih/alloc.h (nih_alloc, nih_alloc_size): Use generic NIH_STRINGIFY |
| 6711 | macro instead of our home-cooked one. |
| 6712 | |
Scott James Remnant | f47c7cf | 2006-03-31 16:36:41 +0100 | [diff] [blame] | 6713 | 2006-03-31 Scott James Remnant <scott@netsplit.com> |
| 6714 | |
| 6715 | * nih/alloc.c, nih/alloc.h, nih/list.c, nih/list.h, nih/macros.h, |
| 6716 | nih/libnih.h, nih/tests/test_alloc.c, |
| 6717 | nih/tests/test_list.c: Update FSF address in GPL header. |
| 6718 | |
Scott James Remnant | 8baaefe | 2006-03-03 21:50:58 +0000 | [diff] [blame] | 6719 | 2006-03-03 Scott James Remnant <scott@netsplit.com> |
| 6720 | |
| 6721 | * nih/alloc.c, nih/alloc.h, nih/list.c, nih/list.h: Formatting fixes, |
| 6722 | correct erroneous references to d_* functions and D* structures. |
| 6723 | * nih/list.h: Correct docstring for nih_list_new and nih_list_entry_new |
| 6724 | functions so that @data is described for the right one. |
| 6725 | * nih/Makefile.am: Add blank line between SOURCES and LDFLAGS. |
| 6726 | |
Scott James Remnant | dfb7d50 | 2005-09-29 06:06:03 +0100 | [diff] [blame] | 6727 | 2005-09-29 Scott James Remnant <scott@netsplit.com> |
| 6728 | |
| 6729 | * nih/alloc.c, nih/alloc.h, nih/list.c, nih/list.h: Fix docstring |
| 6730 | terminators to be **/ not */. |
| 6731 | * nih/alloc.h: Align function parameters. |
| 6732 | * nih/tests/test_alloc.c (test_alloc_set_name): Fix to return |
| 6733 | ret and not zero all the time. |
| 6734 | |
Scott James Remnant | 3b78a41 | 2005-08-29 10:46:19 +0100 | [diff] [blame] | 6735 | 2005-08-29 Scott James Remnant <scott@netsplit.com> |
| 6736 | |
Scott James Remnant | 7f28831 | 2005-08-29 11:48:04 +0100 | [diff] [blame] | 6737 | * nih/alloc.c (NIH_ALLOC_SMALLEST): Set to the size of the |
| 6738 | NihAllocCtx structure shifted left twice; this will divide evenly |
| 6739 | into a page. |
| 6740 | |
Scott James Remnant | 3b2cccb | 2005-08-29 11:33:11 +0100 | [diff] [blame] | 6741 | * nih/alloc.c (nih_alloc_init): No need to pass NULL to nih_list_new. |
| 6742 | (nih_alloc_new): No need to initialise data member of NihList structs |
| 6743 | or cast children member. |
| 6744 | (nih_alloc_named): Can cast NihList directly to NihAllocCtx now, |
| 6745 | simplify difference test. |
| 6746 | (nih_free): Use iter as variable name for clarity. |
| 6747 | (nih_alloc_return_unused): Cast NihList directly to NihAllocCtx. |
| 6748 | * nih/tests/test_alloc.c: Output "BAD:" instead of "FAIL:" |
| 6749 | |
Scott James Remnant | 35e2b4e | 2005-08-29 11:10:36 +0100 | [diff] [blame] | 6750 | * nih/list.h (NihList): Remove data pointer, it'll save us 4 bytes |
| 6751 | where we want to make lists of structures that are always in lists. |
| 6752 | (NihListEntry): Define new structure for those still wanting data |
| 6753 | pointers. |
| 6754 | (nih_list_add_new, nih_list_add_new_after): Use nih_list_entry_new. |
| 6755 | * nih/list.c (nih_list_new): Remove argument and don't initialise |
| 6756 | data pointer, this simply allocates and initialises the two-pointer |
| 6757 | structure. |
| 6758 | (nih_list_entry_new): New function to allocate and initialise an |
| 6759 | NihListEntry structure. |
| 6760 | * nih/tests/test_list.c: Output "BAD:" instead of "FAIL:" |
| 6761 | (test_new): Test without data pointer. |
| 6762 | (test_entry_new): Test with data pointer. |
| 6763 | (test_add, test_add_after, test_remove): Mix and cast NihList and |
| 6764 | NihListEntry properly. |
| 6765 | |
Scott James Remnant | 3b78a41 | 2005-08-29 10:46:19 +0100 | [diff] [blame] | 6766 | * nih/alloc.c: Implement a heirarchial allocator in a similar |
| 6767 | style to halloc and talloc, but designed never to return data to |
| 6768 | the system and re-use it instead. |
| 6769 | * nih/alloc.h: Prototypes and macros for allocator. |
| 6770 | * nih/libnih.h: Include allocator header. |
| 6771 | * nih/tests/test_alloc.c: Test-cases for allocator. |
| 6772 | * nih/macros.h (MIN, MAX): Define MIN and MAC macros if not already |
| 6773 | available. |
| 6774 | * nih/Makefile.am (libnih_la_SOURCES): Compile and link alloc.c |
| 6775 | (nihinclude_HEADERS): Install alloc.h |
| 6776 | (TESTS): Build and run the allocator test-cases. |
| 6777 | (test_alloc_SOURCES, alloc_list_LDADD): Identify the test sources and |
| 6778 | objects it needs. |
| 6779 | |
Scott James Remnant | c5e0539 | 2005-08-28 10:43:05 +0100 | [diff] [blame] | 6780 | 2005-08-28 Scott James Remnant <scott@netsplit.com> |
| 6781 | |
| 6782 | * nih/list.c (nih_list_init): Add new function for dealing with |
| 6783 | statically allocated list entries, and initialising them. |
| 6784 | (nih_list_new): Use nih_list_init() to initialise the list. |
| 6785 | (nih_list_new): Use nih_list_init() to re-initialise the list |
| 6786 | to a single-member. |
| 6787 | * nih/list.h: Add prototype for nih_list_init. |
| 6788 | (NihListIter): Remove the iterator structure, it turns |
| 6789 | out to be harder work to try and use lists in an "all nodes are |
| 6790 | interesting" manner; so we'll iterate them normally instead. |
| 6791 | (NIH_LIST_FIRST, NIH_LIST_LAST): Remove iterator test functions. |
| 6792 | (NIH_LIST_PREV, NIH_LIST_NEXT): Remove iterator change functions. |
| 6793 | * nih/tests/test_list.c: Use NULL for nih_list_new in all functions. |
| 6794 | (test_init): New test case for nih_list_init(). |
| 6795 | (test_iterator): Removed iterator tests. |
| 6796 | |
Scott James Remnant | 4ece665 | 2005-08-21 00:29:11 +0100 | [diff] [blame] | 6797 | 2005-08-21 Scott James Remnant <scott@netsplit.com> |
| 6798 | |
Scott James Remnant | 717f4a0 | 2005-08-21 22:37:06 +0100 | [diff] [blame] | 6799 | * nih/list.c: Add code for generic circular doubly-linked lists. |
| 6800 | * nih/list.h: Prototypes and macros. |
| 6801 | * nih/macros.h: Some generic macros. |
| 6802 | * nih/libnih.h: Header to import everything. |
| 6803 | * nih/tests/test_list.c: Test-cases for linked-list code. |
| 6804 | * nih/Makefile.am (libnih_la_SOURCES): Link list.c in. |
| 6805 | (nihincludedir): Define directory to contain header files to be |
| 6806 | $includedir/nih. |
| 6807 | (include_HEADERS): Install libnih.h into the main include directory. |
| 6808 | (nihinclude_HEADERS): Install header files. |
| 6809 | (TESTS): Build and run the list test-cases. |
| 6810 | (test_list_SOURCES, test_list_LDADD): Identify the test sources and |
| 6811 | objects it needs. |
| 6812 | |
Scott James Remnant | 4ece665 | 2005-08-21 00:29:11 +0100 | [diff] [blame] | 6813 | * nih/libnih.ver: Add simple "everything beginning nih_* is global" |
| 6814 | version script. |
| 6815 | * nih/Makefile.am (libnih_la_LDFLAGS): Use the version script |
| 6816 | if we can pass an argument to do that to the linker. |
| 6817 | (EXTRA_DIST): Distribute the version script. |
| 6818 | |
Scott James Remnant | ed1ca16 | 2005-07-09 00:00:47 +0100 | [diff] [blame] | 6819 | 2005-07-09 Scott James Remnant <scott@netsplit.com> |
| 6820 | |
Scott James Remnant | a5e7f30 | 2005-07-09 00:15:37 +0100 | [diff] [blame] | 6821 | * m4/compiler.m4 (NIH_COMPILER_WARNINGS): Macro to add -Wall, |
| 6822 | -Werror and -pedantic to CFLAGS and CXXFLAGS if using gcc or g++. |
| 6823 | (NIH_COMPILER_OPTIMISATIONS): Macro to remove any optimisation |
| 6824 | arguments from CFLAGS and CXXFLAGS and replace them with -O0 to |
| 6825 | override any default level. |
| 6826 | (NIH_COMPILER_COVERAGE): Macro to add compiler coverage testing |
| 6827 | arguments to CFLAGS and CXXFLAGS. |
| 6828 | * m4/linker.m4 (NIH_LINKER_OPTIMISATIONS): Macro to add -Wl,-O1 |
| 6829 | to LDFLAGS to increase the optimisation of the linker hash tables. |
| 6830 | (NIH_LINKER_VERSION_SCRIPT): Macro to test for the right argument |
| 6831 | to pass a version script to the linker and define |
| 6832 | HAVE_VERSION_SCRIPT and VERSION_SCRIPT_ARG. |
| 6833 | * m4/Makefile.am (dist_pkgdata_DATA): Ship macros. |
| 6834 | * configure.ac: Use new macros. |
| 6835 | |
Scott James Remnant | ed1ca16 | 2005-07-09 00:00:47 +0100 | [diff] [blame] | 6836 | * ChangeLog: Initial project infrastructure created. |
| 6837 | |