Пример #1
0
static const char *dump_pitch(const char height, const char highest_pitch) {
    static char buf[20];
    if (height >= LOWEST_PITCH && height <= highest_pitch) {
        char pitch = height + 'a' - LOWEST_PITCH;
        if (pitch == 'o') {
            pitch = 'p';
        }
        gregorio_snprintf(buf, 20, "%c", pitch);
    } else {
        gregorio_snprintf(buf, 20, "?%d", height);
    }
    return buf;
}
Пример #2
0
static const char *dump_style_to_string(grestyle_style style)
{
    static char buf[50];

    gregorio_snprintf(buf, sizeof buf, "%16s", grestyle_style_to_string(style));
    return buf;
}
Пример #3
0
/* function that returns the filename without the extension */
static char *get_base_filename(char *fbasename)
{
    char *p;
    int l;
    char *ret;
    p = strrchr(fbasename, '.');
    if (!p) {
        return NULL;
    }
    l = strlen(fbasename) - strlen(p);
    ret = (char *) gregorio_malloc(l + 1);
    gregorio_snprintf(ret, l + 1, "%s", fbasename);
    ret[l] = '\0';
    return ret;
}
Пример #4
0
const char *gregorio_unknown(int value) {
    static char buf[20];
    gregorio_snprintf(buf, sizeof buf, "?%d", value);
    return buf;
}