mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-08-27 20:36:31 -04:00
Port config package
This commit is contained in:
@@ -47,3 +47,19 @@ func FreeArray(items *C.PascalString, count C.int) {
|
|||||||
}
|
}
|
||||||
C.free(unsafe.Pointer(items))
|
C.free(unsafe.Pointer(items))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// safeStringDeref safely dereferences a string pointer, returning empty string if nil.
|
||||||
|
func safeStringDeref(s *string) string {
|
||||||
|
if s == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return *s
|
||||||
|
}
|
||||||
|
|
||||||
|
// safeBoolDeref safely dereferences a bool pointer, returning false if nil.
|
||||||
|
func safeBoolDeref(b *bool) bool {
|
||||||
|
if b == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return *b
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ to export to C.
|
|||||||
### Building
|
### Building
|
||||||
`go build -buildmode=c-archive`.
|
`go build -buildmode=c-archive`.
|
||||||
### Functions
|
### Functions
|
||||||
All relevant exported libmutton functions have C functions of the same name.
|
All relevant exported libmutton functions have C counterparts with similar names.
|
||||||
Functions with multiple return values all have CGO-generated structs to store the return values.
|
Functions with multiple return values all have CGO-generated structs to store the return values.
|
||||||
These structs are named `<FunctionName>_return`, as per CGO.
|
These structs are named `<FunctionName>_return`, as per CGO.
|
||||||
All functions perform similar basic operations, with a couple caveats:
|
All functions perform similar basic operations, with a couple caveats:
|
||||||
@@ -75,9 +75,9 @@ int main() {
|
|||||||
- [ ] CopyString(clearClipboardAutomatically bool, copySubject string) error
|
- [ ] CopyString(clearClipboardAutomatically bool, copySubject string) error
|
||||||
- [ ] LaunchClearProcess(copySubject string)
|
- [ ] LaunchClearProcess(copySubject string)
|
||||||
- [ ] TOTPCopier(secret string, errorChan chan<- error, done <-chan bool)
|
- [ ] TOTPCopier(secret string, errorChan chan<- error, done <-chan bool)
|
||||||
- [ ] config
|
- [X] config
|
||||||
- [ ] Write(cfg *CfgT, appendMode bool) error
|
- [X] Write(cfg *CfgT, appendMode bool) error
|
||||||
- [ ] Load() (*CfgT, error)
|
- [X] Load() (*CfgT, error)
|
||||||
- [ ] core
|
- [ ] core
|
||||||
- [ ] EntryAddPrecheck(realPath string) (uint8, error)
|
- [ ] EntryAddPrecheck(realPath string) (uint8, error)
|
||||||
- [ ] EntryIsNotEmpty(entryData []string) bool
|
- [ ] EntryIsNotEmpty(entryData []string) bool
|
||||||
@@ -86,6 +86,7 @@ int main() {
|
|||||||
- [ ] GetOldEntryData(realPath string, field int, rcwPassword []byte) ([]string, error)
|
- [ ] GetOldEntryData(realPath string, field int, rcwPassword []byte) ([]string, error)
|
||||||
- [ ] LibmuttonInit(inputCB func(prompt string) string, rcwPassword []byte, ...) error
|
- [ ] LibmuttonInit(inputCB func(prompt string) string, rcwPassword []byte, ...) error
|
||||||
- [ ] RCWSanityCheckGen(password []byte) error
|
- [ ] RCWSanityCheckGen(password []byte) error
|
||||||
|
- [ ] VerifyEntries(rcwPassword []byte) error
|
||||||
- [ ] WriteEntry(realPath string, decSlice []string, passwordIsNew bool, rcwPassword []byte) error
|
- [ ] WriteEntry(realPath string, decSlice []string, passwordIsNew bool, rcwPassword []byte) error
|
||||||
- [X] crypt
|
- [X] crypt
|
||||||
- [X] ~~VAR: RetryPassword bool~~ (RCWD not supported)
|
- [X] ~~VAR: RetryPassword bool~~ (RCWD not supported)
|
||||||
|
|||||||
Reference in New Issue
Block a user