Comments (12)
Ok I've given this some thought and think I'll write this to begin some discussion by laying out some ideas. Since we've already established headers and names for user types (so far), we should exclude them from these discussions and opt in for compatibility with existing homebrew.
Kernel API is a blank canvas for us, we're still in beta(tm) and can change as much as we want. So I suggest for kernel:
- wherever possible take inspiration from user mode equivalents and suffix
ForKernel
. e.g,sceIoOpen
tosceIoOpenForKernel
. We would not use theForDriver
suffix.
For new contributions:
- if we have an "official" name we will use it only for reference.
- names will begin with
sce
prefix, followed by a reasonable* name or abbreviation for the module it belongs to. - names will be
camelCaseStyle
.
As such, all sce
prefixes will be reserved by SDK.
- I'm not sure what reasonable is, maybe we should create a table? The obvious exception is using
sceKernel
when it comes to the various `ForKernel`` libraries.
from vita-headers.
We could do two prefixes:
ksce
for kernel functionssce
for user functions
This would make it very clear that the developer is using the intended function.
from vita-headers.
Another thing to consider is that some modules export for a ForDriver
and ForKernel
library with similar/same functionalities. Sometimes the NIDs are the same so it doesn't matter. But there might be (can't think of examples right now) functions whose NIDs are different but functionalities are the same.
from vita-headers.
There are some other symbols which have different prefixes such as vsh
. We may make clear what prefixes are reserved by the SDK.
from vita-headers.
how about just use k
prefix or suffix for the kernel function?(like kSceIoOpen
or sceIoOpenK
)
ForKernel
is too long suffix.
from vita-headers.
For the record: adding a kernel prefix is not a technical limitation but a purposeful constraint to clearly convey to the developer which library they're attempting to use. Otherwise a misguided developer may link their kernel plugin against the user stubs.
from vita-headers.
My two cents: I have no problems with verbosity (especially in the age of auto-complete) if it makes the intention obvious. However one problem I run into with the ForKernel stuff is in modulemgr when I have functions called "sceKernelLoadModuleForPidForKernel" where "ForPid" denotes who I am loading for (in terms of context) and "ForKernel" denotes who is doing the loading. That's confusing and "ksceKernelLoadModuleForPid" seems cleaner.
from vita-headers.
in terms of the k
prefix, is it recommended that developers exporting functions follow suit? For example should I change it to ktaiHookForImport
?
from vita-headers.
I would advise developers to have the k
prefix for consistency, but of course not required. You bring a good point about auto-complete: it would be very effective using k
prefix for this also.
from vita-headers.
I'm trying to not close your argument into a corner, but I think we'll need to find some sort of evidence to support that. In support/related, there are many kernel exports that are just wrappers for another export (be it ForKernel
or ForDriver
). How do we approach this?
from vita-headers.
I like the forkernel but maybe for auto completion is better to have a prefix
I won't remove the sce
And for the _ if there are no collisions I would remove it
from vita-headers.
Implemented in #99
from vita-headers.
Related Issues (20)
- Need to separate headers for each library HOT 7
- SceAppMgr HOT 6
- Some function arguments are wrong
- _vshSblAimgrGetConsoleId doesn't appear in the search HOT 11
- Functions with the same nid exist HOT 7
- socket sceNetSend looks not working properly HOT 4
- Libraries of the module SceDriverUser are in wrong modules HOT 2
- definition_check couldn't check c++ mangled methods
- split the db.yml to muliple files
- Merge vdsuite NID database to the vitasdk HOT 9
- Possible error in sceAppMgrLaunchAppByUri HOT 6
- PS Vita Dev Wiki link on homepage dead HOT 3
- Add a function to open quick menu without triggering the button HOT 5
- build.py makes bunch of empty folders without db.yml
- [Question] Setting up an arbitrary virtual address space HOT 7
- [Question] Calling function from loaded module HOT 9
- No `sceGxtGetDataAddress` nids?
- Compatibility with projects that have their own prototype definitions such as taihen or something
- sceAvPlayerInit return negative value (0x81300020) HOT 9
- Stubname field added to YML databases without any documentation HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vita-headers.