Main Page   Modules   Data Structures   File List   Data Fields   Globals  

user_interaction.h

Go to the documentation of this file.
00001 /*
00002  * user_interaction.h
00003  * Created on 13 Feb 2005
00004  * Authors:
00005  *    Wesley Leggette <wleggette@kaylix.net>
00006  * 
00007  * 
00008  * 
00009  * libdarc
00010  * 
00011  * 
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  * 
00026  * $Id: user__interaction_8h-source.html 708 2005-03-21 12:30:37Z leggwes $
00027  */
00028  
00035 #ifndef USER_INTERACTION_H
00036 #define USER_INTERACTION_H
00037 
00038 #include "translations.h"
00039 
00040 NAMESPACE_LIBDAR_START
00041 
00042 #ifdef __cplusplus
00043 extern "C"
00044 {
00045 #endif
00046 
00079     /* CALLBACK TYPEDEFS */
00080 
00094     typedef void* (*dar_warning_callback)(char* msg, void* context);
00111     typedef bool (*dar_answer_callback)(char* msg, void* context);
00132     typedef char* (*dar_string_callback)(char* msg, bool echo, void* context);
00133     
00225     typedef void* (*dar_listing_callback)(  char* flag,
00226                                             char* perm,
00227                                             char* uid,
00228                                             char* gid,
00229                                             char* size,
00230                                             char* date,
00231                                             char* filename,
00232                                             bool is_dir,
00233                                             bool has_children,
00234                                             void* context
00235                                          );
00236                 
00237     /* STORAGE STRUCT */
00238     
00249     typedef struct  /* dar_user_interaction_struct */
00250     {
00251         /* mandatory callbacks */
00252         dar_warning_callback warning; 
00253         dar_answer_callback answer;     
00254         dar_string_callback string; 
00256         /* optional callback, set to NULL to not use it */
00257         dar_listing_callback listing; 
00259         intptr_t     : __WORDSIZE;      /* reserved for future use (funcs)  */
00260         intptr_t     : __WORDSIZE;      /* reserved for future use (funcs)  */
00261         
00262         /* general interaction preferences */
00266         bool verbose : 1;
00267         
00268         intptr_t     : 31;              /* reserved for future use (flags)  */
00269         
00275         void* context;
00276         
00277     } dar_user_interaction_struct; /* assert sizeof() == (32) 32, (64) 60 */
00278     
00280     DLLIMPORT bool dar_user_interaction_struct_is_valid(dar_user_interaction_struct obj);
00281     
00287 #ifdef __cplusplus
00288 }
00289 #endif
00290 
00291 
00292  
00293  
00294 NAMESPACE_LIBDAR_END
00295  
00296  
00297  
00298  
00299 #endif /* end of USER_INTERACTION_H */
00300  
00301  
00302  
00303  
00304