18int findmark(std::istream &file,
const char *s) {
22 char *fs =
new char[l + 1];
23 for (n = 0; n < l; n++) {
24 if ((ic = file.get()) == EOF) {
32 while (strcmp(fs, s) != 0) {
33 for (n = 1; n < l; n++)
35 if ((ic = file.get()) == EOF) {
51 char *fs =
new char[l + 1];
52 for (n = 0; n < l; n++) {
53 if ((ic = file.get()) == EOF) {
55 outfile.write(fs, n + 1);
63 int s_not_new_line = 0;
64 while (strcmp(fs, s) != 0) {
66 if ((fs[0] ==
'\t' || fs[0] ==
' ') && s_not_new_line == 0) {
73 if (s_not_new_line == 1) outfile.put(fs[0]);
76 for (n = 1; n < l; n++)
78 if ((ic = file.get()) == EOF) {
94 int *pos_fs =
new int[q];
95 int s_init_pos_fs = 0;
98 for (i = 0; i < q; i++) {
100 if (l[i] > l_max) l_max = l[i];
105 char *fs =
new char[l_max + 1];
107 for (i = 0; i < q; i++) {
116 while ((ic = file.get()) != EOF) {
118 for (i = 1; i < l_max; i++) {
122 if (s_init_pos_fs == 0) {
124 for (i = 0; i < q; i++) {
125 if (l_max - pos_fs[i] < l[i]) {
133 if (ss == 1) s_init_pos_fs = 1;
135 for (i = 0; i < q; i++) {
136 if (strcmp(&(fs[pos_fs[i]]), s[i]) == 0) {
154 char **s =
new char *[q];
156 for (i = 0; i < q; i++) {
158 s[i] =
new char[strlen(str[i].c_str()) + 1];
159 strcpy(s[i], str[i].c_str());
162 s[i] =
new char[strlen(str[i]) + 1];
163 strcpy(s[i], str[i]);
167 for (i = 0; i < q; i++) {
int findmark_other_repeat(std::istream &file, std::ostream &outfile, const char *s)
int findmark(std::istream &file, const char *s)
int find1ofnmark(std::istream &file, int q, char *s[])