Browse Source

moved attrnumber() from readclause.c to ssml.c

master
Juho Hiltunen 7 years ago
parent
commit
07a19b3208
2 changed files with 17 additions and 16 deletions
  1. 0
    16
      src/libespeak-ng/readclause.c
  2. 17
    0
      src/libespeak-ng/ssml.c

+ 0
- 16
src/libespeak-ng/readclause.c View File

@@ -807,22 +807,6 @@ static wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name)
return NULL;
}

static int attrnumber(const wchar_t *pw, int default_value, int type)
{
int value = 0;

if ((pw == NULL) || !IsDigit09(*pw))
return default_value;

while (IsDigit09(*pw))
value = value*10 + *pw++ - '0';
if ((type == 1) && (ucd_tolower(*pw) == 's')) {
// time: seconds rather than ms
value *= 1000;
}
return value;
}

static int attrcopy_utf8(char *buf, const wchar_t *pw, int len)
{
// Convert attribute string into utf8, write to buf, and return its utf8 length

+ 17
- 0
src/libespeak-ng/ssml.c View File

@@ -47,6 +47,7 @@

int attrcmp(const wchar_t *string1, const char *string2);
int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab);
int attrnumber(const wchar_t *pw, int default_value, int type);

int attrcmp(const wchar_t *string1, const char *string2)
{
@@ -74,3 +75,19 @@ int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab)
return mtab[ix].value;
}

int attrnumber(const wchar_t *pw, int default_value, int type)
{
int value = 0;

if ((pw == NULL) || !IsDigit09(*pw))
return default_value;

while (IsDigit09(*pw))
value = value*10 + *pw++ - '0';
if ((type == 1) && (ucd_tolower(*pw) == 's')) {
// time: seconds rather than ms
value *= 1000;
}
return value;
}


Loading…
Cancel
Save