Change xkb_map_new_from_fd to use FILE*
authorRan Benita <ran234@gmail.com>
Sun, 13 May 2012 20:31:59 +0000 (23:31 +0300)
committername <email>
Fri, 18 May 2012 17:54:33 +0000 (20:54 +0300)
commitb89b8e70237f401aa39b963313324f60396bdda8
treede17ae419d5647db0ea08202a1b4503cb49dde8d
parentd15fa57a4b1402a6a419ed34f0fc309f0a26df4f
Change xkb_map_new_from_fd to use FILE*

i.e. xkb_map_new_from_file. The reason is that flex only works with
FILE's, so we must use fdopen on the file descriptor; but to avoid a
memory leak, we must also fclose() it, which, in turn, closes the file
descriptor itself.

Either way is not acceptable, so we can either:
* dup() the fd and use fdopen on that, or
* have the user call fdopen on his own, and accept a FILE* instead of an
  fd.

The second one seems better, and is standard C, so why not. We must add
stdio.h to xkbcommon.h though, which is regrettable, but not a big deal.

Signed-off-by: Ran Benita <ran234@gmail.com>
include/xkbcommon/xkbcommon.h
src/xkbcomp/xkbcomp.c
test/filecomp.c