Rearrange wrapper to be in line with module
This commit is contained in:
parent
05594771d4
commit
8c84f11bbb
130 changed files with 178 additions and 176 deletions
45
libnxGen.cfg
45
libnxGen.cfg
|
|
@ -1,5 +1,5 @@
|
|||
[n.global]
|
||||
output="src/libnx_wrapper"
|
||||
output="src/libnx/wrapper"
|
||||
c_compiler="aarch64-none-elf-gcc"
|
||||
cpp_compiler="aarch64-none-elf-g++"
|
||||
filter=lock
|
||||
|
|
@ -44,23 +44,23 @@ replace.u32 = "uint32"
|
|||
search.u64 = "u64"
|
||||
replace.u64 = "uint64"
|
||||
|
||||
search.lib = " src/libnx_wrapper"
|
||||
replace.lib = " libnx_wrapper"
|
||||
search.lib = " src/libnx/wrapper"
|
||||
replace.lib = " libnx/wrapper"
|
||||
|
||||
search.timport = "../types"
|
||||
replace.timport = "libnx_wrapper/types"
|
||||
replace.timport = "libnx/wrapper/types"
|
||||
|
||||
search.kimport = "../kernel/"
|
||||
replace.kimport = "libnx_wrapper/"
|
||||
replace.kimport = "libnx/wrapper/"
|
||||
|
||||
search.servimport = "../services/"
|
||||
replace.servimport = "libnx_wrapper/"
|
||||
replace.servimport = "libnx/wrapper/"
|
||||
|
||||
search.resimport = "../result"
|
||||
replace.resimport = "libnx_wrapper/result"
|
||||
replace.resimport = "libnx/wrapper/result"
|
||||
|
||||
search.armimport = "../arm/"
|
||||
replace.armimport = "libnx_wrapper/"
|
||||
replace.armimport = "libnx/wrapper/"
|
||||
|
||||
search.lock = "_LOCK"
|
||||
replace.lock = "LOCK"
|
||||
|
|
@ -68,9 +68,10 @@ replace.lock = "LOCK"
|
|||
search.cdecl = "stdcall"
|
||||
replace.cdecl = "cdecl"
|
||||
|
||||
[src/libnx_wrapper/nim.cfg]
|
||||
[src/libnx/wrapper/nim.cfg]
|
||||
create = """
|
||||
--path:"../"
|
||||
--path:"../../"
|
||||
"""
|
||||
|
||||
[result.h]
|
||||
|
|
@ -171,7 +172,7 @@ template BIT*(n): auto = (1.uint shl n)
|
|||
|
||||
search.import = "type\n"
|
||||
prepend.import = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
search.permx = "Perm_X = BIT(2), ## /< Execute permission."
|
||||
|
|
@ -186,13 +187,13 @@ replace.permrx = "Perm_Rx = Perm_R.int or Perm_X.int, ## /< Read/execute permi
|
|||
[shmem.nim]
|
||||
search.import = "type\n"
|
||||
prepend.import = """
|
||||
import libnx_wrapper/svc
|
||||
import libnx/wrapper/svc
|
||||
"""
|
||||
|
||||
[nacp.nim]
|
||||
search.t = "type"
|
||||
prepend.t = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[lock.nim]
|
||||
|
|
@ -204,7 +205,7 @@ replace.nlock_t = "= DUlock_t"
|
|||
|
||||
search.import = "type"
|
||||
prepend.import = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
search.proc_under = "proc __"
|
||||
|
|
@ -216,19 +217,19 @@ replace.o = "uint32.high"
|
|||
|
||||
search.import = "import\n"
|
||||
append.import = """
|
||||
libnx_wrapper/types,
|
||||
libnx/wrapper/types,
|
||||
"""
|
||||
|
||||
[audin.nim]
|
||||
search.o = "import "
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[audout.nim]
|
||||
search.o = "import "
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[hid.nim]
|
||||
|
|
@ -267,32 +268,32 @@ prepend.key_sl = """
|
|||
[nifm.nim]
|
||||
search.o = "import libnx"
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[set.nim]
|
||||
search.o = "import libnx"
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[parcel.nim]
|
||||
search.o = "import libnx"
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[fs_dev.nim]
|
||||
search.o = "import libnx"
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
"""
|
||||
|
||||
[buffer_producer.nim]
|
||||
search.o = "import libnx"
|
||||
prepend.o = """
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/binder
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/binder
|
||||
"""
|
||||
|
||||
[nxlink.nim]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headeracc = currentSourcePath().splitPath().head & "/nx/include/switch/services/acc.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
type
|
||||
AccountProfile* {.importc: "AccountProfile", header: headeracc, bycopy.} = object
|
||||
s* {.importc: "s".}: Service
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerapm = currentSourcePath().splitPath().head & "/nx/include/switch/services/apm.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
proc apmInitialize*(): Result {.cdecl, importc: "apmInitialize", header: headerapm.}
|
||||
proc apmExit*() {.cdecl, importc: "apmExit", header: headerapm.}
|
||||
proc apmSetPerformanceConfiguration*(PerformanceMode: uint32;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerapplet = currentSourcePath().splitPath().head & "/nx/include/switch/services/applet.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
AppletType* {.size: sizeof(cint).} = enum
|
||||
AppletType_None = -2, AppletType_Default = -1, AppletType_Application = 0,
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
import strutils
|
||||
import ospaths
|
||||
const headeraudin = currentSourcePath().splitPath().head & "/nx/include/switch/services/audin.h"
|
||||
import libnx_wrapper/audio
|
||||
import libnx/wrapper/audio
|
||||
type
|
||||
AudioInState* {.size: sizeof(cint).} = enum
|
||||
AudioInState_Started = 0, AudioInState_Stopped = 1
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headeraudio = currentSourcePath().splitPath().head & "/nx/include/switch/audio/audio.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
PcmFormat* {.size: sizeof(cint).} = enum
|
||||
PcmFormat_Invalid = 0, PcmFormat_Int8 = 1, PcmFormat_Int16 = 2, PcmFormat_Int24 = 3,
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
import strutils
|
||||
import ospaths
|
||||
const headeraudout = currentSourcePath().splitPath().head & "/nx/include/switch/services/audout.h"
|
||||
import libnx_wrapper/audio
|
||||
import libnx/wrapper/audio
|
||||
type
|
||||
AudioOutState* {.size: sizeof(cint).} = enum
|
||||
AudioOutState_Started = 0, AudioOutState_Stopped = 1
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerbinder = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/binder.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
const
|
||||
BINDER_FIRST_CALL_TRANSACTION* = 0x00000001
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerbuffer_producer = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/buffer_producer.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/binder
|
||||
import libnx_wrapper/nvioctl
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/binder
|
||||
import libnx/wrapper/nvioctl
|
||||
type
|
||||
INNER_C_STRUCT_3208597589* {.importc: "no_name", header: headerbuffer_producer,
|
||||
bycopy.} = object
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headercache = currentSourcePath().splitPath().head & "/nx/include/switch/arm/cache.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
proc armDCacheFlush*(`addr`: pointer; size: csize) {.cdecl,
|
||||
importc: "armDCacheFlush", header: headercache.}
|
||||
proc armDCacheClean*(`addr`: pointer; size: csize) {.cdecl,
|
||||
|
|
@ -9,7 +9,7 @@ const headercondvar = currentSourcePath().splitPath().head & "/nx/include/switch
|
|||
##
|
||||
|
||||
import
|
||||
libnx_wrapper/types, libnx_wrapper/mutex
|
||||
libnx/wrapper/types, libnx/wrapper/mutex
|
||||
|
||||
## / Condition variable structure.
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerconsole = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/devices/console.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
ConsolePrint* = proc (con: pointer; c: cint): bool {.cdecl.}
|
||||
ConsoleFont* {.importc: "ConsoleFont", header: headerconsole, bycopy.} = object
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headercsrng = currentSourcePath().splitPath().head & "/nx/include/switch/services/csrng.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
proc csrngInitialize*(): Result {.cdecl, importc: "csrngInitialize",
|
||||
header: headercsrng.}
|
||||
proc csrngExit*() {.cdecl, importc: "csrngExit", header: headercsrng.}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerdetect = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/detect.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
proc kernelAbove200*(): bool {.cdecl, importc: "kernelAbove200",
|
||||
header: headerdetect.}
|
||||
proc kernelAbove300*(): bool {.cdecl, importc: "kernelAbove300",
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerenv = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/env.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
ConfigEntry* {.importc: "ConfigEntry", header: headerenv, bycopy.} = object
|
||||
Key* {.importc: "Key".}: uint32
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerfatal = currentSourcePath().splitPath().head & "/nx/include/switch/services/fatal.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
proc fatalSimple*(err: Result) {.cdecl, importc: "fatalSimple", header: headerfatal.}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerfs = currentSourcePath().splitPath().head & "/nx/include/switch/services/fs.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
const
|
||||
FS_MAX_PATH* = 0x00000301
|
||||
FS_SAVEDATA_CURRENT_TITLEID* = 0
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerfs_dev = currentSourcePath().splitPath().head & "/nx/include/switch/runtime/devices/fs_dev.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/fs
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/fs
|
||||
const
|
||||
FSDEV_DIRITER_MAGIC* = 0x66736476
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerfsldr = currentSourcePath().splitPath().head & "/nx/include/switch/services/fsldr.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx_wrapper/fs
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
import libnx/wrapper/fs
|
||||
proc fsldrInitialize*(): Result {.cdecl, importc: "fsldrInitialize",
|
||||
header: headerfsldr.}
|
||||
proc fsldrExit*() {.cdecl, importc: "fsldrExit", header: headerfsldr.}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerfspr = currentSourcePath().splitPath().head & "/nx/include/switch/services/fspr.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx_wrapper/fs
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
import libnx/wrapper/fs
|
||||
proc fsprInitialize*(): Result {.cdecl, importc: "fsprInitialize",
|
||||
header: headerfspr.}
|
||||
proc fsprExit*() {.cdecl, importc: "fsprExit", header: headerfspr.}
|
||||
|
|
@ -10,7 +10,7 @@ const headergfx = currentSourcePath().splitPath().head & "/nx/include/switch/gfx
|
|||
##
|
||||
|
||||
import
|
||||
libnx_wrapper/types
|
||||
libnx/wrapper/types
|
||||
|
||||
## / Converts red, green, blue, and alpha components to packed RGBA8.
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ const headerhid = currentSourcePath().splitPath().head & "/nx/include/switch/ser
|
|||
##
|
||||
|
||||
import
|
||||
libnx_wrapper/types, libnx_wrapper/sm
|
||||
libnx/wrapper/types, libnx/wrapper/sm
|
||||
|
||||
## Begin enums and output structs
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ const headeripc = currentSourcePath().splitPath().head & "/nx/include/switch/ker
|
|||
##
|
||||
|
||||
import
|
||||
libnx_wrapper/types,
|
||||
libnx_wrapper/result, libnx_wrapper/tls, libnx_wrapper/svc
|
||||
libnx/wrapper/types,
|
||||
libnx/wrapper/result, libnx/wrapper/tls, libnx/wrapper/svc
|
||||
|
||||
## / IPC input header magic
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerirs = currentSourcePath().splitPath().head & "/nx/include/switch/services/irs.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx_wrapper/hid
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
import libnx/wrapper/hid
|
||||
type
|
||||
IrsPackedMomentProcessorConfig* {.importc: "IrsPackedMomentProcessorConfig",
|
||||
header: headerirs, bycopy.} = object
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerjit = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/jit.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
JitType* {.size: sizeof(cint).} = enum
|
||||
JitType_CodeMemory, JitType_JitMemory
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerldr = currentSourcePath().splitPath().head & "/nx/include/switch/services/ldr.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx_wrapper/fs
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
import libnx/wrapper/fs
|
||||
type
|
||||
LoaderProgramInfo* {.importc: "LoaderProgramInfo", header: headerldr, bycopy.} = object
|
||||
main_thread_priority* {.importc: "main_thread_priority".}: uint8
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerlock = "/opt/devkitpro/devkitA64/aarch64-none-elf/include/sys/lock.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
LOCK_T* = int32_t
|
||||
DUlock_t* {.importc: "__lock_t", header: headerlock, bycopy.} = object
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerlr = currentSourcePath().splitPath().head & "/nx/include/switch/services/lr.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/sm
|
||||
import libnx_wrapper/fs
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/sm
|
||||
import libnx/wrapper/fs
|
||||
type
|
||||
LrLocationResolver* {.importc: "LrLocationResolver", header: headerlr, bycopy.} = object
|
||||
s* {.importc: "s".}: Service
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headermutex = currentSourcePath().splitPath().head & "/nx/include/switch/kernel/mutex.h"
|
||||
import libnx_wrapper/lock
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/lock
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
Mutex* = LOCK_T
|
||||
RMutex* = LOCK_RECURSIVE_T
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headernacp = currentSourcePath().splitPath().head & "/nx/include/switch/nacp.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
NacpLanguageEntry* {.importc: "NacpLanguageEntry", header: headernacp, bycopy.} = object
|
||||
name* {.importc: "name".}: array[0x00000200, char]
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headernifm = currentSourcePath().splitPath().head & "/nx/include/switch/services/nifm.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/ipc
|
||||
import libnx_wrapper/detect
|
||||
import libnx_wrapper/sm
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/ipc
|
||||
import libnx/wrapper/detect
|
||||
import libnx/wrapper/sm
|
||||
proc nifmInitialize*(): Result {.cdecl, importc: "nifmInitialize",
|
||||
header: headernifm.}
|
||||
proc nifmExit*() {.cdecl, importc: "nifmExit", header: headernifm.}
|
||||
2
src/libnx/wrapper/nim.cfg
Normal file
2
src/libnx/wrapper/nim.cfg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
--path:"../"
|
||||
--path:"../../"
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headerns = currentSourcePath().splitPath().head & "/nx/include/switch/services/ns.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx_wrapper/nacp
|
||||
import libnx_wrapper/fs
|
||||
import libnx/wrapper/types
|
||||
import libnx/wrapper/nacp
|
||||
import libnx/wrapper/fs
|
||||
type
|
||||
NsApplicationControlData* {.importc: "NsApplicationControlData",
|
||||
header: headerns, bycopy.} = object
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headernv = currentSourcePath().splitPath().head & "/nx/include/switch/services/nv.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
nvServiceType* {.size: sizeof(cint).} = enum
|
||||
NVSERVTYPE_Default = -1, NVSERVTYPE_Application = 0, NVSERVTYPE_Applet = 1,
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headernvgfx = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/nvgfx.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
proc nvgfxInitialize*(): Result {.cdecl, importc: "nvgfxInitialize",
|
||||
header: headernvgfx.}
|
||||
proc nvgfxExit*() {.cdecl, importc: "nvgfxExit", header: headernvgfx.}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import strutils
|
||||
import ospaths
|
||||
const headernvioctl = currentSourcePath().splitPath().head & "/nx/include/switch/gfx/nvioctl.h"
|
||||
import libnx_wrapper/types
|
||||
import libnx/wrapper/types
|
||||
type
|
||||
gpu_characteristics* {.importc: "gpu_characteristics", header: headernvioctl,
|
||||
bycopy.} = object
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue