FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
wait_special.c
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 2 as published by the Free Software Foundation.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16  *********************************************************************/
17 
18 /* fossology includes */
19 #include <libfossology.h>
20 
22 #define MINUTES_TO_WAIT 1
23 
38 int main(int argc, char** argv)
39 {
40  int i;
41 
42  fo_scheduler_connect(&argc, argv, NULL);
43  fo_scheduler_set_special(SPECIAL_NOKILL, 1);
44 
45  for(i = 0; i < MINUTES_TO_WAIT; i++)
46  sleep(60);
47 
48  fo_scheduler_set_special(SPECIAL_NOKILL, 0);
49 
50  for(i = 0; i < MINUTES_TO_WAIT; i++)
51  sleep(60);
52 
55 
56  return 0;
57 }
58 
59 
60 
61 
void fo_scheduler_disconnect(int retcode)
Disconnect the scheduler connection.
void fo_scheduler_connect(int *argc, char **argv, PGconn **db_conn)
Establish a connection between an agent and the scheduler.
void fo_scheduler_set_special(int option, int value)
Sets something special about the agent within the scheduler.
The main FOSSology C library.
char * fo_scheduler_next()
Get the next data to process from the scheduler.
#define MINUTES_TO_WAIT
the number of minutes to wait before closing
Definition: wait_special.c:22