diff options
Diffstat (limited to 'plugins/clipboard')
-rw-r--r-- | plugins/clipboard/list.c | 22 | ||||
-rw-r--r-- | plugins/clipboard/list.h | 14 | ||||
-rw-r--r-- | plugins/clipboard/xutils.c | 10 | ||||
-rw-r--r-- | plugins/clipboard/xutils.h | 2 |
4 files changed, 24 insertions, 24 deletions
diff --git a/plugins/clipboard/list.c b/plugins/clipboard/list.c index 477eead..7f60bb1 100644 --- a/plugins/clipboard/list.c +++ b/plugins/clipboard/list.c @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Matthias Clasen, Red Hat, Inc. @@ -26,8 +26,8 @@ void -list_foreach (List *list, - Callback func, +list_foreach (List *list, + Callback func, void *user_data) { while (list) @@ -57,14 +57,14 @@ list_free (List *list) while (list) { List *next = list->next; - + free (list); list = next; } } -List * +List * list_find (List *list, ListFindFunc func, void *user_data) @@ -85,7 +85,7 @@ list_remove (List *list, void *data) { List *tmp, *prev; - + prev = NULL; for (tmp = list; tmp; tmp = tmp->next) { @@ -93,7 +93,7 @@ list_remove (List *list, { if (prev) prev->next = tmp->next; - else + else list = tmp->next; free (tmp); @@ -115,7 +115,7 @@ list_length (List *list) length = 0; for (tmp = list; tmp; tmp = tmp->next) length++; - + return length; } @@ -131,7 +131,7 @@ list_copy (List *list) new_list = (List *) malloc (sizeof (List)); new_list->data = list->data; new_list->next = NULL; - + last = new_list; list = list->next; @@ -142,9 +142,9 @@ list_copy (List *list) last->data = list->data; list = list->next; } - + last->next = NULL; } - + return new_list; } diff --git a/plugins/clipboard/list.h b/plugins/clipboard/list.h index 158b779..04cf1e1 100644 --- a/plugins/clipboard/list.h +++ b/plugins/clipboard/list.h @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Matthias Clasen, Red Hat, Inc. @@ -24,23 +24,23 @@ #define LIST_H -typedef struct _List List; -typedef void (*Callback) (void *data, +typedef struct _List List; +typedef void (*Callback) (void *data, void *user_data); -struct _List +struct _List { void *data; List *next; }; -typedef int (*ListFindFunc) (void *data, +typedef int (*ListFindFunc) (void *data, void *user_data); -void list_foreach (List *list, - Callback func, +void list_foreach (List *list, + Callback func, void *user_data); List *list_prepend (List *list, void *data); diff --git a/plugins/clipboard/xutils.c b/plugins/clipboard/xutils.c index 4e48b98..ef57a85 100644 --- a/plugins/clipboard/xutils.c +++ b/plugins/clipboard/xutils.c @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Matthias Clasen, Red Hat, Inc. @@ -46,7 +46,7 @@ void init_atoms (Display *display) { unsigned long max_request_size; - + if (SELECTION_MAX_SIZE > 0) return; @@ -63,17 +63,17 @@ init_atoms (Display *display) XA_SAVE_TARGETS = XInternAtom (display, "SAVE_TARGETS", False); XA_TARGETS = XInternAtom (display, "TARGETS", False); XA_TIMESTAMP = XInternAtom (display, "TIMESTAMP", False); - + max_request_size = XExtendedMaxRequestSize (display); if (max_request_size == 0) max_request_size = XMaxRequestSize (display); - + SELECTION_MAX_SIZE = max_request_size - 100; if (SELECTION_MAX_SIZE > 262144) SELECTION_MAX_SIZE = 262144; } -typedef struct +typedef struct { Window window; Atom timestamp_prop_atom; diff --git a/plugins/clipboard/xutils.h b/plugins/clipboard/xutils.h index 143fe44..12a00e4 100644 --- a/plugins/clipboard/xutils.h +++ b/plugins/clipboard/xutils.h @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Matthias Clasen, Red Hat, Inc. |