Remove readline.c

All occurrences of read_line have been replaced by getline.
peek_line has been absorbed into detect_brace.
This commit is contained in:
Ian Fan 2018-12-09 12:09:11 +00:00
parent 967566e37f
commit a82b8a3c14
11 changed files with 118 additions and 247 deletions

View file

@ -13,7 +13,6 @@
#include <xkbcommon/xkbcommon-names.h>
#include <wlr/types/wlr_keyboard.h>
#include "log.h"
#include "readline.h"
#include "util.h"
int wrap(int i, int max) {
@ -87,11 +86,12 @@ pid_t get_parent_pid(pid_t child) {
char *token = NULL;
const char *sep = " ";
FILE *stat = NULL;
size_t buf_size = 0;
sprintf(file_name, "/proc/%d/stat", child);
if ((stat = fopen(file_name, "r"))) {
if ((buffer = read_line(stat))) {
if (getline(&buffer, &buf_size, stat) != -1) {
token = strtok(buffer, sep); // pid
token = strtok(NULL, sep); // executable name
token = strtok(NULL, sep); // state