]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/Tools/Source/SplitFile/splitfile.c
3 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
4 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.
24 #define UTILITY_NAME "SplitFile"
25 #define UTILITY_VERSION "v1.0"
35 GC_TODO: Add function description
42 GC_TODO: add return values
48 UTILITY_NAME
" "UTILITY_VERSION
" - Intel Split File Utility",
49 " Copyright (C), 2006 - 2008 Intel Corporation",
51 #if ( defined(UTILITY_BUILD) && defined(UTILITY_VENDOR) )
52 " Built from "UTILITY_BUILD
", project of "UTILITY_VENDOR
,
56 " "UTILITY_NAME
" FILE OFFSET",
58 " Break the FILE in two pieces FILE1 and FILE2 at the requested OFFSET.",
61 for (Index
= 0; Str
[Index
] != NULL
; Index
++) {
62 fprintf (stdout
, "%s\n", Str
[Index
]);
75 GC_TODO: Add function description
79 argc - GC_TODO: add argument description
80 argv - GC_TODO: add argument description
84 GC_TODO: add return values
96 unsigned long splitpoint
;
104 In
= fopen (argv
[1], "rb");
106 printf ("Unable to open file \"%s\"\n", argv
[1]);
110 strncpy (OutName1
, argv
[1], 510);
111 strncpy (OutName2
, argv
[1], 510);
112 strcat (OutName1
, "1");
113 strcat (OutName2
, "2");
115 Out1
= fopen (OutName1
, "wb");
117 printf ("Unable to open file \"%s\"\n", OutName1
);
121 Out2
= fopen (OutName2
, "wb");
123 printf ("Unable to open file \"%s\"\n", OutName2
);
127 splitpoint
= atoi (argv
[2]);
129 for (Index
= 0; Index
< splitpoint
; Index
++) {
130 CharC
= (char) fgetc (In
);
139 CharC
= (char) fgetc (In
);