1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Occurrences Counter
This program counts the number of characters, digits, and vowels in a given string.
## Features
- Counts total number of characters in the input string
- Counts the number of digits (0-9) in the input string
- Counts the number of vowels (a, e, i, o, u, case-insensitive) in the input string
- Provides a simple command-line interface for input
## Dependencies
- GCC compiler
- Standard C library
- Check unit testing framework (for running tests)
- make utility
- gzip (for man page compression)
If GCC is unavailable, follow the instructions on how to install it here: https://gcc.gnu.org/install/
If check is unavailable, follow the instructions on how to install it here: https://libcheck.github.io/check/web/install.html
## Building and Installing for POXIS systems (not compatible with Windows, or other non-POSIX platforms)
1. Open a terminal in the project directory.
2. To install the program and man page (requires root privileges):
```bash
sudo make install
```
This will install the program to `/usr/local/bin` and the man page to `/usr/local/share/man/man1`.
3. To uninstall:
```bash
sudo make uninstall
```
4. To clean the build files:
```bash
make clean
```
## Running the Program
After installation, you can run the program from any directory:
```bash
occurrences
```
To view the man page:
```bash
man occurrences
```
## Usage
Warning: This program is only compatible with ASCII input, this doesn't include tab or new line characters
1. Run the program.
2. Enter a string when prompted.
3. The program will output the number of characters, digits, and vowels in the input string.
## Testing
To run the unit tests:
```bash
make test
```
This will compile and run the test suite, which checks various scenarios including but not limited to empty strings, strings with only vowels, strings with only digits, and mixed input.
|