【问题标题】:Where is the implementation of pixman_region32_init()?pixman_region32_init() 的实现在哪里?
【发布时间】:2018-01-25 02:35:27
【问题描述】:

库:http://www.pixman.org/

存储库:https://cgit.freedesktop.org/pixman/tree/

void pixman_region32_init (pixman_region32_t *region);

我找不到那个函数的实现..

谢谢...

【问题讨论】:

    标签: pixman


    【解决方案1】:

    在 pixman/pixman.h (pixman-0.34.0) 中找到

    ypedef struct pixman_region32_data     pixman_region32_data_t;
    typedef struct pixman_box32             pixman_box32_t;
    typedef struct pixman_rectangle32       pixman_rectangle32_t;
    typedef struct pixman_region32          pixman_region32_t;
    
    struct pixman_region32_data {
        long                size;
        long                numRects;
    /*  pixman_box32_t      rects[size];   in memory but not explicitly declared */
    };
    
    struct pixman_rectangle32
    {
        int32_t x, y;
        uint32_t width, height;
    };
    
    struct pixman_box32
    {
        int32_t x1, y1, x2, y2;
    };
    
    struct pixman_region32
    {
        pixman_box32_t          extents;
        pixman_region32_data_t  *data;
    };
    

    【讨论】:

      【解决方案2】:

      它位于pixman-region32.c。您看不到它,因为这些函数是由PREFIX 宏生成的,然后使用了pixman-region.c 中的代码。见这里:

      typedef pixman_box32_t      box_type_t;
      typedef pixman_region32_data_t  region_data_type_t;
      typedef pixman_region32_t   region_type_t;
      typedef int64_t                 overflow_int_t;
      
      typedef struct {
          int x, y;
      } point_type_t;
      
      #define PREFIX(x) pixman_region32##x
      
      #define PIXMAN_REGION_MAX INT32_MAX
      #define PIXMAN_REGION_MIN INT32_MIN
      
      #include "pixman-region.c"
      

      它首先将PREFIX 宏设置为pixman_region32,然后从pixman-region.c 导入代码。

      【讨论】:

        猜你喜欢
        • 2019-10-14
        • 1970-01-01
        • 1970-01-01
        • 2012-04-13
        • 1970-01-01
        • 2018-02-07
        • 2011-04-18
        • 1970-01-01
        • 2019-05-24
        相关资源
        最近更新 更多