42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
my_getline.c File Reference

The file containing the getline functions. More...

Functions

void insert_index (char *str, char c, int *pos, char **str2)
 Insert a character at the index.
 
int my_getline (char **line, FILE *stream)
 Get the line from the stream.
 

Detailed Description

The file containing the getline functions.

Function Documentation

◆ insert_index()

void insert_index ( char * str,
char c,
int * pos,
char ** str2 )

Insert a character at the index.

Parameters
strThe string
cThe character to insert
posThe position of the cursor
str2The second string
Returns
void

◆ my_getline()

int my_getline ( char ** line,
FILE * stream )

Get the line from the stream.

Parameters
lineThe line to store the command
streamThe stream
Returns
int 0 if success, -1 if error