From 0629a976ae0dbcb1e48d4d3b6a820ce95bf16e91 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 19 May 2014 16:49:59 +0100 Subject: Fix line endings. --- atari/clipboard.c | 130 +++++++++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 65 deletions(-) (limited to 'atari/clipboard.c') diff --git a/atari/clipboard.c b/atari/clipboard.c index 254579bba..8c8f71781 100644 --- a/atari/clipboard.c +++ b/atari/clipboard.c @@ -20,69 +20,69 @@ * * */ - -#include -#include -#include -#include -#include -#include -#include "atari/clipboard.h" -#include "atari/gemtk/gemtk.h" - - -static int filesize(char * path) -{ - FILE *f; - int fs; - - f = fopen( path, "r+b"); - if(!f) - return(-1); - - fseek(f, 0L, SEEK_END); - fs = ftell(f); - fclose(f); - - return(fs); -} - -int scrap_txt_write(char *str) -{ - scrap_wtxt(str); - - - // Send SC_CHANGED message: - gemtk_send_msg(SC_CHANGED, 0, 2, 0, 0, 0, 0); - - return(0); - -} -char *scrap_txt_read(void) -{ - char * buf = NULL; - char path[80]; - int file; - int len; - - if (get_scrapdir (path)) - { - strcat (path, "scrap.txt"); - len = filesize(path); - if(len > 0){ - if ((file = (int) Fopen (path, 0)) >= 0) - { - buf = malloc(len); - if(buf){ - len = Fread (file, len, buf); - Fclose (file); - buf[len] = '\0'; - return buf; - } - } - } - } - -} - +#include +#include +#include +#include +#include +#include +#include "atari/clipboard.h" +#include "atari/gemtk/gemtk.h" + + +static int filesize(char * path) +{ + FILE *f; + int fs; + + f = fopen( path, "r+b"); + if(!f) + return(-1); + + fseek(f, 0L, SEEK_END); + fs = ftell(f); + fclose(f); + + return(fs); +} + +int scrap_txt_write(char *str) +{ + scrap_wtxt(str); + + + // Send SC_CHANGED message: + gemtk_send_msg(SC_CHANGED, 0, 2, 0, 0, 0, 0); + + return(0); + +} + +char *scrap_txt_read(void) +{ + char * buf = NULL; + char path[80]; + int file; + int len; + + if (get_scrapdir (path)) + { + strcat (path, "scrap.txt"); + len = filesize(path); + if(len > 0){ + if ((file = (int) Fopen (path, 0)) >= 0) + { + buf = malloc(len); + if(buf){ + len = Fread (file, len, buf); + Fclose (file); + buf[len] = '\0'; + return buf; + } + } + } + } + +} + -- cgit v1.2.3