Hello, slimneill. I tried your code. I fixed it up a bit. It turned out not optimal, I do not know the language "C". Everything works. Thank you for your code.
Sincerely, Vladimir.