]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/Tools/Source/SplitFile/splitfile.c
3 Copyright 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
32 GC_TODO: Add function description
39 GC_TODO: add return values
44 "SplitFile Filename Offset\n"" Filename = Input file to split\n"" Offset = offset at which to split file\n"
45 "\n\n""SplitFile will break a file in two pieces at the requested offset\n"
46 " outputting Filename1 and Filename2\n"
59 GC_TODO: Add function description
63 argc - GC_TODO: add argument description
64 argv - GC_TODO: add argument description
68 GC_TODO: add return values
80 unsigned long splitpoint
;
88 In
= fopen (argv
[1], "rb");
90 printf ("Unable to open file \"%s\"\n", argv
[1]);
94 strncpy (OutName1
, argv
[1], 510);
95 strncpy (OutName2
, argv
[1], 510);
96 strcat (OutName1
, "1");
97 strcat (OutName2
, "2");
99 Out1
= fopen (OutName1
, "wb");
101 printf ("Unable to open file \"%s\"\n", OutName1
);
105 Out2
= fopen (OutName2
, "wb");
107 printf ("Unable to open file \"%s\"\n", OutName2
);
111 splitpoint
= atoi (argv
[2]);
113 for (Index
= 0; Index
< splitpoint
; Index
++) {
114 CharC
= (char) fgetc (In
);
123 CharC
= (char) fgetc (In
);