#include "cgui_p.h"
#include "i18n_l.h"
#include <gwenhywfar/gui_be.h>
#include <gwenhywfar/inherit.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/gwentime.h>
#include <gwenhywfar/mdigest.h>
#include <gwenhywfar/text.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
Go to the source code of this file.
Defines | |
#define | ICONV_CONST |
Functions | |
int | GWEN_Gui_CGui__ConvertFromUtf8 (GWEN_GUI *gui, const char *text, int len, GWEN_BUFFER *tbuf) |
GWEN_GUI_CPROGRESS * | GWEN_Gui_CGui__findProgress (GWEN_GUI *gui, uint32_t id) |
int | GWEN_Gui_CGui__HashPair (const char *token, const char *pin, GWEN_BUFFER *buf) |
int | GWEN_Gui_CGui__input (GWEN_GUI *gui, uint32_t flags, char *buffer, int minLen, int maxLen, uint32_t guiid) |
char | GWEN_Gui_CGui__readCharFromStdin (int waitFor) |
int | GWEN_Gui_CGui_CheckCert (GWEN_GUI *gui, const GWEN_SSLCERTDESCR *cd, GWEN_IO_LAYER *io, uint32_t guiid) |
void GWENHYWFAR_CB | GWEN_Gui_CGui_FreeData (void *bp, void *p) |
const char * | GWEN_Gui_CGui_GetCharSet (const GWEN_GUI *gui) |
int | GWEN_Gui_CGui_GetIsNonInteractive (const GWEN_GUI *gui) |
int | GWEN_Gui_CGui_GetPassword (GWEN_GUI *gui, uint32_t flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid) |
void | GWEN_Gui_CGui_GetRawText (GWEN_GUI *gui, const char *text, GWEN_BUFFER *tbuf) |
void | GWEN_Gui_CGui_HideBox (GWEN_GUI *gui, uint32_t id) |
int | GWEN_Gui_CGui_InputBox (GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid) |
int | GWEN_Gui_CGui_MessageBox (GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3, uint32_t guiid) |
GWEN_GUI * | GWEN_Gui_CGui_new () |
int | GWEN_Gui_CGui_Print (GWEN_GUI *gui, const char *docTitle, const char *docType, const char *descr, const char *text, uint32_t guiid) |
int | GWEN_Gui_CGui_ProgressAdvance (GWEN_GUI *gui, uint32_t id, uint64_t progress) |
int | GWEN_Gui_CGui_ProgressEnd (GWEN_GUI *gui, uint32_t id) |
int | GWEN_Gui_CGui_ProgressLog (GWEN_GUI *gui, uint32_t id, GWEN_LOGGER_LEVEL level, const char *text) |
uint32_t | GWEN_Gui_CGui_ProgressStart (GWEN_GUI *gui, uint32_t progressFlags, const char *title, const char *text, uint64_t total, uint32_t guiid) |
void | GWEN_Gui_CGui_SetCertDb (GWEN_GUI *gui, GWEN_DB_NODE *dbCerts) |
void | GWEN_Gui_CGui_SetCharSet (GWEN_GUI *gui, const char *s) |
void | GWEN_Gui_CGui_SetIsNonInteractive (GWEN_GUI *gui, int i) |
void | GWEN_Gui_CGui_SetPasswordDb (GWEN_GUI *gui, GWEN_DB_NODE *dbPasswords, int persistent) |
int | GWEN_Gui_CGui_SetPasswordStatus (GWEN_GUI *gui, const char *token, const char *pin, GWEN_GUI_PASSWORD_STATUS status, uint32_t guiid) |
uint32_t | GWEN_Gui_CGui_ShowBox (GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, uint32_t guiid) |
#define ICONV_CONST |
int GWEN_Gui_CGui__ConvertFromUtf8 | ( | GWEN_GUI * | gui, | |
const char * | text, | |||
int | len, | |||
GWEN_BUFFER * | tbuf | |||
) |
Definition at line 172 of file cgui.c.
References DBG_DEBUG, DBG_ERROR, DBG_INFO, GWEN_Buffer_AppendBytes(), GWEN_ERROR_GENERIC, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and ICONV_CONST.
Referenced by GWEN_Gui_CGui_GetRawText().
GWEN_GUI_CPROGRESS* GWEN_Gui_CGui__findProgress | ( | GWEN_GUI * | gui, | |
uint32_t | id | |||
) |
Definition at line 686 of file cgui.c.
References GWEN_Gui_CProgress_GetId(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_ProgressAdvance(), GWEN_Gui_CGui_ProgressEnd(), and GWEN_Gui_CGui_ProgressLog().
int GWEN_Gui_CGui__HashPair | ( | const char * | token, | |
const char * | pin, | |||
GWEN_BUFFER * | buf | |||
) |
Definition at line 789 of file cgui.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_MDigest_Begin(), GWEN_MDigest_End(), GWEN_MDigest_free(), GWEN_MDigest_GetDigestPtr(), GWEN_MDigest_GetDigestSize(), GWEN_MDigest_Md5_new(), GWEN_MDigest_Update(), and GWEN_Text_ToHexBuffer().
Referenced by GWEN_Gui_CGui_CheckCert(), GWEN_Gui_CGui_GetPassword(), and GWEN_Gui_CGui_SetPasswordStatus().
int GWEN_Gui_CGui__input | ( | GWEN_GUI * | gui, | |
uint32_t | flags, | |||
char * | buffer, | |||
int | minLen, | |||
int | maxLen, | |||
uint32_t | guiid | |||
) |
Definition at line 346 of file cgui.c.
References DBG_INFO, GWEN_ERROR_DEFAULT_VALUE, GWEN_ERROR_USER_ABORTED, GWEN_GUI_INPUT_FLAGS_ALLOW_DEFAULT, GWEN_GUI_INPUT_FLAGS_NUMERIC, GWEN_GUI_INPUT_FLAGS_SHOW, GWEN_Gui_MessageBox(), GWEN_GUI_MSG_FLAGS_CONFIRM_B1, GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS, GWEN_GUI_MSG_FLAGS_TYPE_INFO, GWEN_LOGDOMAIN, and I18N.
Referenced by GWEN_Gui_CGui_InputBox().
char GWEN_Gui_CGui__readCharFromStdin | ( | int | waitFor | ) |
int GWEN_Gui_CGui_CheckCert | ( | GWEN_GUI * | gui, | |
const GWEN_SSLCERTDESCR * | cd, | |||
GWEN_IO_LAYER * | io, | |||
uint32_t | guiid | |||
) |
Definition at line 820 of file cgui.c.
References DBG_NOTICE, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_GetIntValue(), GWEN_DB_SetIntValue(), GWEN_ERROR_NOT_SUPPORTED, GWEN_ERROR_USER_ABORTED, GWEN_Gui_CGui__HashPair(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SslCertDescr_GetFingerPrint(), and GWEN_SslCertDescr_GetStatusText().
Referenced by GWEN_Gui_CGui_new().
void GWENHYWFAR_CB GWEN_Gui_CGui_FreeData | ( | void * | bp, | |
void * | p | |||
) |
Definition at line 106 of file cgui.c.
References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, and GWEN_StringList_free().
Referenced by GWEN_Gui_CGui_new().
const char* GWEN_Gui_CGui_GetCharSet | ( | const GWEN_GUI * | gui | ) |
int GWEN_Gui_CGui_GetIsNonInteractive | ( | const GWEN_GUI * | gui | ) |
Definition at line 148 of file cgui.c.
References GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CProgress_Advance(), GWEN_Gui_CProgress_End(), and GWEN_Gui_CProgress_Log().
int GWEN_Gui_CGui_GetPassword | ( | GWEN_GUI * | gui, | |
uint32_t | flags, | |||
const char * | token, | |||
const char * | title, | |||
const char * | text, | |||
char * | buffer, | |||
int | minLen, | |||
int | maxLen, | |||
uint32_t | guiid | |||
) |
Definition at line 912 of file cgui.c.
References DBG_ERROR, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_GetCharValue(), GWEN_DB_SetCharValue(), GWEN_ERROR_USER_ABORTED, GWEN_Gui_CGui__HashPair(), GWEN_GUI_INPUT_FLAGS_TAN, GWEN_Gui_InputBox(), GWEN_Gui_MessageBox(), GWEN_GUI_MSG_FLAGS_CONFIRM_B1, GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS, GWEN_GUI_MSG_FLAGS_TYPE_ERROR, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_StringList_HasString(), GWEN_StringList_RemoveString(), GWEN_Text_EscapeToBufferTolerant(), I18N, and NULL.
Referenced by GWEN_Gui_CGui_new().
void GWEN_Gui_CGui_GetRawText | ( | GWEN_GUI * | gui, | |
const char * | text, | |||
GWEN_BUFFER * | tbuf | |||
) |
Definition at line 247 of file cgui.c.
References DBG_ERROR, GWEN_Buffer_AppendBytes(), GWEN_Buffer_AppendString(), GWEN_Buffer_Reset(), GWEN_Gui_CGui__ConvertFromUtf8(), and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_InputBox(), GWEN_Gui_CGui_MessageBox(), GWEN_Gui_CGui_ShowBox(), and GWEN_Gui_CProgress_Log().
void GWEN_Gui_CGui_HideBox | ( | GWEN_GUI * | gui, | |
uint32_t | id | |||
) |
Definition at line 649 of file cgui.c.
References GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_InputBox | ( | GWEN_GUI * | gui, | |
uint32_t | flags, | |||
const char * | title, | |||
const char * | text, | |||
char * | buffer, | |||
int | minLen, | |||
int | maxLen, | |||
uint32_t | guiid | |||
) |
Definition at line 561 of file cgui.c.
References DBG_ERROR, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_ERROR_INVALID, GWEN_Gui_CGui__input(), GWEN_Gui_CGui_GetRawText(), GWEN_GUI_INPUT_FLAGS_CONFIRM, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_MessageBox | ( | GWEN_GUI * | gui, | |
uint32_t | flags, | |||
const char * | title, | |||
const char * | text, | |||
const char * | b1, | |||
const char * | b2, | |||
const char * | b3, | |||
uint32_t | guiid | |||
) |
Definition at line 479 of file cgui.c.
References DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_ERROR_USER_ABORTED, GWEN_Gui_CGui__readCharFromStdin(), GWEN_Gui_CGui_GetRawText(), GWEN_GUI_MSG_FLAGS_CONFIRM_BUTTON, GWEN_GUI_MSG_FLAGS_SEVERITY_IS_DANGEROUS, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
GWEN_GUI* GWEN_Gui_CGui_new | ( | ) |
Definition at line 74 of file cgui.c.
References GWEN_DB_Group_new(), GWEN_Gui_CGui_CheckCert(), GWEN_Gui_CGui_FreeData(), GWEN_Gui_CGui_GetPassword(), GWEN_Gui_CGui_HideBox(), GWEN_Gui_CGui_InputBox(), GWEN_Gui_CGui_MessageBox(), GWEN_Gui_CGui_ProgressAdvance(), GWEN_Gui_CGui_ProgressEnd(), GWEN_Gui_CGui_ProgressLog(), GWEN_Gui_CGui_ProgressStart(), GWEN_Gui_CGui_SetPasswordStatus(), GWEN_Gui_CGui_ShowBox(), GWEN_Gui_new(), GWEN_Gui_SetCheckCertFn(), GWEN_Gui_SetGetPasswordFn(), GWEN_Gui_SetHideBoxFn(), GWEN_Gui_SetInputBoxFn(), GWEN_Gui_SetMessageBoxFn(), GWEN_Gui_SetProgressAdvanceFn(), GWEN_Gui_SetProgressEndFn(), GWEN_Gui_SetProgressLogFn(), GWEN_Gui_SetProgressStartFn(), GWEN_Gui_SetSetPasswordStatusFn(), GWEN_Gui_SetShowBoxFn(), GWEN_INHERIT_SETDATA, GWEN_NEW_OBJECT, and GWEN_StringList_new().
Referenced by test_gui().
int GWEN_Gui_CGui_Print | ( | GWEN_GUI * | gui, | |
const char * | docTitle, | |||
const char * | docType, | |||
const char * | descr, | |||
const char * | text, | |||
uint32_t | guiid | |||
) |
int GWEN_Gui_CGui_ProgressAdvance | ( | GWEN_GUI * | gui, | |
uint32_t | id, | |||
uint64_t | progress | |||
) |
Definition at line 708 of file cgui.c.
References DBG_DEBUG, GWEN_Gui_CGui__findProgress(), GWEN_Gui_CProgress_Advance(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_ProgressEnd | ( | GWEN_GUI * | gui, | |
uint32_t | id | |||
) |
Definition at line 753 of file cgui.c.
References DBG_DEBUG, GWEN_Gui_CGui__findProgress(), GWEN_Gui_CProgress_End(), GWEN_Gui_CProgress_free(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_ProgressLog | ( | GWEN_GUI * | gui, | |
uint32_t | id, | |||
GWEN_LOGGER_LEVEL | level, | |||
const char * | text | |||
) |
Definition at line 730 of file cgui.c.
References DBG_DEBUG, GWEN_Gui_CGui__findProgress(), GWEN_Gui_CProgress_Log(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
uint32_t GWEN_Gui_CGui_ProgressStart | ( | GWEN_GUI * | gui, | |
uint32_t | progressFlags, | |||
const char * | title, | |||
const char * | text, | |||
uint64_t | total, | |||
uint32_t | guiid | |||
) |
Definition at line 661 of file cgui.c.
References GWEN_Gui_CProgress_GetId(), GWEN_Gui_CProgress_new(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_new().
void GWEN_Gui_CGui_SetCertDb | ( | GWEN_GUI * | gui, | |
GWEN_DB_NODE * | dbCerts | |||
) |
Set the certificate DB. Takes over the given DB.
Definition at line 1048 of file cgui.c.
References GWEN_DB_Group_free(), and GWEN_INHERIT_GETDATA.
void GWEN_Gui_CGui_SetCharSet | ( | GWEN_GUI * | gui, | |
const char * | s | |||
) |
void GWEN_Gui_CGui_SetIsNonInteractive | ( | GWEN_GUI * | gui, | |
int | i | |||
) |
void GWEN_Gui_CGui_SetPasswordDb | ( | GWEN_GUI * | gui, | |
GWEN_DB_NODE * | dbPasswords, | |||
int | persistent | |||
) |
Set the password DB. Takes over the given DB.
Definition at line 1032 of file cgui.c.
References GWEN_DB_Group_free(), and GWEN_INHERIT_GETDATA.
int GWEN_Gui_CGui_SetPasswordStatus | ( | GWEN_GUI * | gui, | |
const char * | token, | |||
const char * | pin, | |||
GWEN_GUI_PASSWORD_STATUS | status, | |||
uint32_t | guiid | |||
) |
Definition at line 874 of file cgui.c.
References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_ClearGroup(), GWEN_Gui_CGui__HashPair(), GWEN_Gui_PasswordStatus_Bad, GWEN_Gui_PasswordStatus_Ok, GWEN_Gui_PasswordStatus_Remove, GWEN_INHERIT_GETDATA, GWEN_StringList_AppendString(), GWEN_StringList_RemoveString(), and NULL.
Referenced by GWEN_Gui_CGui_new().
uint32_t GWEN_Gui_CGui_ShowBox | ( | GWEN_GUI * | gui, | |
uint32_t | flags, | |||
const char * | title, | |||
const char * | text, | |||
uint32_t | guiid | |||
) |
Definition at line 624 of file cgui.c.
References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Gui_CGui_GetRawText(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_new().