1
Flecs 4.2 is out! (ajmmertens.medium.com)
submitted 3 days ago by to c/c_lang@programming.dev
2
The lost malloc() (napcakes.nekoweb.org)
 
 

Prompted by another project idea that popped into my mind, I did some Unix archaeology and looked at the original sources. This is the most fun I've ever had reading someone else's code - probably due to the historical significance. But also because of how delightfully approachable it was, compared to modern monstrocities.

This is a short(-ish) post regarding how they handled the mundane and boring task of allocating and managing memory (in C). In the future I'd like to read more about Unix the OS, its design, architecture & implementation.

3
 
 

D.eSystem 6.1.8.5 introduces a new debug platform for FAT32 on D.eSystem,D.eSystem 6.1.8.5 also fixes a major bug (for example,when you go in older versions in D.eSystem info and press a random key,it just closes automaticly,now there comes a warning and it closes in 5 seccond.)

Find more about D.eSystem 6 here: https://github.com/D-electronics-scratch/D.eSystem_6

Find D.eSystem 6.1.8.5 here: https://github.com/D-electronics-scratch/D.eSystem_6/releases/tag/v.6.1.8.5

4
5
 
 

Hello, when I've tried to use forward declarations to solve circular structure dependencies I get the error 'field has incomplete type'. When browsing for the answer, I got the general response 'the compiler doesn't know what type you're using if you don't fully describe it'. Well I understand that, but it seems as if the purpose of the forward declaration is to have the compiler look for the definition later in the code. If my code looks like the below, should I be getting an incomplete type error? And if so, is there a different way I should be writing the code? Some sort of syntax error, or is there a different way to do the same thing? Any tips appreciated, thanks.

Edit: I think I found the solution in this thread from user "anastaciu", it looks like you can only use the forward declarations if they're pointers to the struct type, not full instances. Lmk if that's right, it got rid of the error for me, but if there's a different way to allow use not from a pointer that'd be great.

typedef struct objA_t objA_t;

typedef struct objB_t{

     objA_t o;

}objB_t;

typedef struct objA_t{

    uint8_t num0;

}objA_t;

6
7
 
 

Hi everyone!

I just released my first ever Wayland application: pickme is a minimal app launcher written in pure C, depending only on libwayland and cairo It auto-detects installed applications. It plays nicely with tiling window managers (I used and testet it in Hyprland).

Since I'm still a beginner in Wayland and application development, I used AI a for the UI layer and Wayland internals for now, because they are still new territory for me. Everything else is hand-written and it's been a great learning project so far. Did I do some rookie beginner mistake, can you give me an Advice If and which license to choose? i have newer released any application and I have therefore no experience, hope you like it☺️.

Repo: https://github.com/Hkwln/pickme

8
 
 

D.eSystem 6.1.8 (Alpine-Lake) is the first version of D.eSystem which can write .TXT files in a FAT32 image which is located in the RAM. D.eSystem 6.1.8 also got a redesign with D.UI 13 I have planed to fix the github repo in future (D.eSystem 6.2.x time) D.eSystem 6.1.8: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.8

9
 
 

D.eSystem 6.1.6 introduces a important bugfix in the calculator because the calculator had a bug with different reselutions on different devices. D.eSystem 6.1.6 also got a update in the explorer. D.eSystem 6.1.6: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.6

10
 
 

D.eSystem 6.1.5 can show the directory in the new explorer which is curently in development. The new explorer got 2 startmodes,the normal mode and the debug mode which keeps the test_read tests from older D.eSystem versions. (D.eSystem is runing on real hardware on the thumbnail)

Find D.eSystem 6.1.5 here: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.5

11
 
 

I don't have an example or goal to work with, this is mostly a hypothetical for learning purposes.

