-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
format modified C file to pass linting
- Loading branch information
1 parent
b7a65ec
commit ff968f3
Showing
1 changed file
with
19 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,30 @@ | ||
#include <stdio.h> | ||
#include <readline/readline.h> | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
rl_compentry_func_t* my_compentry; | ||
rl_compentry_func_t *my_compentry; | ||
|
||
char* compentry_wrapper(const char* text, int i) { | ||
char* res = my_compentry(text, i); // Idris frees this | ||
if (res != NULL) { | ||
char* comp = malloc(strlen(res)+1); // Readline frees this | ||
strcpy(comp, res); | ||
return comp; | ||
} | ||
else { | ||
return NULL; | ||
} | ||
char *compentry_wrapper(const char *text, int i) { | ||
char *res = my_compentry(text, i); // Idris frees this | ||
if (res != NULL) { | ||
char *comp = malloc(strlen(res) + 1); // Readline frees this | ||
strcpy(comp, res); | ||
return comp; | ||
} else { | ||
return NULL; | ||
} | ||
} | ||
|
||
void idrisrl_setCompletion(rl_compentry_func_t* fn) { | ||
rl_completion_entry_function = compentry_wrapper; | ||
my_compentry = fn; | ||
void idrisrl_setCompletion(rl_compentry_func_t *fn) { | ||
rl_completion_entry_function = compentry_wrapper; | ||
my_compentry = fn; | ||
} | ||
|
||
char* getString(void* str) { | ||
return (char*)str; | ||
} | ||
char *getString(void *str) { return (char *)str; } | ||
|
||
void* mkString(char* str) { | ||
return (void*)str; | ||
} | ||
void *mkString(char *str) { return (void *)str; } | ||
|
||
void* nullString() { | ||
return NULL; | ||
} | ||
void *nullString() { return NULL; } | ||
|
||
int isNullString(void* str) { | ||
return str == NULL; | ||
} | ||
int isNullString(void *str) { return str == NULL; } |