"Fossies" - the Fresh Open Source Software Archive

Member "wayland-1.18.0/tests/data/small-private-code.c" (11 Feb 2020, 2186 Bytes) of package /linux/misc/wayland-1.18.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "small-private-code.c": 1.17.0_vs_1.18.0.

    1 /* SCANNER TEST */
    2 
    3 /*
    4  * Copyright © 2016 Collabora, Ltd.
    5  *
    6  * Permission is hereby granted, free of charge, to any person
    7  * obtaining a copy of this software and associated documentation files
    8  * (the "Software"), to deal in the Software without restriction,
    9  * including without limitation the rights to use, copy, modify, merge,
   10  * publish, distribute, sublicense, and/or sell copies of the Software,
   11  * and to permit persons to whom the Software is furnished to do so,
   12  * subject to the following conditions:
   13  *
   14  * The above copyright notice and this permission notice (including the
   15  * next paragraph) shall be included in all copies or substantial
   16  * portions of the Software.
   17  *
   18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   21  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
   22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
   23  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   25  * SOFTWARE.
   26  */
   27 
   28 #include <stdlib.h>
   29 #include <stdint.h>
   30 #include "wayland-util.h"
   31 
   32 #ifndef __has_attribute
   33 # define __has_attribute(x) 0  /* Compatibility with non-clang compilers. */
   34 #endif
   35 
   36 #if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
   37 #define WL_PRIVATE __attribute__ ((visibility("hidden")))
   38 #else
   39 #define WL_PRIVATE
   40 #endif
   41 
   42 extern const struct wl_interface another_intf_interface;
   43 extern const struct wl_interface intf_not_here_interface;
   44 
   45 static const struct wl_interface *small_test_types[] = {
   46     NULL,
   47     &intf_not_here_interface,
   48     NULL,
   49     NULL,
   50     NULL,
   51     NULL,
   52     NULL,
   53     &another_intf_interface,
   54 };
   55 
   56 static const struct wl_message intf_A_requests[] = {
   57     { "rq1", "sun", small_test_types + 0 },
   58     { "rq2", "nsiufho", small_test_types + 1 },
   59     { "destroy", "", small_test_types + 0 },
   60 };
   61 
   62 static const struct wl_message intf_A_events[] = {
   63     { "hey", "", small_test_types + 0 },
   64 };
   65 
   66 WL_PRIVATE const struct wl_interface intf_A_interface = {
   67     "intf_A", 3,
   68     3, intf_A_requests,
   69     1, intf_A_events,
   70 };
   71