]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/CCode/Source/SplitFile/SplitFile.c
3 Copyright (c) 1999-2006 Intel Corporation. All rights reserved
4 This program and the accompanying materials are licensed and made available
5 under the terms and conditions of the BSD License which accompanies this
6 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.
14 // GC_TODO: fix comment to start with /*++
27 GC_TODO: Add function description
34 GC_TODO: add return values
39 "SplitFile Filename Offset\n"" Filename = Input file to split\n"" Offset = offset at which to split file\n"
40 "\n\n""SplitFile will break a file in two pieces at the requested offset\n"
41 " outputting Filename1 and Filename2\n"
54 GC_TODO: Add function description
58 argc - GC_TODO: add argument description
59 ] - GC_TODO: add argument description
63 GC_TODO: add return values
75 unsigned long splitpoint
;
83 In
= fopen (argv
[1], "rb");
85 printf ("Unable to open file \"%s\"\n", argv
[1]);
89 strncpy (OutName1
, argv
[1], 510);
90 strncpy (OutName2
, argv
[1], 510);
91 strcat (OutName1
, "1");
92 strcat (OutName2
, "2");
94 Out1
= fopen (OutName1
, "wb");
96 printf ("Unable to open file \"%s\"\n", OutName1
);
100 Out2
= fopen (OutName2
, "wb");
102 printf ("Unable to open file \"%s\"\n", OutName2
);
106 splitpoint
= atoi (argv
[2]);
108 for (Index
= 0; Index
< splitpoint
; Index
++) {
109 CharC
= (char) fgetc (In
);
118 CharC
= (char) fgetc (In
);