Debian Codegraph @

doc/tutorial/functions.stp

raw
1 # Red Hat convention; see /etc/login.defs UID_MIN
2 function system_uid_p (u) { return u < 500 }
3
4 # kernel device number assembly macro
5 function makedev (major,minor) { return major << 20 | minor }
6
7 function trace_common ()
8 {
9 printf("%d %s(%d)", gettimeofday_s(), execname(), pid())
10 # no return value
11 }
12
13 function fibonacci (i)
14 {
15 if (i < 1) return 0
16 else if (i < 2) return 1
17 else return fibonacci(i-1) + fibonacci(i-2)
18 }