2
0

Abbreviated type names.

This commit is contained in:
Maarten Billemont 2019-04-27 15:54:43 -04:00
parent 98d0d7a497
commit 7f7910f0a9
2 changed files with 36 additions and 0 deletions

View File

@ -81,6 +81,38 @@ const MPResultType mpw_typeWithName(const char *typeName) {
return (MPResultType)ERR;
}
const char *mpw_abbreviationForType(MPResultType resultType) {
switch (resultType) {
case MPResultTypeTemplateMaximum:
return "max";
case MPResultTypeTemplateLong:
return "long";
case MPResultTypeTemplateMedium:
return "med";
case MPResultTypeTemplateBasic:
return "basic";
case MPResultTypeTemplateShort:
return "short";
case MPResultTypeTemplatePIN:
return "pin";
case MPResultTypeTemplateName:
return "name";
case MPResultTypeTemplatePhrase:
return "phrase";
case MPResultTypeStatefulPersonal:
return "own";
case MPResultTypeStatefulDevice:
return "dev";
case MPResultTypeDeriveKey:
return "key";
default: {
dbg( "Unknown password type: %d", resultType );
return NULL;
}
}
}
const char *mpw_shortNameForType(MPResultType resultType) {
switch (resultType) {

View File

@ -146,6 +146,10 @@ const char *mpw_scopeForPurpose(MPKeyPurpose purpose);
* @return The password type represented by the given name.
*/
const MPResultType mpw_typeWithName(const char *typeName);
/**
* @return The standard identifying name for the given password type.
*/
const char *mpw_abbreviationForType(MPResultType resultType);
/**
* @return The standard identifying name for the given password type.
*/