~ubuntu-branches/ubuntu/trusty/wayland/trusty

« back to all changes in this revision

Viewing changes to src/connection.c

  • Committer: Package Import Robot
  • Author(s): Hector Oron, Timo Aaltonen, Hector Oron
  • Date: 2013-10-11 11:23:38 UTC
  • mfrom: (1.1.15) (0.4.2 sid)
  • Revision ID: package-import@ubuntu.com-20131011112338-2jg0z6ncpm9qnots
Tags: 1.3.0-1
[ Timo Aaltonen ]
* control: Bump the libwayland0 C/R to (<< 1.1.0) so that it covers
  the ubuntu version too, and add it to -cursor.

[ Hector Oron ]
* New upstream stable release (1.3.0).
* Add myself to Uploaders.
* Switch to Debian source format 3.0 quilt.
* d/libwayland-dev.install:
  - install wayland documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
        msg.msg_flags = 0;
325
325
 
326
326
        do {
327
 
                len = wl_os_recvmsg_cloexec(connection->fd, &msg, 0);
 
327
                len = wl_os_recvmsg_cloexec(connection->fd, &msg, MSG_DONTWAIT);
328
328
        } while (len < 0 && errno == EINTR);
329
329
 
330
330
        if (len <= 0)
402
402
const char *
403
403
get_next_argument(const char *signature, struct argument_details *details)
404
404
{
405
 
        if (*signature == '?') {
406
 
                details->nullable = 1;
407
 
                signature++;
408
 
        } else
409
 
                details->nullable = 0;
410
 
 
411
 
        details->type = *signature;
412
 
        return signature + 1;
 
405
        details->nullable = 0;
 
406
        for(; *signature; ++signature) {
 
407
                switch(*signature) {
 
408
                case 'i':
 
409
                case 'u':
 
410
                case 'f':
 
411
                case 's':
 
412
                case 'o':
 
413
                case 'n':
 
414
                case 'a':
 
415
                case 'h':
 
416
                        details->type = *signature;
 
417
                        return signature + 1;
 
418
                case '?':
 
419
                        details->nullable = 1;
 
420
                }
 
421
        }
 
422
        details->type = '\0';
 
423
        return signature;
413
424
}
414
425
 
415
426
int
416
427
arg_count_for_signature(const char *signature)
417
428
{
418
429
        int count = 0;
419
 
        while (*signature) {
420
 
                if (*signature != '?')
421
 
                        count++;
422
 
                signature++;
 
430
        for(; *signature; ++signature) {
 
431
                switch(*signature) {
 
432
                case 'i':
 
433
                case 'u':
 
434
                case 'f':
 
435
                case 's':
 
436
                case 'o':
 
437
                case 'n':
 
438
                case 'a':
 
439
                case 'h':
 
440
                        ++count;
 
441
                }
423
442
        }
424
443
        return count;
425
444
}
426
445
 
 
446
int
 
447
wl_message_get_since(const struct wl_message *message)
 
448
{
 
449
        int since;
 
450
 
 
451
        since = atoi(message->signature);
 
452
 
 
453
        if (since == 0)
 
454
                since = 1;
 
455
 
 
456
        return since;
 
457
}
 
458
 
427
459
void
428
460
wl_argument_from_va_list(const char *signature, union wl_argument *args,
429
461
                         int count, va_list ap)
737
769
        return NULL;
738
770
}
739
771
 
740
 
static int
741
 
interface_equal(const struct wl_interface *a, const struct wl_interface *b)
 
772
int
 
773
wl_interface_equal(const struct wl_interface *a, const struct wl_interface *b)
742
774
{
743
775
        /* In most cases the pointer equality test is sufficient.
744
776
         * However, in some cases, depending on how things are split
784
816
                        }
785
817
 
786
818
                        if (object != NULL && message->types[i] != NULL &&
787
 
                            !interface_equal((object)->interface,
788
 
                                             message->types[i])) {
 
819
                            !wl_interface_equal((object)->interface,
 
820
                                                message->types[i])) {
789
821
                                printf("invalid object (%u), type (%s), "
790
822
                                       "message %s(%s)\n",
791
823
                                       id, (object)->interface->name,
859
891
        }
860
892
}
861
893
 
862
 
 
863
894
void
864
895
wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
865
896
                  struct wl_object *target, uint32_t opcode, void *data)
887
918
        ffi_call(&cif, implementation[opcode], NULL, ffi_args);
888
919
}
889
920
 
 
921
void
 
922
wl_closure_dispatch(struct wl_closure *closure, wl_dispatcher_func_t dispatcher,
 
923
                    struct wl_object *target, uint32_t opcode)
 
924
{
 
925
        dispatcher(target->implementation, target, opcode, closure->message,
 
926
                   closure->args);
 
927
}
 
928
 
890
929
static int
891
930
copy_fds_to_connection(struct wl_closure *closure,
892
931
                       struct wl_connection *connection)