/* ** get prompted - various situations: ** HT_A_PROMPT = 0x4<<16, * Want full dialog * ** HT_A_SECRET = 0x8<<16, * Secret dialog (e.g. password) * ** HT_A_USER_PW = 0x10<<16 * Atomic userid and password * */ BOOL HTAlertCallback_prompt( HTRequest *request, HTAlertOpcode op, int msgnum, const char *dfault, void *input, HTAlertPar *reply ) { Com_Printf(_( "Aborting, libwww prompt message id: %d (prompted for a login/password?)\n"), msgnum ); HTEventList_stopLoop(); return NO; }
PRIVATE int terminate_handler (HTRequest * request, HTResponse * response, void * param, int status) { HTParentAnchor * anchor = HTRequest_anchor(request); HTAssocList * headers = HTAnchor_header(anchor); /* ** Write out the remaining list of headers that we not already store ** in the index file. */ if (headers) { HTAssocList * cur = headers; HTAssoc * pres; while ((pres = (HTAssoc *) HTAssocList_nextObject(cur))) { char * name = HTAssoc_name(pres); char * value = HTAssoc_value(pres); /* Now see if we have a match for this header field */ if (match && HTStrCaseMatch(match, name)) HTPrint("%s: %s\n", name, value); } } /* stop the event loop */ HTEventList_stopLoop (); /* stop here */ return HT_ERROR; }
/* ** We get called here from the event loop when we are done ** loading. Here we terminate the program as we have nothing ** better to do. */ int terminate_handler( HTRequest *request, HTResponse *response, void *param, int status ) { // (LoadToFile.c had HTRequest_delete and HTProfile_delete calls here) // the status param tells us about the download .. > 0 success <= 0 failure terminate_status = status; HTEventList_stopLoop(); return HT_OK; }
/* ** answer questions ** NOTE: tried to get those message from HTDialog, but that didn't work out? ** i.e. HTDialog_errorMessage */ BOOL HTAlertCallback_confirm( HTRequest *request, HTAlertOpcode op, int msgnum, const char *dfault, void *input, HTAlertPar *reply ) { // some predefined messages we know the answer to if ( msgnum == HT_MSG_FILE_REPLACE ) { Com_Printf(_( "Replace existing download target file\n" )); return YES; } // anything else, means we abort Com_Printf(_( "Aborting, unknown libwww confirm message id: %d\n"), msgnum ); HTEventList_stopLoop(); return NO; }