-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
80 lines (63 loc) · 1.48 KB
/
main.h
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
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef _MAIN_H_
#define _MAIN_H_
#define NULL_PTR -1
#define WRONG_SPECIFIER -2
/**
* get_char - put a character into a memory block allocated using malloc
* The allocated memory should has two bytes: the character, and the
* terminating null byte.
*
* @c: character
*
* Return: pointer to that memory block, NULL if error
*/
char *get_char(char c);
/**
* get_string - put a string into a memory block allocated using malloc
* @s: string
*
* Return: pointer to that memory block, NULL if error
*/
char *get_string(char *s);
/**
* put_number - put an integer into a block of memory
* @n: integer
*
* Return: pointer to that memory block, NULL if error
*/
char *get_number(int n);
/**
* print_arg - put one passed in parameter into a block of memory
* @type: type of the parameter
*
* Return: pointer to the memory block, NULL if error
*/
char *get_arg(char type, ...);
/**
* get_binary - converts an unsigned int to binary
* @n: integer
*
* Return: pointer to binary
*/
char *get_binary(unsigned int n);
/**
* get_rev - reverse a string
* @s: string
* Return: string reversed
*/
char *get_rev(char *s);
/**
* get_rot13 - rot13 as a string
* @s: string
* Return: rot13
*/
char *get_rot13(char *s);
char *str_concat(char *, char *);
char *string_nconcat(char *, char *, unsigned int);
int _strlen(char *);
int _printf(const char *, ...);
char *_strchr(char *s, char c);
int _atoi(char *s);
int _strcmp(char *, char *);
int _strcmp_n(char *, char *, int n);
#endif