#ifndef ARRAY_H
#define ARRAY_H

#include <cstdio>
#include "globals.h"
using namespace std;

/* returns a newly allocated subarray */
WORDTYPE *splice(WORDTYPE *, int, int);

/* prints the array, separated by spaces, ending with a zero,
   to the specified file stream */
void fprint_array(FILE *, WORDTYPE *);

WORDTYPE penultimate_word(WORDTYPE*);
WORDTYPE last_word(WORDTYPE*);

/* returns the length of an array */
int phraselen(WORDTYPE*); // analogous to strlen()

string lowercase(const string& str);
string lcfirst(const string& str);
bool cap (const string& str);
bool has_num (const string& str);
bool has(const string& str, char tok);
bool endswith(const string& str, string pat);

#endif //ARRAY_H
