Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8429 → Rev 8430

/programs/other/TinyHashView/BUILD_KEX.SH
1,2 → 1,2
#SHS
/kolibrios/develop/tcc/tcc thashview.c -o thashview -lck -lcryptal
/kolibrios/develop/tcc/tcc thashview.c -o thashview -lck -lcryptal -ldialog
/programs/other/TinyHashView/Makefile
7,7 → 7,7
 
SRC=thashview.c
CFLAGS=-I $(KTCC_DIR)/libc/include
LIBS = -lck -lcryptal
LIBS = -lck -lcryptal -ldialog
 
all:
$(KTCC) $(CFLAGS) $(SRC) $(LIBS) -o $(NAME)
/programs/other/TinyHashView/thashview.c
1,5 → 1,7
/*€¢â®à: ‹®£ ¥¢ Œ ªá¨¬(turbocat2001) */
/* Copyright (C) 2019-2020 Logaev Maxim (turbocat2001), GPLv3 */
 
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <kos32sys1.h>
#include <string.h>
7,14 → 9,14
#include <cryptal/md5.h>
#include <cryptal/sha1.h>
#include <cryptal/sha256.h>
#include <clayer/dialog.h>
 
#define TRUE 1;
#define FALSE 0;
#define MAX_HASH_LEN 65 // Œ ªá¨¬ «ì­ ï ¤«¨­  áâப¨
#define WINDOW_W 665
#define VERSION "%s - thashview 2.4"
#define VERSION "%s - thashview 2.5"
 
typedef unsigned char bool;
struct kolibri_system_colors sys_color_table;
 
char hex[]={"abcdefABCDEF1234567890"}; //„«ï ¯à®¢¥àª¨ ¢¢®¤¨¬ëå ᨬ¢®«®¢
34,7 → 36,6
GREY = 0x00DDD7CF
};
 
 
unsigned int str_pos=0; // ®§¨æ¨ï ªãàá®à  ¯à¨ ¯¥ç â¨ ¢ áâப¥ ¢¢®¤ 
int md5_flag=0, sha1_flag=0, sha256_flag=0; // ”« £¨ ¯®ª §ë¢ î騥 ¡ë«  «¨ 㦥 à ááç¨â ­  ª®â஫쭠ï á㬬  ¢ ä㭪樨 check_sum()
int edit_box_text_color=BLACK; // ˆ§­ ç «ì­ë© 梥â ⥪áâ  ¢ áâப¥ ¢¢®¤ 
168,8 → 169,8
 
void redraw_window() //¨á㥬 ®ª­®
{
pos_t win_pos = get_mouse_pos(0); //®«ãç ¥¬ ¯®§¨æ¨î ªãàá®à  ¬ëè¨.
sprintf(title,VERSION, filename); // “áâ ­ ¢«¨¢ ¥¬ § £®«®¢®ª ®ª­ 
pos_t win_pos = get_mouse_pos(0); // ®«ãç ¥¬ ª®®à¤¨­ âë ªãàá®à 
begin_draw(); // ç¨­ ¥¬ à¨á®¢ ­¨¥ ¨­â¥àä¥©á  )
sys_create_window(win_pos.x, win_pos.y, WINDOW_W, 150, title, sys_color_table.work_area, 0x14); // ‘®§¤ ñ¬ ®ª­®.
 
213,7 → 214,7
{
temp_buff=kol_clip_get(kol_clip_num()-1);
memset(edit_box_buff,0,MAX_HASH_LEN);
if(((int)*(temp_buff)>0) && ((int)*(temp_buff+4)==0) && ((int)*(temp_buff+8)==1))
if(DATA(int, temp_buff,0)>0 && DATA(int,temp_buff,4)==TEXT && DATA(int,temp_buff,8)==CP866)
{
strncpy(edit_box_buff,temp_buff+12, MAX_HASH_LEN-1);
str_pos=strlen(edit_box_buff);
220,7 → 221,6
notify_show("'Pasted from clipboard!' -I");
edit_box_text_color=BLACK;
user_free(temp_buff);
}
}
}
232,8 → 232,8
{
char *temp_buffer=safe_malloc(MAX_HASH_LEN+12);
memset(temp_buffer, 0, MAX_HASH_LEN);
*(temp_buffer+4)=0;
*(temp_buffer+8)=1;
DATA(char,temp_buffer,4)=TEXT;
DATA(char,temp_buffer,8)=CP866;
strncpy(temp_buffer+12, text, MAX_HASH_LEN-1);
kol_clip_set(strlen(text)+12, temp_buffer);
notify_show("'Copied to clipboard!' -I");
325,15 → 325,29
 
int main(int argc, char** argv)
{
// ¯®«ãç ¥¬ ¨¬ï ä ©« 
if(argc<2) // …᫨  à£ã¬¥­â®¢ ­¥â â® á®®¡é ¥¬ ®¡ í⮬
if(argc<2) // …᫨  à£ã¬¥­â®¢ ­¥â, â® § ¯ã᪠¥¬ ¤¨ «®£ ¢ë¡®à  ä ©« 
{
kolibri_dialog_init(); // ˆ­¨æ¨ «¨§ æ¨ï ¡¨¡«¨®â¥ª¨
open_dialog* dialog = kolibri_new_open_dialog(OPEN,0, 0, 420, 320);
OpenDialog_init(dialog);
OpenDialog_start(dialog);
if(dialog->status==SUCCESS) // …᫨ ä ©« ¢ë¡à ­
{
global_var_init(strlen(dialog->openfile_path));
strcpy(filename, dialog->openfile_path);
}
else // …᫨ ä ©« ­¥ ¢ë¡à ­
{
notify_show("'No file selected!' -E");
exit(0);
}
 
free(dialog);
}
else
{
global_var_init(strlen(argv[1]));
strcpy(filename, argv[1]);
}
 
if(NULL==fopen(filename,"rb")) // …᫨ ä ©«  ­¥â ¨«¨ ­¥ ®âªà뢠¥âáï
{
346,7 → 360,7
notify_show("'Low screen resolution! Program will not display correctrly!' -W");
}
 
int gui_event; // ¥à¥¬­ ï ¤«ï åà ­¥­¨ï ᮡëâ¨ï
int gui_event; // ¥à¥¬¥­­ ï ¤«ï åà ­¥­¨ï ᮡëâ¨ï
uint32_t pressed_button = 0; // Š®¤ ­ ¦ â®© ª­®¯ª¨ ¢ ®ª­¥
 
get_system_colors(&sys_color_table);
427,4 → 441,5
}
}
}while(1);
exit(0);
}