summaryrefslogtreecommitdiff
path: root/unsorted/uContextSecret.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-15 12:14:05 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-15 12:14:05 +0000
commit35d488e972a9dd75ce3867c000405f128b79c615 (patch)
treee3319a23d9aa0d4725f88a99fdd5131488a334a9 /unsorted/uContextSecret.cpp
parent8078e7f897aaae9b492b22475060052d68b9c547 (diff)
downloadMWCC-35d488e972a9dd75ce3867c000405f128b79c615.tar.gz
MWCC-35d488e972a9dd75ce3867c000405f128b79c615.zip
reorganise things a bit to align further with the actual names/structure
Diffstat (limited to 'unsorted/uContextSecret.cpp')
-rw-r--r--unsorted/uContextSecret.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/unsorted/uContextSecret.cpp b/unsorted/uContextSecret.cpp
deleted file mode 100644
index b33ca81..0000000
--- a/unsorted/uContextSecret.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "plugin_internal.h"
-
-static Boolean ValidateContext(CWPluginContext context) {
- return context && (context->shellSignature == CWFOURCHAR('C','W','I','E'));
-}
-
-typedef CWResult (*cbSecretAttachHandleType)(CWPluginContext, Handle, CWMemHandle *);
-typedef CWResult (*cbSecretDetachHandleType)(CWPluginContext, CWMemHandle, Handle *);
-typedef CWResult (*cbSecretPeekHandleType)(CWPluginContext, CWMemHandle, Handle *);
-typedef CWResult (*cbSecretGetNamedPreferencesType)(CWPluginContext, const char *, Handle *);
-
-CW_CALLBACK CWSecretAttachHandle(CWPluginContext context, Handle handle, CWMemHandle *memHandle) {
- if (!ValidateContext(context))
- return cwErrInvalidParameter;
- return ((cbSecretAttachHandleType) context->callbacks->cbInternal[0])(context, handle, memHandle);
-}
-
-CW_CALLBACK CWSecretDetachHandle(CWPluginContext context, CWMemHandle memHandle, Handle *handle) {
- if (!ValidateContext(context))
- return cwErrInvalidParameter;
- return ((cbSecretDetachHandleType) context->callbacks->cbInternal[1])(context, memHandle, handle);
-}
-
-CW_CALLBACK CWSecretPeekHandle(CWPluginContext context, CWMemHandle memHandle, Handle *handle) {
- if (!ValidateContext(context))
- return cwErrInvalidParameter;
- return ((cbSecretPeekHandleType) context->callbacks->cbInternal[2])(context, memHandle, handle);
-}
-
-CW_CALLBACK CWSecretGetNamedPreferences(CWPluginContext context, const char *prefsname, Handle *prefsdata) {
- if (!prefsdata)
- return cwErrInvalidParameter;
-
- CWMemHandle memHandle;
- CWResult res = CWGetNamedPreferences(context, prefsname, &memHandle);
- if (!res)
- res = CWSecretDetachHandle(context, memHandle, prefsdata);
- return res;
-}