summaryrefslogtreecommitdiff
path: root/legacy/elementary/tests/test_getter.sh
blob: 749d488e1b596fb86f576926e59de56edab563fb (plain) (blame)
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
#!/bin/bash
ret=0
check(){
    func=$(echo $1 | grep -oe 'elm_\w\+')
    echo $1 | grep -qe "_get([^\(const \)]\([^,\*)]\)\+\*"
    if [ $? == 0 ];then
        echo -e "\e[31;1mNOT CONST\e[m\t $func"
        ret=1
    fi

}

HEADERS="src/lib/Elementary.h.in
src/lib/Elementary_Cursor.h
src/lib/elm_widget.h"

IFS=$'\n'

for header in $HEADERS; do
    grep -e "^ *EAPI.*(.*)" $header | grep -e 'elm_\w\+_get' >eapi.list

    for i in $(cat eapi.list); do
        check $i $header
    done
    rm eapi.list
done
exit $ret