summaryrefslogtreecommitdiff
path: root/examples/C
Commit message (Collapse)AuthorAgeFilesLines
* coverity: fix various warnings detected with CoverityThomas Haller2013-11-131-5/+11
| | | | | | | | | | | | | These are (most likely) only warnings and not severe bugs. Some of these changes are mostly made to get a clean run of Coverity without any warnings. Error found by running Coverity scan https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Co-Authored-By: Jiří Klimeš <jklimes@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: cleanup freeing of glib collections of pointersThomas Haller2013-10-221-2/+2
| | | | | | | | | | | | | | | | When freeing one of the collections such as GArray, GPtrArray, GSList, etc. it is common that the items inside the connections must be freed/unrefed too. The previous code often iterated over the collection first with e.g. g_ptr_array_foreach and passing e.g. g_free as GFunc argument. For one, this has the problem, that g_free has a different signature GDestroyNotify then the expected GFunc. Moreover, this can be simplified either by setting a clear function (g_ptr_array_set_clear_func) or by passing the destroy function to the free function (g_slist_free_full). Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: switch from $(INCLUDES) to $(AM_CPPFLAGS) to make automake happyDan Winship2013-08-222-9/+7
| | | | | | | | | | | | | Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS variables, which $(INCLUDES) did not, so this requires some additional changes. In most places, I have just gotten rid of the per-target _CPPFLAGS variables; in directories with a single target, the per-target variable is unnecessary, and in directories with multiple targets, the per-target variable is often undesirable, since it forces some files to be compiled twice, even though there ends up being no difference between the two files.
* trivial: add gitignore for qt examplesPavel Šimerda2013-04-291-0/+2
|
* all: use G_VALUE_INIT to initialize GValue variablesJiří Klimeš2013-03-251-3/+3
| | | | | It makes the initializations more explicit. G_VALUE_INIT is available since glib 2.30, and NM now require glib >= 2.32
* examples: remove GLIB_CHECK_VERSION checks from GDBus examplesDan Winship2013-02-262-12/+0
|
* cli/examples: NM_802_11_MODE_AP mode is not valid for NMAccessPoint objectsJiří Klimeš2012-11-011-1/+0
|
* build: clean up GLib-related pkg-config usage (bgo #687218)Colin Walters2012-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | We had separate checks for glib-2.0, gobject-2.0, gmodule-2.0, and gio-unix-2.0. It doesn't make sense to link a binary against all 4 because gio-unix-2.0 depends on glib-2.0 and gobject-2.0. Doing this actually breaks things in unusual circumstances. Generally, few bits of NM actually just use glib, and not gio. We might as well coalesce those requirements together, even if it means in some cases we "overlink". Additionally, I chose for now to fold gmodule-2.0 in as well, even though many fewer programs need it. The cost of overlinking is quite small. The benefit of this is less repeated junk in Makefile.am, as well as more centralized control over GLib. A followup patch will allow us to set -DGLIB_VERSION_MIN_REQUIRED in just one place, rather than having to replicate it 4 times. The NM configure is still suboptimal - for example, libpolkit-1 depends on gio-2.0, so really we should determine the compiler flags all in one pass. But it doesn't matter too much for now.
* wifi: support ap-mode with wpa_supplicantJan Luebbe2012-10-171-1/+4
| | | | | | | | | | A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the new mode is passed to wpa_supplicant analogous to adhoc-mode. The places which need to know the interface mode have been extended to handle the new mode. If the configuration does not contain a fixed frequency, a channel is selected the same way as with adhoc-mode before.
* build: fix srcdir != builddir for new generated headersColin Walters2012-02-221-0/+1
|
* examples: fix dependency on GDBus (it's available only in GLib >= 2.26)Jiří Klimeš2012-02-142-0/+12
|
* examples: add C example for monitoring overall NetworkManager stateJiří Klimeš2012-02-132-2/+140
|
* examples: add C examples for monitoring whether NM runsJiří Klimeš2012-02-035-4/+332
| | | | | | - the first uses dbus-glib and D-Bus "NameOwnerChanged" signal directly - the second uses GIO's g_bus_watch_name() - the third uses Qt and QDBusServiceWatcher class
* build: fix srcdir != builddirColin Walters2012-01-092-2/+4
| | | | nm-version.h is in ${top_builddir}/include.
* core: use nm_connection_get_setting_<type>() whenever possibleThomas Graf2011-12-061-1/+1
| | | | | | Leads to shorter, easier to read code and improves type casting safety. Signed-off-by: Thomas Graf <tgraf@redhat.com>
* test: add missing return valuesThomas Jarosch2011-10-101-0/+2
| | | | Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
* examples: add a Qt example for setting manual IPv4 addresses into a connectionJiří Klimeš2011-06-082-2/+155
|
* examples: add another Qt example for listing connectionsEckhart Wörner2011-04-202-2/+60
|
* examples: add some Qt examples and build infrastructureEckhart Wörner2011-04-203-0/+95
|
* examples: move glib examples to a subdirDan Williams2011-04-208-62/+64
|
* examples: rename another exampleDan Williams2011-04-202-4/+4
|
* examples: rename an exampleDan Williams2011-04-202-5/+5
|
* libnm-util: simplify nm_utils_ssid_to_utf8()Dan Williams2011-02-231-2/+2
| | | | | | It's always used with a GByteArray anyway, as are most functions in nm-utils.h. Even better, we can skip the memcpy since it turns out to be pointless.
* examples: fix distcheckDan Williams2011-02-161-1/+2
|
* examples: add an example for adding a new connection with libnm-glibDan Williams2011-02-152-0/+144
|
* examples: rename add-connection-glibDan Williams2011-02-152-3/+3
|
* examples: fix up add-connection-glib for recent API changesDan Williams2011-02-151-4/+15
| | | | AddConnection returns the object path of the new connection.
* libnm-util: add 'flags' argument to nm_connection_to_hash() and ↵Dan Williams2011-01-261-1/+1
| | | | | | | | nm_setting_to_hash() Simplifies code internally, and makes it easier for clients as well in some cases where they want to control what ends up in the resulting hash and what does not.
* Merge remote branch 'origin/master' into rm-usersetDan Williams2011-01-126-4/+793
|\
| * examples: add C example showing APs' informationJiří Klimeš2010-12-172-2/+240
| |
| * examples: trivial comment fixJiří Klimeš2010-12-131-1/+1
| |
| * examples: fix double free() error in get-active-connectionsJiří Klimeš2010-12-131-1/+0
| |
| * examples: add C examples for listing connections from system settings serviceJiří Klimeš2010-12-133-2/+282
| |
| * examples: update commentsDan Williams2010-12-061-4/+28
| |
| * test: add C example for printing active connection detailsDan Williams2010-12-062-2/+234
| |
| * examples: build C examplesDan Williams2010-12-062-1/+19
|/
* examples: add example for adding a connection in C (using glib)Jiří Klimeš2010-09-302-0/+114