/ Link the fil2 filter chain to the fil1(this) filter chain. */ /
| 295 | /* Link the fil2 filter chain to the fil1(this) filter chain. */ |
| 296 | /***********************************************************************/ |
| 297 | PFIL FILTER::Link(PGLOBAL g, PFIL fil2) |
| 298 | { |
| 299 | PFIL fil1; |
| 300 | |
| 301 | if (trace(1)) |
| 302 | htrc("Linking filter %p with op=%d... to filter %p with op=%d\n", |
| 303 | this, Opc, fil2, (fil2) ? fil2->Opc : 0); |
| 304 | |
| 305 | for (fil1 = this; fil1->Next; fil1 = fil1->Next) ; |
| 306 | |
| 307 | if (fil1->Opc == OP_SEP) |
| 308 | fil1->Next = fil2; // Separator already exists |
| 309 | else { |
| 310 | // Create a filter separator and insert it between the chains |
| 311 | PFIL filp = new(g) FILTER(g, OP_SEP); |
| 312 | |
| 313 | filp->Arg(0) = fil1; |
| 314 | filp->Next = fil2; |
| 315 | fil1->Next = filp; |
| 316 | } // endelse |
| 317 | |
| 318 | return (this); |
| 319 | } // end of Link |
| 320 | |
| 321 | /***********************************************************************/ |
| 322 | /* Remove eventual last separator from a filter chain. */ |
no test coverage detected