Fixed a major issue in the stergios.c where LIMIT was int32_t instead of int128_t and also implented a version where a user can run the stergios step counter from a file (example format being in the example file).
This commit is contained in:
31 files changed
+65368
-15
No files matched your search
@@ -3,6 +3,19 @@
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @brief Reads a line from the given stream, dynamically allocating memory for the line.
|
||||
* The line is terminated by a newline character or EOF. If a '#' character is encountered, the rest of the line is ignored (treated as a comment).
|
||||
* @param stream The input stream to read from (e.g., stdin or a file).
|
||||
* @param msgptr Pointer to a char pointer that will hold the address of the allocated string. If *msgptr is NULL, memory will be allocated for the string.
|
||||
* @param n Pointer to a size_t variable that will hold the size of the allocated string. If *msgptr is NULL, *n will be set to 128 initially and will be doubled as needed.
|
||||
* @return 0 on success, 1 on error (e.g., if msgptr or n is NULL, or if memory allocation fails). If the end of the file is reached before any characters are read, it also returns 1.
|
||||
*/
|
||||
bool read_line(FILE* stream, char** msgptr, size_t* n);
|
||||
|
||||
/*
|
||||
* @brief Reads three 128 bit integers from the user with a prompt
|
||||
* @param prompt The message to display to the user before reading input
|
||||
|
||||
Reference in new issue
Block a user