]> pd.if.org Git - pd_readline/commitdiff
Added the UNLICENSE.
authorandy <andy@obsidian.(none)>
Wed, 5 Sep 2012 08:48:46 +0000 (20:48 +1200)
committerandy <andy@obsidian.(none)>
Wed, 5 Sep 2012 08:48:46 +0000 (20:48 +1200)
UNLICENSE [new file with mode: 0644]
pd_readline.c
readfile.c [deleted file]

diff --git a/UNLICENSE b/UNLICENSE
new file mode 100644 (file)
index 0000000..0c9608e
--- /dev/null
+++ b/UNLICENSE
@@ -0,0 +1,25 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org/> 
+
index 5bf04dc7d8715e2388ebb8fb247653535c522a95..1c3bb830fc5ea5e4ffe4accaa9959d74df6a982d 100644 (file)
@@ -7,7 +7,7 @@
 /*  up-arrow key.                                      */ 
 /*  This code is released to the public domain.        */ 
 /*  "Share and enjoy...."  ;)                          */  
-
+/*  See the UNLICENSE file for details.                */ 
  
 
 #include <string.h>   
diff --git a/readfile.c b/readfile.c
deleted file mode 100644 (file)
index c200334..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-/* readfile.c  */ 
-
-/* Check that a file exists. */ 
-/* If it does, read it into an array and print it out. */ 
-
-
-#include <string.h>   
-#include <stdio.h> 
-
-
-
-/*  Helper function, to let us see if a file */ 
-/*  exists in the current directory.  */ 
-int fexists(char *fname)
-{  
-   FILE *fptr;  
-   fptr = fopen(fname, "r") ;     
-   if ( !fptr )  return -1 ;  /* File does not exist in dir. */                 
-   fclose(fptr);  
-   return 0;    /* File DOES exist in dir.  */   
-} 
-
-
-/* Helper function to chop newlines off the lines read in. */ 
-/* Without this being done, an extra newline is inserted */ 
-/* (which is usually not what is wanted). */ 
-void chop(char *s)
-{
-  s[strcspn(s,"\n")] = '\0';
-}
-
-
-/* An array to store the file in. */ 
-/* Only 20 lines are read. */ 
-char myarray[20][80];  
-
-
-/* Read the file into the array of strings.  */ 
-void readfile(char *fname) 
-{ 
-   int retval = fexists(fname); 
-        
-   int i; 
-   if (retval == 0) { 
-         /* File exists, so open it. */  
-         /* We open it in read-write mode so we can */ 
-         /* append new commands to it. */ 
-         FILE *fptr;  
-         fptr = fopen(fname, "rw"); 
-                          
-         for(i=0; i<20; i++)  
-         {  
-               chop(fgets(myarray[i], 80, fptr) );  
-         }
-         
-   }  /* retval == 0  */          
-       
-       else puts("Error! File does not exist. \n");  
-       
-}      
-
-
-void printfile(void) 
-{ 
-  int j; 
-       
-  for(j=0; j<10; j++) 
-     { 
-        puts(myarray[j]);      
-     }    
-               
-}      
-
-
-
-int main(void) 
-{ 
-
-readfile("test.txt"); 
-
-printfile(); 
-
-
-return 0; 
-
-}  
-
-
-
-
-
-
-
-