nim-libnx/libnxGen.cfg
Joey Yakimowich-Payne 70b68f5f9a Rearrange ext folder
2018-06-23 13:33:19 +09:00

301 lines
6.6 KiB
INI

[n.global]
output="src/libnx/wrapper"
c_compiler="aarch64-none-elf-gcc"
cpp_compiler="aarch64-none-elf-g++"
filter=lock
[n.include]
"${output}/nx/include"
"${output}/nx/include/switch"
"${output}/nx/include/switch/arm"
"${output}/nx/include/switch/kernel"
"${output}/nx/include/switch/services"
"${output}/nx/include/switch/audio"
"${output}/nx/include/switch/gfx"
"${output}/nx/include/switch/runtime"
"${output}/nx/include/switch/runtime/util"
"${output}/nx/include/switch/runtime/devices"
"${DEVKITPRO}/devkitA64/aarch64-none-elf/include/"
"${DEVKITA64}/aarch64-none-elf/include/"
[n.exclude]
"${output}/nim.cfg"
[n.prepare]
gitremote = "https://github.com/switchbrew/libnx"
gitsparse = """
nx/include/*
"""
[n.after]
wildcard = ".nim"
search = "_Bool"
replace = "bool"
search.u8 = "u8"
replace.u8 = "uint8"
search.u16 = "u16"
replace.u16 = "uint16"
search.u32 = "u32"
replace.u32 = "uint32"
search.u64 = "u64"
replace.u64 = "uint64"
search.lib = " src/libnx/wrapper"
replace.lib = " libnx/wrapper"
search.timport = "../types"
replace.timport = "libnx/wrapper/types"
search.kimport = "../kernel/"
replace.kimport = "libnx/wrapper/"
search.servimport = "../services/"
replace.servimport = "libnx/wrapper/"
search.resimport = "../result"
replace.resimport = "libnx/wrapper/result"
search.armimport = "../arm/"
replace.armimport = "libnx/wrapper/"
search.lock = "_LOCK"
replace.lock = "LOCK"
search.cdecl = "stdcall"
replace.cdecl = "cdecl"
[src/libnx/wrapper/nim.cfg]
create = """
--path:"../"
--path:"../../"
"""
[result.h]
defines = true
[hid.h]
defines = true
search.static_assert = "static_assert"
replace.static_assert = "// static_assert"
[ipc.h]
defines = true
execute = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
[tls.h]
execute = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
[sm.h]
execute = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
[shmem.h]
execute = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
[condvar.h]
execute = "vim -es +'g/^static inline.*/norm jd%$$a;' -es +%print -es +q! $file"
[romfs_dev.h]
execute = "vim -es +'g/^static inline.*/norm jd%$$a;' -es +%print -es +q! $file"
search = "romfs_"
replace = "Romfs_"
[gfx.h]
defines = true
execute = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
[ioctl.h]
defines = true
search = "_NV_"
replace = "UNV_"
search.nv = "__nv_"
replace.nv = "DUnv_"
[svc.h]
search = "PACKED"
replace = ""
search.noreturn = "NORETURN"
replace.noreturn = ""
defines=true
execute = "vim -es +'g/^static inline.*{/norm f{d%r;' -es +%print -es +q! $file"
[switch.h]
preprocess = true
defines = true
recurse = true
[types.nim]
search.o = " uint8*"
prepend.o = """
u8* = uint8
u16* = uint16
u32* = uint32
u64* = uint64
int8_t* = int8
int16_t* = int16
int32_t* = int32
int64_t* = int64
ssize_t* = int
"""
search.s128 = " s128* = __int128_t"
replace.s128 = ""
search.u128 = " u128* = __uint128_t"
replace.u128 = ""
search.uint8 = "uint8* = uint8_t"
replace.uint8 = "uint8_t* = uint8"
search.uint16 = "uint16* = uint16_t"
replace.uint16 = "uint16_t* = uint16"
search.uint32 = "uint32* = uint32_t"
replace.uint32 = "uint32_t* = uint32"
search.uint64 = "uint64* = uint64_t"
replace.uint64 = "uint64_t* = uint64"
search.import = "type\n"
prepend.import = """
include libnx/ext/integer128
template BIT*(n): auto = (1.uint shl n)
"""
[svc.nim]
search.import = "type\n"
prepend.import = """
import libnx/wrapper/types
"""
search.permx = "Perm_X = BIT(2), ## /< Execute permission."
replace.permx = "Perm_Rw = Perm_R.int or Perm_W.int, ## /< Read/write permissions."
search.permrw = "Perm_Rw = Perm_R or Perm_W, ## /< Read/write permissions."
replace.permrw = "Perm_X = BIT(2), ## /< Execute permission."
search.permrx = "Perm_Rx = Perm_R or Perm_X, ## /< Read/execute permissions."
replace.permrx = "Perm_Rx = Perm_R.int or Perm_X.int, ## /< Read/execute permissions."
[shmem.nim]
search.import = "type\n"
prepend.import = """
import libnx/wrapper/svc
"""
[nacp.nim]
search.t = "type"
prepend.t = """
import libnx/wrapper/types
"""
[lock.nim]
search.flock_t = " __lock_t"
replace.flock_t = " DUlock_t"
search.nlock_t = "= __lock_t"
replace.nlock_t = "= DUlock_t"
search.import = "type"
prepend.import = """
import libnx/wrapper/types
"""
search.proc_under = "proc __"
replace.proc_under = "proc DU"
[ipc.nim]
search.o = "UINT32_MAX"
replace.o = "uint32.high"
search.import = "import\n"
append.import = """
libnx/wrapper/types,
"""
[audin.nim]
search.o = "import "
prepend.o = """
import libnx/wrapper/types
"""
[audout.nim]
search.o = "import "
prepend.o = """
import libnx/wrapper/types
"""
[hid.nim]
search.o = """ KEY_JOYCON_RIGHT = BIT(0), KEY_JOYCON_DOWN = BIT(1), KEY_JOYCON_UP = BIT(2), KEY_JOYCON_LEFT = BIT(
3),"""
replace.o = ""
search.key_left = "KEY_LEFT = KEY_DLEFT or KEY_LSTICK_LEFT or KEY_RSTICK_LEFT, ## /< D-Pad Left or Sticks Left"
replace.key_left = ""
search.key_rstick_up = " KEY_RSTICK_UP"
prepend.key_rstick_up = """
KEY_LEFT = KEY_DLEFT.int or KEY_LSTICK_LEFT.int or KEY_RSTICK_LEFT.int, ## /< D-Pad Left or Sticks Left
"""
search.key_right = " KEY_RIGHT = KEY_DRIGHT or KEY_LSTICK_RIGHT or KEY_RSTICK_RIGHT ## /< D-Pad Right or Sticks Right"
replace.key_right = ""
search.key_rstick_down = " KEY_RSTICK_DOWN"
prepend.key_rstick_down = """
KEY_RIGHT = KEY_DRIGHT.int or KEY_LSTICK_RIGHT.int or KEY_RSTICK_RIGHT.int ## /< D-Pad Right or Sticks Right
"""
search.key_up = " KEY_UP = KEY_DUP or KEY_LSTICK_UP or KEY_RSTICK_UP, ## /< D-Pad Up or Sticks Up"
replace.key_up = ""
search.key_rstick_right = " KEY_RSTICK_RIGHT"
prepend.key_rstick_right = """
KEY_UP = KEY_DUP.int or KEY_LSTICK_UP.int or KEY_RSTICK_UP.int, ## /< D-Pad Up or Sticks Up
"""
search.key_down = " KEY_DOWN = KEY_DDOWN or KEY_LSTICK_DOWN or KEY_RSTICK_DOWN, ## /< D-Pad Down or Sticks Down"
replace.key_down = ""
search.key_sl = " KEY_SL"
prepend.key_sl = """
KEY_DOWN = KEY_DDOWN.int or KEY_LSTICK_DOWN.int or KEY_RSTICK_DOWN.int, ## /< D-Pad Down or Sticks Down
"""
[nifm.nim]
search.o = "import libnx"
prepend.o = """
import libnx/wrapper/types
"""
[set.nim]
search.o = "import libnx"
prepend.o = """
import libnx/wrapper/types
"""
[parcel.nim]
search.o = "import libnx"
prepend.o = """
import libnx/wrapper/types
"""
[fs_dev.nim]
search.o = "import libnx"
prepend.o = """
import libnx/wrapper/types
"""
[buffer_producer.nim]
search.o = "import libnx"
prepend.o = """
import libnx/wrapper/types
import libnx/wrapper/binder
"""
[nxlink.nim]
search.o = "var __nxlink"
replace.o = "var DUnxlink"