Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Add interface files to qt lib
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolkabra committed May 16, 2019
1 parent e4467bf commit 956e8f0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions QtXi/libQtXi/assert.ixi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Halts the program if the condition is false. Otherwise, does nothing.
assert(condition:bool)
9 changes: 9 additions & 0 deletions QtXi/libQtXi/conv.ixi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// String conversion functions

// If "str" contains a sequence of ASCII characters that correctly represent
// an integer constant n, return (n, true). Otherwise return (0, false).
parseInt(str: int[]): int, bool

// Return a sequence of ASCII characters representing the
// integer n.
unparseInt(n: int): int[]
8 changes: 8 additions & 0 deletions QtXi/libQtXi/io.ixi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// I/O support

print(str: int[]) // Print a string to standard output.
println(str: int[]) // Print a string to standard output, followed by a newline.
readln() : int[] // Read from standard input until a newline.
getchar() : int // Read a single character from standard input.
// Returns -1 if the end of input has been reached.
eof() : bool // Test for end of file on standard input.
10 changes: 10 additions & 0 deletions QtXi/libQtXi/timer.ixi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Returns an opaque representation of current time.
// Note: the contents of the returned array are implementation specific
// and should not be accessed directly.
getTimestamp(): int[]

// Returns the time elapsed from r to l (e.g. l - r) in milliseconds,
// when given two arrays returned by getTimestamp().
// The behavior when the arrays are not from that function is undefined.
// The useful range is about 24 days.
timestampDifference(l:int[], r:int[]): int

0 comments on commit 956e8f0

Please sign in to comment.