Besides some basics for how to handle UTF-8 strings in general (as one can glean from other languages' documentation), what types/libraries/documentation exists for handling UTF-8 text in C?

12
 
 

D.eSystem 6.1.4 is the firts version of D.eSystem which can read FAT32 text files. D.eSystem 6.1.4 also got a few bugfixes. (D.eSystem is runing on real hardware on the thumbnail)

Find D.eSystem 6.1.4 here: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.4

13
Permissable AI (lemmy.world)
 
 

Would the use of a coding AI be permissible if it were only trained on language syntax, library information, and possible (optional) FOSS source code?

14
 
 

#D.eSystem 6.1.2 is the first D.eSystem which intdroduces first FAT32 support (it can find a file in the directory). It also redesigns the desktop with D.UI 12 and it brings back Legacy BIOS fallback. D.eSystem 6.1.2: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.2

15
 
 

D.eSystem 6.1.1 fixed some bugs from D.eSystem 6.1.0 and it removed the Legacy BIOS fallback because future features will require the UEFI firmware. D.eSystem 6.1.1: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.1

16
17
 
 

I am curently developing a file system for my OS (D.eSystem) with the version 6.1.0.5. The file system is now not working,but it is in development, you can find D.eSystem 6.1.0.5 here: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.0.5

18
19
 
 

D.eSystem 6.1.0 introduces a small setup and you can choose your UI with D.eSystem 6.1.0.

D.eSystem 6.1.0 on github: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases/tag/v.6.1.0

All current D.eSystem releases on github: https://github.com/D-electronics-scratch/all_D.eSystem_versions/tags

20
 
 

I have watched some developers giving advice about using C for general software development, i noticed that a not insignificant amount of them are strictly using C89, vaguely gesturing that more recent versions of C are less dependable, or more broken.

I would appreciate if anyone here can explain the specifics, as me not being a C developer (yet) and looking over the source code of some libraries which do heavily use modern C features, for example to have a defer-like macro (using attributes, or the 2 for statement trick), or generic data structures (using manual name mangling).

I understand these examples are strictly not how C is usually used, and are common in other more modern languages, which may turn some developers away from using these, my main question is "why exactly?".

I don't mind being given further reading about this, so if you have an article in mind, it too would be greatly appreciated.

note: in the title i referred to C23, but it could be anything post C89/C99 depending on the subject matter.

21
 
 

#Hello eveyone!!

D.eSystem 6.0.8 beta is the final release of D.eSystem 6, ist way more stable than the old Beta versions and it introduces a gui for the D.eSystem version app

D.eSystem 6.0.8 on github: https://github.com/D-electronics-scratch/all_D.eSystem_versions/releases

Github main page: https://github.com/D-electronics-scratch/all_D.eSystem_versions

22
 
 

D.eSystem 6.0.1 Beta This is the first beta release of D.eSystem 6. It includes several stability patches, a fully graphical Clock app, and a redesigned D.eShell interface. D.eSystem 6 page: https://github.com/D-electronics-scratch/D.eSystem

23
 
 

Hello everyone!!

D.eSystem 6.0.6 alpha introduces the first GUI for my operating system D.eSystem 6.

The system is currently keyboard‑only, but mouse support is planned for future versions.

The usage is similar to D.eSystem 6.0.5, but now with a graphical interface, and the calculator also received a GUI version.

Requirements:

64‑bit CPU

UEFI firmware (Legacy BIOS is not supported)

D.eSystem 6.0.6 alpha runs on any VM (QEMU, VirtualBox, VMware) and on real hardware.

Download D.eSystem 6.0.6 alpha here: https://github.com/D-electronics-scratch/D.eSystem-6.0.6-alpha-iso-download

24
 
 

D.eSystem 6.0.5 alpha is a custom OS that runs on real hardware and in QEMU, VirtualBox, and VMware.

This version includes the new D.eShell and three programs.

The OS is text‑based for now, but 6.0.6 alpha will introduce a GUI. A big roadmap is already planned.

ISO download: https://github.com/D-electronics-scratch/D.eSystem-6.0.5-alpha-iso-download/blob/main/template.iso

25
 
 

Context\
I have been learning C as a hobby since autum 2025 because I am intrigued by computers. I have mainly been using Bro Code's tutorial and PDF The C Programming Language (Second Edition), although I'm too much of a beginner to understand all of the latter material. There's not really much more to it. I don't really have any concrete goals with learning C, but I thought it could be a good first step into the world of programming and for now, I just really enjoy coding. In the future, I'd like to learn assembly language and then finally (?) program some CPU.

Background\
When I realized how I can use for loops to go through strings and how I can then manipulate certain portions of said string, I realized that I can play around with it to allow a user to modify (here, "trim") any given text. Good fun!

In this particular case, I focused on practicing separating the program into as specific and small functions as possible.

Questions\

  1. Should I or could I call the next function from within the previously called function, as opposed to listing them all in main() as I have done below? My guess is that listing them all in main() gives the reader a better overview of the flow, as opposed to having to look into each separate function to find out what's connecting to what?

  2. I believe that the only variable that really needs to be global is the "input", since so many functions need to be able to access it. What are the pros and cons of using local variables where possible?

CODE

#include <stdio.h>  
#include <string.h>  

//Function declarations  
void promptchoice_main(void);  
void promptchoice_main_again(void);  
void promptinput(void);  
void promptchoice_trim(void);  
void executechoice(char choice_trim);  
void trimnumbers(void);  
void trimwhitespace(void);  
void trimletters(void);  
void trimspecial(void);  
void specifyspecial(void);  
void printresult(char input[]);  

//Global variables  
char choice_main = 0x00;  
char choice_trim = 0x00;  
char choice_detail = 0x00;  
char choice_special = 0x00;  
char input[1000] = "";  
char previous_input[1000] = "";  

//Remove specific numbers, letters, punctuation or whitespace characters from input.  
int main() {  
	printf("\nWelcome! This program trims text by removing unwanted characters.\n");  
	while (1) {  
		if (strlen(previous_input) == 0) { // Check for previously trimmed text in memory.  
			promptchoice_main();  
			if (choice_main == 'E') { break; }  
			if (choice_main == 'T') {  
				promptinput();  
				promptchoice_trim();  
				executechoice(choice_trim);  
				printresult(input);  
			}  
		}  
		else {  
			promptchoice_main_again();  
			if (choice_main == 'E') { break; }  
			if (choice_main == 'T') {  
				promptinput();  
				promptchoice_trim();  
				executechoice(choice_trim);  
				printresult(input);  
			}  
			else if (choice_main == 'P') {  
				sprintf(input, "%s", previous_input);  
				printf("\nYou are trimming previously trimmed text: %s\n", input);  
				promptchoice_trim();  
				executechoice(choice_trim);  
				printresult(input);  
			}  
		}  
	}  
	printf("\nGoodbye!\n");  
	return 0;  
}  

//Function definitions  
void promptchoice_main(void) {  
	while (1) {  
		printf("\nPress T and ENTER to trim text or E and ENTER to exit: ");  
		scanf("%c", &choice_main);  
		while (getchar() != '\n') {}  
		if (choice_main == 'T' || choice_main == 'E') { break; }  
		else { printf("\nInvalid input!\n"); }  
	}  
	return;  
}  

void promptchoice_main_again(void) {  
	while (1) {  
	printf("\nPress T and ENTER to trim new text, P and ENTER to trim previously trimmed text or E and ENTER to exit: ");  
	scanf("%c", &choice_main);  
	while (getchar() != '\n') {}  
		if (choice_main == 'T' || choice_main == 'P' || choice_main == 'E') { break; }  
		else { printf("\nInvalid input!\n"); }  
	}  
	return;  
}  

void promptinput(void) {  
	printf("\nEnter the text that you would like to trim and press ENTER: ");  
	fgets(input, sizeof input, stdin);  
	input[strlen(input) - 1] = '\0';  
	return;  
}  

void promptchoice_trim(void) {  
	while (1) {  
		printf("\nWhat would you like to trim?\n1) Numbers (1, 2, 3...)\n2) Whitespace (space, tab or newline) \n3) Letters (A,B,C... a,b,c...)\n4) Special characters (!,?, . , ...)\nType one of the above numbers and press ENTER: ");  
		scanf("%c", &choice_trim);  
		while (getchar() != '\n') {}  
		if (choice_trim >= 0x31 && choice_trim <= 0x34) { break; } // Only accept 1 through 4.  
		else { printf("\nInvalid choice!\n"); } 
	}  
	return;  
}  

void executechoice(char choice_trim) {  
	switch (choice_trim) {  
		case 0x31: trimnumbers(); // 123 etc  
			break;  

		case 0x32: trimwhitespace(); // space, tab, newline  
			break;  
		
		case 0x33: trimletters(); // ABC..., abc...  
			break;  

		case 0x34: trimspecial(); // ! ? , . etc.  
			break;  
	}  
	return;  
}  

void trimnumbers(void) {  
	int n = 0;  
	for (n = strlen(input) - 1; n >= 0; n--) {  
		if (input[n] >= 0x30 && input[n] <= 0x39) { input[n] = 0x18; }  
	}  
	return;  
}  

void trimwhitespace(void) {  
	while (1) {  
		printf("\nType S to trim SPACE, T to trim TAB, N to trim NEWLINE or A to trim all whitespace: ");  
		scanf("%c", &choice_detail);  
		while (getchar() != '\n') {}  
		if (choice_detail == 'S' || choice_detail == 'T' || choice_detail == 'A') { break; }  
		else { printf("\nInvalid input!\n"); }  
	}  
	int n = 0;  
	for (n = strlen(input) - 1; n >= 0; n--) {  
		if (choice_detail == 'S') { if (input[n] == 0x20) { input[n] = 0x18; } } // space  
		else if (choice_detail == 'T') { if (input[n] == 0x09) { input[n] = 0x18; } } // tab  
		else if (choice_detail == 'N') { if (input[n] == 0x0A) { input[n] = 0x18; } } // newline  
		else if (choice_detail == 'A') { if (input[n] == 0x20 || input[n] == 0x09 || input[n] == 0x0A) { input[n] = 0x18; } }  
	}  
	return;  
}  

void trimletters(void) {  
	while (1) {  
		printf("\nType U to trim uppercase letters, L to trim lowercase letters or A to trim all letters: ");  
		scanf("%c", &choice_detail);  
		while (getchar() != '\n') {}  
		if (choice_detail == 'U' || choice_detail == 'L' || choice_detail == 'A') { break; }  
		else { printf("\nInvalid input!\n"); }  
	}  
	int n = 0;  
	for (n = strlen(input) - 1; n >= 0; n--) {  
		if (choice_detail == 'U') { if (input[n] >= 0x41 && input[n] <= 0x5A) { input[n] = 0x18; } } // Uppercase  
		else if (choice_detail == 'L') { if (input[n] >= 0x61 && input[n] <= 0x7A ) { input[n] = 0x18; } } // Lowercase  
		else if (choice_detail == 'A') { if (input[n] >= 0x41 && input[n] <= 0x5A || input[n] >= 0x61 && input[n] <= 0x7A ) { input[n] = 0x18; } }  
	}  
	return;  
}  

void trimspecial(void) {  
	while (1) {  
		printf("\nType A to trim all special characters or S to specify which character to remove: ");  
		scanf("%c", &choice_detail);  
		while (getchar() != '\n') {}  
		if (choice_detail == 'A' || choice_detail == 'S') { break; }  
		else {  printf("\nInvalid input!\n"); }  
	}  
	int n = 0;  
	for (n = strlen(input) - 1; n >= 0; n--) {  
		if (choice_detail == 'A') { if (input[n] >= 0x21 && input[n] <= 0x2F || input[n] >= 0x3A && input[n] <= 0x40 || input[n] >= 0x5B && input[n] <= 0x60 || input[n] >= 0x7B && input[n] <= 0x7E) { input[n] = 0x18; } } // All whitespace  
	}  
	if (choice_detail == 'S') { specifyspecial(); } // Let user specify character.  
	return;  
}  

void specifyspecial(void) {  
	while (1) {  
		printf("\nEnter special character to trim and press ENTER: ");  
		scanf("%c", &choice_special);  
		while (getchar() != '\n') {}  
		if (choice_special >= 0x21 && choice_special <= 0x2F || choice_special >= 0x3A && choice_special <= 0x40 || choice_special >= 0x5B && choice_special <= 0x60 || choice_special >= 0x7B && choice_special <= 0x7E) { break; }  
		else { printf("\nNot a special character!\n"); }  
	}  
	int n = 0;  
	for (n = strlen(input) - 1; n >= 0; n--) { if (input[n] == choice_special) { input[n] = 0x18; } }  
	return;  
}  

void printresult(char input[]) {  
	printf("\nTrimmed text:\n\n%s\n", input);  
	sprintf(previous_input, "%s", input); // Save trimmed text for reuse.  
	return;  
}  

//TODO  
//Create error handling when trimming non existing characters.  
//Replace characters (uppercase/lowercase, user selected, etc).  

view more: next ›