structure and group directories

This commit is contained in:
root committed 2026-07-01 20:50:09 +02:00
1 parent f2e8055172
commit a29805cad2
9 files changed
+294 -50

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ typedef enum {
typedef struct {
bool show_all;
bool show_almost_all;
bool case_sensitive_sorting;
bool no_colour;
bool group_directories;
bool human_readable;
+13
View File
@@ -0,0 +1,13 @@
#ifndef __SORTING_H
#define __SORTING_H
#include "type_definitions.h"
int compare_entries( const void* operand_a, const void* operand_b );
int compare_entries_casesensitive(
const void* operand_a,
const void* operand_b
);
int group_directories( directory_entry_t** entry_table, int num_entries );
#endif
+18
View File
@@ -0,0 +1,18 @@
#ifndef __STRING_FUNCTIONS_H
#define __STRING_FUNCTIONS_H
#include <stdlib.h>
#include <stdbool.h>
char to_lower_case( char character );
char to_upper_case( char character );
int string_to_lower( char* const string );
int string_to_upper( char* const string );
int compare_strings(
const char* const a,
const char* const b,
size_t length,
bool case_sensitive
);
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef __TYPE_DEFINITIONS_H
#define __TYPE_DEFINITIONS_H
#include <linux/limits.h>
#include <sys/stat.h>
#include <sys/types.h>
// type definitions
typedef struct directory_entry {
char name[ NAME_MAX ];
struct stat stats;
} directory_entry_t;
#endif