invariants?
Signature
int keyCopy(Key *dest, const Key *source);
Checklist
Doxygen
@retval dest
@retval NULL in case of error
Naming
- [x] Abbreviations used in function names must be defined in the Glossary src/libs/elektra/symbols.map
- [x] Function names should neither be too long, nor too short
- [x] Function name should be clear and unambiguous
- [ ] Abbreviations used in parameter names must be defined in the Glossary
- [x] add dest to glossary - maybe rename dest to destination?
- [x] Parameter names should neither be too long, nor too short
- [x] Parameter names should be clear and unambiguous
Compatibility
- [x] ABI/API changes are forward-compatible (breaking backwards-compatibility to add additional symbols is fine)
Parameter & Return Types
- Functions should return the most specific type possible
- Functions should require the most general type possible
- [x] Function parameters should use enum types instead of boolean types wherever sensible
- [x] Wherever possible, function parameters should be
const
- [x] Wherever possible, return types should be
const
- [x] Functions should have the least amount of parameters feasible
Structural Clarity
- [ ] Functions should do exactly one thing
- [x] remove keySetName keySetRaw ksClear functionality from keyCopy?
- [x] Function name has the appropriate prefix
- [x] Signature in kdb.h.in has same order as Doxygen docu
- [ ] No functions with similar purpose exist
Memory Management
- [x] Memory Management should be handled by the function wherever possible
Extensibility
- [x] Function is easily extensible, e.g., with flags
- [ ] Documentation does not impose limits, that would hinder further extensions
- [x] KEY_CP_ALL equivalent to KEY_CP_NAME | KEY_CP_VALUE | KEY_CP_META
Tests
Summary
Other Issues discovered (unrelated to function)