https://github.com/msio808/rescal
A BASIC CLI RESISTOR COLOR CODE INTERPRETER WRITTEN IN C
https://github.com/msio808/rescal
c color-codes resistance resistance-calculator resistor resistor-calculator resistor-color-codes
Last synced: 29 days ago
JSON representation
A BASIC CLI RESISTOR COLOR CODE INTERPRETER WRITTEN IN C
- Host: GitHub
- URL: https://github.com/msio808/rescal
- Owner: msio808
- License: gpl-3.0
- Created: 2024-05-19T21:19:33.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T19:24:16.000Z (8 months ago)
- Last Synced: 2025-02-04T13:41:12.416Z (3 months ago)
- Topics: c, color-codes, resistance, resistance-calculator, resistor, resistor-calculator, resistor-color-codes
- Language: C
- Homepage:
- Size: 220 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE
Awesome Lists containing this project
README
RESISTOR COLOR CODE CALCULATOR
# ๐ Getting Started
### Requirements
โบ gcc make cmake valgrind
## โ๏ธ Installation
### Clone the quizbit repository:
```sh
git clone https://github.com/msio808/rescal.git
```### Change to the project directory:
```sh
cd rescal/config/
```### ๐ค Running the project
```sh
./build.sh --run
```### ๐งช Debug with GDB
```sh
./build.sh --debug
```### ๐งช Debug with Valgrind
```sh
./build --memcheck
```### ๐ Clean generated build files
```sh
./build.sh --clean
```# ๐ Folder Structure
```
.
โโโ config
โ โโโ build.sh
โ โโโ CMakeLists.txt
โโโ docs
โ โโโ README.md
โโโ include
โ โโโ helpers.h
โ โโโ src.h
โโโ LICENSE
โโโ src
โโโ helpers
โ โโโ helpers.c
โ โโโ src.c
โโโ main.c
```---
# โ If you want to run the program on windows
- Comment out the ```strings.h``` from the [```../include/src.h```](../include/src.h) file.
- Write your own custom ```strcasecmp()``` function.
- Unlike the ```strcmp()``` the ```strcasecmp()``` function is case-insensitive.The code below might help
```c++
#include
#include//? Custom implementation of strcasecmp
int strcasecmp(const char *str1, const char *str2) {
while (*str1 && *str2) {
const char ch1 = tolower((uint8_t)*str1);
const char ch2 = tolower((uint8_t)*str2);
if (ch1 != ch2) {
return ch1 - ch2;
}
str1++;
str2++;
}return tolower((uint8_t)*str1) - tolower((uint8_t)*str2);
}
```