00001 #ifndef mbl_read_str_h_ 00002 #define mbl_read_str_h_ 00003 //: 00004 // \file 00005 // \brief Asks question and waits for an answer. 00006 // \author Tim 00007 // \date Based on code written 7-May-92 00008 // 00009 // \verbatim 00010 // Modifications 00011 // Converted to vxl by gvw, soblamemewhydontcha! 00012 // 1.1 Tim New version 4-Nov-98 00013 // \endverbatim 00014 00015 //: Asks question and waits for an answer from standard input. 00016 // If the answer is a non-empty string, returns it. 00017 // If the answer is an empty vcl_string (return) 00018 // then returns default. 00019 // \param reply Space for reply 00020 // \param max_str_len Length of space for reply 00021 // \param q_str A question 00022 // \param default_str Default answer 00023 // \return reply: The answer or a default 00024 // 00025 // Example: 00026 // a) 00027 // \code 00028 // const int N_max_len = 20; 00029 // char* Name[N_max_len]; 00030 // mbl_read_str(Name,N_max_len,"Enter Name","Fred"); 00031 // \endcode 00032 // 00033 // b) If default_str = current reply, then reply 00034 // is only overwritten if a different 00035 // vcl_string given. 00036 // 00037 // \code 00038 // const int N_max_len = 20; 00039 // char* Name[N_max_len]; 00040 // strcpy(Name,"Freddy"); 00041 // mbl_read_str(Name,N_max_len,"Enter Name",Name); 00042 // \endcode 00043 00044 char* mbl_read_str(char *reply, int max_str_len, 00045 const char *q_str, const char *default_str); 00046 00047 #endif // mbl_read_str_h_