diff-rcm/pa.h

62 lines
1.6 KiB
C
Raw Normal View History

2019-05-11 19:39:28 -07:00
#ifndef pa_h
#define pa_h
#include <stdio.h>
#include <stdlib.h>
#define MAXSTRINGS 1024
#define BUFLEN 256
2019-05-18 00:52:07 -07:00
// ================================================== //
2019-05-11 19:39:28 -07:00
typedef struct pa pa;
struct pa {
char** base;
int filesize;
int start;
int stop;
2019-05-15 17:24:09 -07:00
char* firstline; // DEBUG only
char* secondline;
2019-05-11 19:39:28 -07:00
};
2019-05-18 00:52:07 -07:00
FILE* openfile(const char* filename, const char* openflags);
2019-05-11 19:39:28 -07:00
pa* p;
pa* q;
pa* pa_make(char* base[], int size, int start, int stop);
pa* pa_first(char* base[], int size);
pa* pa_next(pa* p);
2019-05-18 00:52:07 -07:00
2019-05-17 20:52:52 -07:00
void pa_destroy(pa* p);
2019-05-11 19:39:28 -07:00
size_t pa_filesize(pa* p);
size_t pa_size(pa* p);
char** pa_base(pa* p);
char* pa_info(pa* p);
2019-05-17 20:52:52 -07:00
int pa_equal(pa* p, pa* q);
2019-05-17 23:34:37 -07:00
2019-05-17 20:52:52 -07:00
void sideside_type(const char* left, const char* right, int nocommon, int leftparen, char symbol);
2019-05-17 23:34:37 -07:00
2019-05-18 00:52:07 -07:00
void print_check(pa* p, pa* q, void (*fp)(const char*, const char*));
2019-05-17 23:34:37 -07:00
2019-05-19 00:21:21 -07:00
void print_first (pa* p, void (*fp)(const char*));
2019-05-17 20:52:52 -07:00
void print_second(pa* p, pa* q, void (*fp)(const char*, const char*));
2019-05-17 23:34:37 -07:00
2019-05-19 00:21:21 -07:00
void print_left_paren (const char* left, const char* right);
void print_no_common (const char* left, const char* right);
2019-05-18 00:52:07 -07:00
void print_side_normal(const char* left, const char* right);
2019-05-17 23:34:37 -07:00
2019-05-19 00:21:21 -07:00
void print_left (const char* left, const char*);
2019-05-18 00:52:07 -07:00
void print_right(const char* right, const char*);
2019-05-19 00:21:21 -07:00
void print_both (const char* left_right, const char*);
void print_normal_left (const char* left, const char*);
void print_normal_right(const char* right, const char*);
void print_normal_both (const char* left, const char* right, const char*);
void line_check(const char* right, const char*);
int line_number(const char* left, const char* right);
2019-05-17 23:34:37 -07:00
2019-05-11 19:39:28 -07:00
#endif