Download Pelles C here: http://www.pellesc.se
// Code by Google Gemini
#include <stdio.h>
#include <stdint.h>
#include <string.h>
// const char b64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
// Some tools (like rclone in certain modes) use Base64Url, which is a variant designed to be safe for filenames and URLs.
// In that variant, + is replaced with - and / is replaced with _.
// Rclone compatibility
const char b64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
typedef struct {
uint8_t buffer[20];
uint64_t length;
int shift;
} QuickXorHashContext;
void qxh_init(QuickXorHashContext *ctx) {
memset(ctx, 0, sizeof(QuickXorHashContext));
}
void qxh_update(QuickXorHashContext *ctx, const uint8_t *payload, size_t len) {
for (size_t i = 0; i < len; i++) {
int byte_pos = ctx->shift / 8;
int bit_pos = ctx->shift % 8;
uint8_t v = payload[i];
// XOR with explicit cast to uint8_t to suppress Pelles C warnings
ctx->buffer[byte_pos] ^= (uint8_t)(v << bit_pos);
// Handle overflow into the next byte (circularly)
if (bit_pos > 0) {
int next_byte = (byte_pos + 1) % 20;
ctx->buffer[next_byte] ^= (uint8_t)(v >> (8 - bit_pos));
}
ctx->shift = (ctx->shift + 11) % 160;
}
ctx->length += len;
}
void qxh_finalize(QuickXorHashContext *ctx, uint8_t *out) {
memcpy(out, ctx->buffer, 20);
// XOR the 64-bit length into the last 8 bytes (Little Endian)
for (int i = 0; i < 8; i++) {
out[12 + i] ^= (uint8_t)((ctx->length >> (8 * i)) & 0xFF);
}
}
void base64_encode(const uint8_t *in, char *out) {
int i, j = 0;
for (i = 0; i < 18; i += 3) {
out[j++] = b64_table[in[i] >> 2];
out[j++] = b64_table[((in[i] & 0x03) << 4) | (in[i+1] >> 4)];
out[j++] = b64_table[((in[i+1] & 0x0f) << 2) | (in[i+2] >> 6)];
out[j++] = b64_table[in[i+2] & 0x3f];
}
out[j++] = b64_table[in[18] >> 2];
out[j++] = b64_table[((in[18] & 0x03) << 4) | (in[19] >> 4)];
out[j++] = b64_table[(in[19] & 0x0f) << 2];
out[j++] = '=';
out[j] = '\0';
}
int main(int argc, char *argv[]) {
if (argc < 2) {
printf("Usage: qxh <file>\n");
return 1;
}
FILE *f = fopen(argv[1], "rb");
if (!f) {
perror("Error opening file");
return 1;
}
QuickXorHashContext ctx;
qxh_init(&ctx);
uint8_t buf[16384];
size_t n;
while ((n = fread(buf, 1, sizeof(buf), f)) > 0) {
qxh_update(&ctx, buf, n);
}
fclose(f);
uint8_t hash[20];
char b64[29];
qxh_finalize(&ctx, hash);
base64_encode(hash, b64);
printf("%s\n", b64);
return 0;
}
Quote from: ander_cc on April 10, 2026, 11:03:38 AMDue to my limited capability, I have not translated the String Table. The Dialog and Menu have all been translated, with the layout of a small number of Dialog windows adjusted to ensure all text is fully displayed. But some testing is needed.
see attach zip file.
---
Pelles C v14的简体中文翻译,包括全部对话框和菜单,拷贝到安装目录 .\PellesC\Bin\Intl 中即可。
Quote from: John Z on April 09, 2026, 10:38:00 AMHi ander_cc,Thank you very much!
You can find the basic procedure here:
https://web.archive.org/web/20250325220454/https://wiki.pellesc.de/doku.php/translating
Also attached below as a pdf -
But you probably need the version 14 rsrc0009.zip which you can get from here:
http://www.pellesc.se
享受
John Z
Quote from: Pelle on January 11, 2026, 11:02:49 PMC is here to stay, and sure has turned into a sh*thole (C23 finally set what true/false should be)Quote from: alderman2 on January 11, 2026, 09:51:45 PMI don't think they're the ones you should lean on, but rather those who still program the basic language C.Sure. The question is what this means in practice.
C on Windows in 2026+ will mainly be hobbyists (certainly for this project), where the latest and greatest isn't that important.
At my first real programming job in ~1985 I could have gone the Unix route (probably), but it wasn't much of an option back then... and 40+ years later it's still not an option...
After Windows and Unix there are roughly zero desktop operating-systems to choose from...
Microsoft have managed to mess up Windows quite a bit in recent years, focusing on irrelevant things (for enough people to matter), so it's not an obvious choice - except there are few other options. Now that I'm almost finished with ARM64 (still a potential flop), it's not clear what I should do. Write more examples? Not that exiting to be honest...
I'm not an innovator, and right now I can't find much inspiration anywhere...
Quote__STDC_VERSION__ Never defined when the /Ze option is used. The supported ISO C standard.
Defined as the integer constant 199901L when the /std=C99 option is used.
Defined as the integer constant 201112L when the /std=C11 option is used.
Defined as the integer constant 201710L when the /std=C17 option is used.
Defined as the integer constant 000000L (TBD) when the /std=C2X option is used.
Page created in 0.026 seconds with 11 queries.