File: stdio.py

package info (click to toggle)
teem 1.12.0~20160122-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,444 kB
  • sloc: ansic: 152,549; python: 10,748; perl: 281; sh: 58; makefile: 41; cpp: 26
file content (19 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from ctypes import *
from ctypes.util import find_library

class FILE(Structure):
    pass

# oddly, size_t is in ctypes, but not ptrdiff_t
if sizeof(c_void_p) == 4:
    ptrdiff_t = c_int32
elif sizeof(c_void_p) == 8:
    ptrdiff_t = c_int64

#libc = CDLL(find_library("c"))
# HEY these are probably Mac-specific, please fix
#stdin = POINTER(FILE).in_dll(libc, "__stdinp")
#stderr = POINTER(FILE).in_dll(libc, "__stderrp")
#stdout = POINTER(FILE).in_dll(libc, "__stdoutp")