Frame Streams implementation in C