TRF Language Model
wb-linux.cpp
Go to the documentation of this file.
1
// You may obtain a copy of the License at
2
//
3
// http://www.apache.org/licenses/LICENSE-2.0
4
//
5
// Unless required by applicable law or agreed to in writing, software
6
// distributed under the License is distributed on an "AS IS" BASIS,
7
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
// See the License for the specific language governing permissions and
9
// limitations under the License.
10
//
11
// Copyright 2014-2015 Tsinghua University
12
// Author: wb.th08@gmail.com (Bin Wang), ozj@tsinghua.edu.cn (Zhijian Ou)
13
//
14
// All h, cpp, cc, and script files (e.g. bat, sh, pl, py) should include the above
15
// license declaration. Different coding language may use different comment styles.
16
17
18
#include "
wb-linux.h
"
19
#ifdef __linux
20
namespace
wb
21
{
22
const
char
*wday[] = {
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
23
void
_strdate(
char
*str)
24
{
25
time_t timep;
26
struct
tm *p;
27
time(&timep);
28
p = localtime(&timep);
29
sprintf(str,
"%d%d%d %s"
, (1900+p->tm_yday), (1+p->tm_mon), p->tm_mday, wday[p->tm_wday]);
30
}
31
void
_strtime(
char
*str)
32
{
33
time_t timep;
34
struct
tm *p;
35
time(&timep);
36
p = localtime(&timep);
37
sprintf(str,
"%d:%d:%d"
, p->tm_hour, p->tm_min, p->tm_sec);
38
}
39
void
getch()
40
{
41
}
42
43
}
44
#endif
wb-linux.h
wb
define all the code written by Bin Wang.
Definition:
wb-file.cpp:21
Users
zhang
spmi
SPMILM
tools
trf
src
base
wb-linux.cpp
Generated by
1.8.12