JWS-112 Bumping version of T-Coffee to version 11.00.8cbe486.
[jabaws.git] / binaries / src / tcoffee / t_coffee_source / km_coffee / km_util.h
1 /******************************COPYRIGHT NOTICE*******************************/
2 /*  (c) Centro de Regulacio Genomica                                                        */
3 /*  and                                                                                     */
4 /*  Cedric Notredame                                                                        */
5 /*  12 Aug 2014 - 22:07.                                                                    */
6 /*All rights reserved.                                                                      */
7 /*This file is part of T-COFFEE.                                                            */
8 /*                                                                                          */
9 /*    T-COFFEE is free software; you can redistribute it and/or modify                      */
10 /*    it under the terms of the GNU General Public License as published by                  */
11 /*    the Free Software Foundation; either version 2 of the License, or                     */
12 /*    (at your option) any later version.                                                   */
13 /*                                                                                          */
14 /*    T-COFFEE is distributed in the hope that it will be useful,                           */
15 /*    but WITHOUT ANY WARRANTY; without even the implied warranty of                        */
16 /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                         */
17 /*    GNU General Public License for more details.                                          */
18 /*                                                                                          */
19 /*    You should have received a copy of the GNU General Public License                     */
20 /*    along with Foobar; if not, write to the Free Software                                 */
21 /*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA             */
22 /*...............................................                                           */
23 /*  If you need some more information                                                       */
24 /*  cedric.notredame@europe.com                                                             */
25 /*...............................................                                           */
26 /******************************COPYRIGHT NOTICE*******************************/
27 #ifndef KM_UTIL_H_
28 #define KM_UTIL_H_
29
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #include <errno.h>
34 #include <unistd.h>
35 #include <signal.h>
36
37
38 /**
39  * \brief Wrapper for fopen.
40  *
41  * \param name_f The name of the file to open.
42  * \param mode The mode in which to open the file
43  * \return The opend File. On failure an error message is printed and the program exits.
44  */
45 FILE *
46 my_fopen(char *name_f, char *mode);
47
48 /**
49  * \brief Wrapper for the malloc function.
50  * \param size The size of the memory block to allocate
51  * \return Pointer to the newly allocated block of memory. On failure an error message is printed and the program exits.
52  */
53 void *
54 my_malloc(size_t size);
55
56 /**
57 * \brief Wrapper for the realloc function.
58 * \param size The size of the memory block to allocate
59 * \return Pointer to the newly allocated block of memory. On failure an error message is printed and the program exits.
60 */
61 void *
62 my_realloc(void *p, size_t size);
63
64 /**
65 * \brief Wrapper for the calloc function.
66 * \param size The size of the memory block to allocate
67 * \return Pointer to the newly allocated block of memory. On failure an error message is printed and the program exits.
68 */
69 void *
70 my_calloc ( size_t num, size_t size );
71
72 /**
73  * \brief Makes a temporary file.
74  *
75  * In case of failure, the program exits.
76  * \param templatee The template to used for making the temporary file.
77  * \param function The function from where this was called (For error message)
78  */
79 char *
80 my_make_temp_dir(char *templatee, char *function);
81
82
83
84
85
86 #endif
87