Sha256: a053d12ad143b5e06fbeaffd20aa4ae310921eb504742805b62da77e40a5ebb1

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

#include "arraytoc.h"
#include <stdio.h>

static void modp_toupper_map(void)
{
    size_t i = 0;
    char map[256];
    for (i = 0; i < sizeof(map); ++i) {
        if (i >= 'a' && i <= 'z') {
            map[i] = (char)(i - 32);
        } else {
            map[i] = (char)(i);
        }
    }

    char_array_to_c(map, sizeof(map), "gsToUpperMap");
}

static void modp_tolower_map(void)
{
    size_t i = 0;
    char map[256];
    for (i = 0; i < sizeof(map); ++i) {
        if (i >= 'A' && i <= 'Z') {
            map[i] = (char)(i + 32);
        } else {
            map[i] = (char)i;
        }
    }

    char_array_to_c(map, sizeof(map), "gsToLowerMap");
}

static void modp_toprint_map(void)
{
    size_t i = 0;
    char map[256];
    for (i = 0; i < sizeof(map); ++i) {
        if (i < 32 || i > 126) {
            map[i] = '?';
        } else {
            map[i] = (char)i;
        }
    }

    char_array_to_c(map, sizeof(map), "gsToPrintMap");
}

int main(void)
{
    modp_toupper_map();
    modp_tolower_map();
    modp_toprint_map();
    return 0;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffi-hydrogen-0.1.5 vendor/stringencoders/src/modp_ascii_gen.c
ffi-hydrogen-0.1.4 vendor/stringencoders/src/modp_ascii_gen.c
ffi-hydrogen-0.1.3 vendor/stringencoders/src/modp_ascii_gen.c
ffi-hydrogen-0.1.2 vendor/stringencoders/src/modp_ascii_gen.c
ffi-hydrogen-0.1.1 vendor/stringencoders/src/modp_ascii_gen.c
ffi-hydrogen-0.1.0 vendor/stringencoders/src/modp_ascii_gen.c