-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNXT_FileIO.c
43 lines (37 loc) · 1.83 KB
/
NXT_FileIO.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**********************************************************************
Filename: NXT_FileIO.c
Date: November 7, 2016
File Version: 1.0
This file selects the NXT version of the ASCII conversion functions
defined in PC_FileIO.c so that files read or written on a PC.
Whitespace (space, tab, enter) is needed between values.
The functions available are:
bool openWritePC(TFileHandle & fout, char* name);
bool openWritePC(TFileHandle & fout, char* name, word fileSize); // file size can be specified for NXT
bool openReadPC(TFileHandle & fin, char* name);
bool closeFilePC(TFileHandle & fileHandle);
bool writeCharPC(TFileHandle & fout, byte charmsg);
bool writeEndlPC(TFileHandle & fout);
bool writeTextPC(TFileHandle & fout, string const & textmsg);
bool writeLongPC(TFileHandle & fout, long number);
bool writeFloatPC(TFileHandle & fout, string const & numFormat, float number);
bool writeFloatPC(TFileHandle & fout, float number);
bool readCharPC(TFileHandle & fin, char & charmsg);
bool readTextPC(TFileHandle & fin, string & result); // a maximum of 20 characters can be read
bool readIntPC(TFileHandle & fin, int & number);
bool readFloatPC(TFileHandle & fin, float & number);
History
Ver Date Comment
1.0 Nov 7/16 original release
**********************************************************************/
#pragma SystemFile
// select NXT set of functions
#define _EV3FILEIO 0
#include "PC_FileIO.c"
/**********************************************************************
Copyright(c) 2015-2016 C.C.W. Hulls, P.Eng.
Students, staff, and faculty members at the University of Waterloo
are granted a non-exclusive right to copy, modify, or use this
software for non-commercial teaching, learning, and research purposes
provided the author(s) are acknowledged except for as noted below.
**********************************************************************/