encoding: use simple int's instead of accessor functions

Why are those values exposed to the outer world? They seem not be in use
anyway.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
This commit is contained in:
Ralf Ramsauer 2017-03-11 15:34:23 -08:00
parent 317511e3ca
commit 0eb3b65158
4 changed files with 14 additions and 44 deletions

View file

@ -34,8 +34,8 @@
#include "encoding.h"
#define BLKSIZE_RAW 7
#define BLKSIZE_ENC 8
#define BASE128_BLKSIZE_RAW 7
#define BASE128_BLKSIZE_ENC 8
/* Don't use '-' (restricted to middle of labels), prefer iso_8859-1
* accent chars since they might readily be entered in normal use,
@ -56,16 +56,6 @@ static int base128_handles_dots(void)
return 0;
}
static int base128_blksize_raw(void)
{
return BLKSIZE_RAW;
}
static int base128_blksize_enc(void)
{
return BLKSIZE_ENC;
}
inline static void base128_reverse_init(void)
{
int i;
@ -271,6 +261,6 @@ const struct encoder base128_ops = {
.places_dots = base128_handles_dots,
.eats_dots = base128_handles_dots,
.blocksize_raw = base128_blksize_raw,
.blocksize_encoded = base128_blksize_enc
.blocksize_raw = BASE128_BLKSIZE_RAW,
.blocksize_encoded = BASE128_BLKSIZE_ENC,
};

View file

@ -22,8 +22,8 @@
#include "encoding.h"
#define BLKSIZE_RAW 5
#define BLKSIZE_ENC 8
#define BASE32_BLKSIZE_RAW 5
#define BASE32_BLKSIZE_ENC 8
static const char cb32[] =
"abcdefghijklmnopqrstuvwxyz012345";
@ -37,16 +37,6 @@ static int base32_handles_dots(void)
return 0;
}
static int base32_blksize_raw(void)
{
return BLKSIZE_RAW;
}
static int base32_blksize_enc(void)
{
return BLKSIZE_ENC;
}
inline static void base32_reverse_init(void)
{
int i;
@ -248,6 +238,6 @@ const struct encoder base32_ops = {
.places_dots = base32_handles_dots,
.eats_dots = base32_handles_dots,
.blocksize_raw = base32_blksize_raw,
.blocksize_encoded = base32_blksize_enc,
.blocksize_raw = BASE32_BLKSIZE_RAW,
.blocksize_encoded = BASE32_BLKSIZE_ENC,
};

View file

@ -22,8 +22,8 @@
#include "encoding.h"
#define BLKSIZE_RAW 3
#define BLKSIZE_ENC 4
#define BASE64_BLKSIZE_RAW 3
#define BASE64_BLKSIZE_ENC 4
/* Note: the "unofficial" char is last here, which means that the \377 pattern
in DOWNCODECCHECK1 ('Y' request) will properly test it. */
@ -37,16 +37,6 @@ static int base64_handles_dots(void)
return 0;
}
static int base64_blksize_raw(void)
{
return BLKSIZE_RAW;
}
static int base64_blksize_enc(void)
{
return BLKSIZE_ENC;
}
inline static void base64_reverse_init(void)
{
int i;
@ -186,6 +176,6 @@ const struct encoder base64_ops = {
.places_dots = base64_handles_dots,
.eats_dots = base64_handles_dots,
.blocksize_raw = base64_blksize_raw,
.blocksize_encoded = base64_blksize_enc,
.blocksize_raw = BASE64_BLKSIZE_RAW,
.blocksize_encoded = BASE64_BLKSIZE_ENC,
};

View file

@ -39,8 +39,8 @@ struct encoder {
int (*places_dots)(void);
int (*eats_dots)(void);
int (*blocksize_raw)(void);
int (*blocksize_encoded)(void);
const int blocksize_raw;
const int blocksize_encoded;
};
int build_hostname(char *, size_t, const char *, const size_t, const char *, const struct encoder *, int);