From c8e5702127e507e82e6f68a4b8c546803accea9d Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 30 Jun 2005 08:19:37 +0000 Subject: import clean BK tree at cset 1.3670 --- packages/pad/.mtn2git_empty | 0 packages/pad/pad/.mtn2git_empty | 0 packages/pad/pad/pad.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 packages/pad/.mtn2git_empty create mode 100644 packages/pad/pad/.mtn2git_empty mode change 100644 => 100755 packages/pad/pad/pad.c (limited to 'packages/pad') diff --git a/packages/pad/.mtn2git_empty b/packages/pad/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pad/pad/.mtn2git_empty b/packages/pad/pad/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pad/pad/pad.c b/packages/pad/pad/pad.c old mode 100644 new mode 100755 index e69de29bb2..e81e22504d --- a/packages/pad/pad/pad.c +++ b/packages/pad/pad/pad.c @@ -0,0 +1,40 @@ +#include +#include +#include +#include +#include + +int stat(const char *file_name, struct stat *buf); + +int syntax(void) +{ + printf("syntax:\n"); + printf(" pad padnum filename\n"); + return(0); +} + +int main(int argc, char **argv) +{ + FILE *fp; + long int i=0L, padsize=0L; + unsigned char data=0xff; + struct stat fileinfo; + if(argc<3){ + syntax(); + exit(1); + } + if((fp=fopen(argv[2],"a"))==NULL){ + printf("error opening %s.\n",argv[2]); + exit(1); + } + if(stat(argv[2],&fileinfo)!=0){ + printf("error in stat of %s.\n",argv[2]); + exit(1); + } + padsize = strtol(argv[1],NULL,10) - fileinfo.st_size; + for(i=0;i