summaryrefslogtreecommitdiff
path: root/portland/dapi/tests/test_screensaving.c
blob: 2224eebe5ae89445fc704725a61c8d40a5b04f22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <unistd.h>

#include <dapi/comm.h>
#include <dapi/calls.h>

int main()
    {
    int ok;
    DapiConnection* conn = dapi_connectAndInit();
    if( conn == NULL )
        {
        fprintf( stderr, "Cannot connect!\n" );
        return 1;
        }
    ok = dapi_SuspendScreensaving( conn, 1 );
    printf( "Result1: %s\n", ok == 1 ? "Ok" : "Failed" );
    sleep( 10 );
    ok = dapi_SuspendScreensaving( conn, 0 );
    printf( "Result2: %s\n", ok == 1 ? "Ok" : "Failed" );
    dapi_close( conn );
    return 0;
    }