"Mike Mimic" <pp****@yahoo.com> wrote in message
news:c7**********@planja.arnes.si...
Hi!
I am programming small program which would use its own
text based network protocol. I come to the problem with
ending lines. I was thinking about ending them with \r\n
combination. But the problem is that I would like that
program would be tolerant to other endings (only \r or \n).
So the question is if there is some efficient way to
implement this? Is there some library which would do this?
It should be platform independent.
I don't see this as anything other than a parsing issue. Presumably you are
parsing the content of lines in your program as well, so why not use
whatever techniques you are already using?
Unless the parsing task was really simple, this is an area where I would get
some help. One well established parsing tool is the flex/bison combination,
but there are loads more. Just google for parser generator.
John