[go: up one dir, main page]

File: files.chh

package info (click to toggle)
chpp 0.3.2-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,024 kB
  • ctags: 5,131
  • sloc: ansic: 29,956; cpp: 575; sh: 500; makefile: 314; yacc: 265; asm: 261; lex: 64
file content (22 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __FILES_CHH__
#define __FILES_CHH__
%define(frest,file,%until(%feof(%file),%fgets(%file)))\
%define(fwholefile,filename,%locals(file,%<file=%fopen(%filename)>%frest(%file)%fclose(%file)))\
%<define( fexists, file1, 
  %<locals( tmpfile,
    %<tmpfile=%<fopen( %<file1> )>>\
    %<if( %[ %<tmpfile> == -1 ], 0, %<fclose( %<tmpfile> )>1)>
  )>
)>\
%<define( fneweras, file1, file2,
  %<locals( tmp1, tmp2,
    %<tmp1=%<fstat( %<file1> )>>\
    %<if( %<fexists( %<file2> )>,
      %<tmp2=%<fstat( %<file2> )>>\
      %<if( %[ %<tmp1{mtime}> > %<tmp2{mtime}> ], 1, 0 )>
    ,
      1
    )>
  )>
)>\
#endif