Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7941 → Rev 7942

/programs/develop/backy/Backy
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/develop/backy/Backy-lib.h
1,37 → 1,45
 
/*
* Backy_lib.h
* Author: JohnXenox aka Aleksandr Igorevich.
*/
 
#ifndef __jxl_Date_get_h__
#define __jxl_Date_get_h__
 
#include <stdint.h>
#ifdef ___TINY_C___
 
static inline uint32_t getDate(void)
{
uint32_t date;
__asm__ __volatile__("int $0x40":"=a"(date):"a"(29));
return date;
}
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long long uint64_t;
typedef char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef long long int64_t;
 
 
 
static inline uint32_t getTime(void)
static inline int32_t saveFile(uint32_t nbytes, uint8_t *data, uint32_t enc, uint8_t *path)
{
uint32_t time;
__asm__ __volatile__("int $0x40":"=a"(time):"a"(3));
return time;
}
int32_t val;
 
uint8_t dt[28]; // basic information structure.
 
(uint32_t) dt[0] = 2; // subfunction number.
(uint32_t) dt[4] = 0; // reserved.
(uint32_t) dt[8] = 0; // reserved.
(uint32_t) dt[12] = nbytes; // number of bytes to write.
(uint8_t *) dt[16] = data; // pointer to data.
(uint32_t) dt[20] = enc; // string encoding (0 = default, 1 = cp866, 2 = UTF-16LE, 3 = UTF-8).
(uint8_t *) dt[24] = path; // pointer to path.
 
static inline void *openFile(uint32_t *length, const uint8_t *path)
{
uint8_t *fd;
__asm__ __volatile__("int $0x40":"=a"(val):"a"(80), "b"(&dt));
 
__asm__ __volatile__ ("int $0x40":"=a"(fd), "=d"(*length):"a" (68), "b"(27),"c"(path));
 
return fd;
return val;
}
 
#else
 
#include <stdint.h>
 
static inline int32_t saveFile(uint32_t nbytes, uint8_t *data, uint32_t enc, uint8_t *path)
{
64,5 → 72,33
return val;
}
 
#endif
 
static inline uint32_t getDate(void)
{
uint32_t date;
__asm__ __volatile__("int $0x40":"=a"(date):"a"(29));
return date;
}
 
 
 
static inline uint32_t getTime(void)
{
uint32_t time;
__asm__ __volatile__("int $0x40":"=a"(time):"a"(3));
return time;
}
 
 
 
static inline void *openFile(uint32_t *length, const uint8_t *path)
{
uint8_t *fd;
 
__asm__ __volatile__ ("int $0x40":"=a"(fd), "=d"(*length):"a" (68), "b"(27),"c"(path));
 
return fd;
}
 
#endif
/programs/develop/backy/Backy.c
1,14 → 1,17
 
/*
Author: JohnXenox.
Description: The program for backing up a file.
 
Works from command line, only!
* Author: JohnXenox aka Aleksandr Igorevich.
*
* Programme name: Backy
* Description: The programme for backing up a file.
*
* Works from command line, only!
*/
 
#define CREATION_DATE "2020.05.07"
#define CREATION_DATE "2020.05.17"
 
#include <stdio.h>
#include <conio.h>
//#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
144,10 → 147,14
else
{
//con_init_console_dll_param(-1, 23, -1, 23, "Backy");
if (con_init_console_dll()) return 1; // init fail
 
printf("Useful info!");
 
printf("\n Name: Backy");
printf("\n Date: %s", CREATION_DATE);
printf("\n Description: The programme for backing up a file.\n");
 
printf("\n Author: JohnXenox\n");
 
printf("\n Usage: backy <path1> <-o path2>\n");
212,7 → 219,7
}
 
 
itoa(*dta, num, 16);
itoab(*dta, num, 16);
 
if (num[1] == 0)
{
254,7 → 261,7
if (i == 2)
dta = &seconds;
 
itoa(*dta, num, 16);
itoab(*dta, num, 16);
 
if (num[1] == 0)
{
/programs/develop/backy/Backy.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/develop/backy/History.txt
0,0 → 1,16
History:
 
Backy 2020.05.17
Code optimization.
 
Backy 2020.05.05
Changed an output file name.
 
Backy 2020.04.27
First release.
 
 
 
 
 
 
/programs/develop/backy/Readme-en.txt
0,0 → 1,22
Backy (release date 2020.05.17)
 
Backy is a programme for backing up a file.
 
Usage: backy <path1> <-o path2>
path1 - path to a file to be backuped.
-o path2 - path to the output directory without the name of a file.
 
Examples:
backy test.c
backy test.c -o /tmp0/1/
backy /hd0/1/test.c
backy /hd0/1/test.c -o /tmp0/1/
 
//--------------------------------------//
The programme:
- Compiled with KTCC compiler.
- Written in KolibriOS NB svn7768.
- Designed and written by JohnXenox
aka Aleksandr Igorevich.
//--------------------------------------//
 
/programs/develop/backy/Readme-ru.txt
0,0 → 1,21
Backy (дата выпуска 2020.05.17)
 
Backy - это программа для создания резервной копии файла.
 
Использование: backy <path1> <-o path2>
path1 - путь к файлу, который надо скопировать.
-o path2 - путь к директории, в которую будет скопирована резервная копия файла.
 
Примеры:
backy test.c
backy test.c -o /tmp0/1/
backy /hd0/1/test.c
backy /hd0/1/test.c -o /tmp0/1/
 
//--------------------------------------//
The programme:
- Compiled with KTCC compiler.
- Written in KolibriOS NB svn7768.
- Designed and written by JohnXenox
aka Aleksandr Igorevich.
//--------------------------------------//