include/liqapp.h

00001 /* liqbase
00002  * Copyright (C) 2008 Gary Birkett
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2
00006  * as published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00016  */
00017 
00018 /*
00019  *
00020  * Header for app level helper functions
00021  *
00022  */
00023 
00024 
00025 
00026 
00027 #ifndef liqapp_H
00028 #define liqapp_H
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 #include <stdio.h>
00035 #include <dirent.h>
00036 
00037 
00038 //#######################################################
00039 
00040 typedef struct 
00041 {
00042         // technically this is a session
00043         char *  title;
00044         int     argc;
00045         char *  *argv;
00046         int     infologgingenabled;
00047         char    *version;
00048         void *  tag;
00049 } liqapp;
00050 
00051 //#######################################################
00052 
00053 extern liqapp app;
00054 
00055 //#######################################################
00056 unsigned long liqapp_GetTicks();
00057 int             liqapp_init(int argc, char* argv[],char *title,char *version);
00058 int             liqapp_log(char *logentry, ...);
00059 int             liqapp_errorandfail(int returnstatus,char *logentry);
00060 int             liqapp_warnandcontinue(int returnstatus,char *logentry);
00061 int             liqapp_close();
00062 
00063 
00064 char *          liqapp_gettitle();
00065 
00066 
00067 float           liqapp_fps(unsigned long ts,unsigned long te,unsigned long framecount);
00068 int             liqapp_getopt_find(char *optname);
00069 int             liqapp_getopt_exist(char *optname);
00070 int             liqapp_getopt_hasarg(char *optname);
00071 char *          liqapp_getopt_str(char *optname,char *def);
00072 int             liqapp_getopt_int(char *optname,int def);
00073 int             liqapp_sleep(unsigned long millisec);
00074 
00075 int             liqapp_formatnow(char *buffer,int buffersize,char *format);
00076 char *          liqapp_format_strftime(char *buffer,int buffersize,char *strftime_fmt);
00077 
00078 
00079 
00080 int             liqapp_pathexists(char *pathname);
00081 int             liqapp_fileexists(char *filename);
00082 int         liqapp_filesize(char *filename);
00083 char *          liqapp_filename_walkoverpath(char *filename);
00084 char *          liqapp_filename_walktoextension(char *filename);
00085 int             liqapp_file_copy (char * from, char * to, int allowoverwrite);
00086 
00087 
00088 int         liqapp_url_wget(char *url,char *resultfilename,int resultbufsize);
00089 
00090 //#######################################################
00091 
00092 void            liqapp_turbo_start();
00093 void            liqapp_turbo_reset();
00094 
00095 
00096 
00097 // had to exist somewhere
00098 char *stristr(const char *String, const char *Pattern);
00099 
00100 //#######################################################
00101 
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105 
00106 #endif
00107 
00108 
00109 
00110 
00111 

Generated on Sat May 23 23:03:13 2009 for libliqbase by  doxygen 1.5.1