You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hashcat/include/shared.h

51 lines
1.5 KiB

9 years ago
/**
* Author......: See docs/credits.txt
9 years ago
* License.....: MIT
*/
#ifndef _SHARED_H
#define _SHARED_H
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
9 years ago
bool is_power_of_2 (const u32 v);
u32 get_random_num (const u32 min, const u32 max);
9 years ago
u32 mydivc32 (const u32 dividend, const u32 divisor);
u64 mydivc64 (const u64 dividend, const u64 divisor);
char *filename_from_filepath (char *filepath);
void naive_replace (char *s, const char key_char, const char replace_char);
void naive_escape (char *s, size_t s_max, const char key_char, const char escape_char);
9 years ago
void hc_asprintf (char **strp, const char *fmt, ...);
void hc_sleep_msec (const u32 msec);
void hc_sleep (const u32 sec);
void setup_environment_variables (void);
void setup_umask (void);
void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed);
int hc_stat (const char *pathname, hc_stat_t *buf);
int hc_fstat (int fd, hc_stat_t *buf);
void hc_qsort_r (void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg);
void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg);
bool hc_path_is_file (const char *path);
bool hc_path_is_directory (const char *path);
bool hc_path_is_empty (const char *path);
bool hc_path_exist (const char *path);
bool hc_path_read (const char *path);
bool hc_path_write (const char *path);
#endif // _SHARED_H