This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sys/mman.h> | |
| #include <stdint.h> | |
| #include <stddef.h> | |
| #include <sanitizer/asan_interface.h> | |
| #include "./stdint.h" | |
| typedef struct | |
| { | |
| u8 *arena_start_pos; | |
| size_t size;//total bytes allocated for the arena |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int calculate_key_size(char argv[]); // returns size of key | |
| int is_alphabet_arr(char argv[]); // checks whether all elements of an array are alphabets | |
| int is_alphabet_char(char a); // checks whether a character is an alphabet | |
| int repeat_letter_check(char argv[]); // checks whether a letter repeats in an array | |
| int alphabet_case_check(char a); // returns 0 for lowercase and 1 for uppercase | |
| int calculate_key_size(char argv[]){ | |
| int i = 0; | |
| int key_size = 0; | |
| while(argv[i] != '\0'){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| #include"functions.c" | |
| int check_key_validity(char argv[]); // checks whether the key given by the user is valid or not according to constraints | |
| int main(int argc, char* argv[]){ | |
| if(argc != 2){ | |
| printf("Usage : ./program_name key"); | |
| return 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| int calculate_key_size(char argv[]); // returns size of key | |
| int is_alphabet_arr(char argv[]); // checks whether all elements of an array are alphabets | |
| int is_alphabet_char(char a); // checks whether a character is an alphabet | |
| int repeat_letter_check(char argv[]); // checks whether a letter repeats in an array | |
| int check_key_validity(char argv[]); // checks whether the key given by the user is valid or not according to constraints | |
| int case_check(char a); // returns 0 for lowercase and 1 for uppercase | |