The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/syscons/fonts/cursor.awk

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # $FreeBSD$
    2 #
    3 # awk script to convert a bdf file to C declarations in a form specialized
    4 # for the mouse cursors in syscons/scvgarndr.c.  Usage:
    5 #     awk -f thisfile < file.bdf < file.c
    6 # The accompanying syscons mouse cursor bdf file has specialized comments
    7 # which this script converts to details in the C declarations.
    8 # This is not a general conversion utility, but produces reasonable output
    9 # if the input is for a monospaced font of size between 9x16 and 16x16.
   10 
   11 /^COMMENT cn.*mouse/ {
   12         gsub("[(),]", "")
   13         i = index($3, "-")
   14         n = substr($3, 1, i - 1)
   15         name[n] = $4
   16         i = index($4, "e")
   17         j = index($4, "x")
   18         k = index($4, "_")
   19         width[n] = substr($4, i + 1, j - i - 1)
   20         height[n] = substr($4, j + 1, k - j - 1)
   21         baspect[n] = $6
   22         iaspect[n] = $8
   23 }
   24 state == 0 && /^STARTCHAR/ {
   25         n = substr($2, 5)
   26         printf("static const struct mousedata %s = { {\n\t", name[n])
   27         state = 1
   28 }
   29 state >= 1 && state < 7 || state >= 7 + 16 && state < 7 + 16 + 7 {
   30         state++
   31         next
   32 }
   33 state >= 7 && state < 7 + 16 || state >= 7 + 16 + 7 && state < 7 + 16 + 7 +16 {
   34         printf("0x%s,", $1)
   35         if (state == 7 + 7 || state == 7 + 16 + 7 + 7)
   36                 printf("\n\t")
   37         else if (state == 7 + 15)
   38                 printf(" }, {\n\t")
   39         else if (state == 7 + 16 + 7 + 15) {
   40                 printf(" },\n\t%s, %s, %s, %s, \"%s\",",
   41                     width[n], height[n], baspect[n], iaspect[n], name[n])
   42                 printf("\n};\n\n")
   43                 state = -1
   44         } else
   45                 printf(" ")
   46         state++
   47         next
   48 }

Cache object: e5e5c7d7649ff22c717cd1d7a9e2a488


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.