diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-05-19 16:49:59 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-05-19 16:49:59 +0100 |
commit | 0629a976ae0dbcb1e48d4d3b6a820ce95bf16e91 (patch) | |
tree | b5af1b69eacb5f3b6750b2060e70138ba5d7a414 /atari | |
parent | 1d73b947e9914fa48c5dfbfcaf811194d64d3f85 (diff) | |
download | netsurf-0629a976ae0dbcb1e48d4d3b6a820ce95bf16e91.tar.gz netsurf-0629a976ae0dbcb1e48d4d3b6a820ce95bf16e91.tar.bz2 |
Fix line endings.
Diffstat (limited to 'atari')
-rw-r--r-- | atari/clipboard.c | 130 |
1 files changed, 65 insertions, 65 deletions
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 <stdlib.h> -#include <stdint.h> -#include <string.h> -#include <stdio.h> -#include <mint/osbind.h> -#include <cflib.h> -#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 <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <stdio.h>
+#include <mint/osbind.h>
+#include <cflib.h>
+#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;
+ }
+ }
+ }
+ }
+
+}
+
|