Split.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Split a file into two pieces at the request offset.
Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
// GC_TODO: fix comment to start with /*++
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifdef __GNUC__
#include <unistd.h>
#else
#include <direct.h>
#endif
#include <ctype.h>
#include "ParseInf.h"
#include "CommonLib.h"
#include "EfiUtilityMsgs.h"
//
// Utility Name
//
#define UTILITY_NAME "Split"
//
// Utility version information
//
#define UTILITY_MAJOR_VERSION 0
#define UTILITY_MINOR_VERSION 1
void
Version (
void
)
/*++
Routine Description:
Displays the standard utility information to SDTOUT
Arguments:
None
Returns:
None
--*/
{
printf ("%s v%d.%d %s -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");
}
void
Usage (
void
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
Returns:
GC_TODO: add return values
--*/
{
Version();
printf ("\nUsage: \n\
Split\n\
-f, --filename inputFile to split\n\
-s, --split VALUE the number of bytes in the first file\n\
[-p, --prefix OutputDir]\n\
[-o, --firstfile Filename1]\n\
[-t, --secondfile Filename2]\n\
[-v, --verbose]\n\
[--version]\n\
[-q, --quiet disable all messages except fatal errors]\n\
[-d, --debug[#]\n\
[-h, --help]\n");
}
)
{
if (len == 0) {
return EFI_ABORTED;
}
return Status;
}
return Status;
}
}
return STATUS_ERROR;
}
return EFI_ABORTED;
}
}
if (lastCHAR == 'K')
base = 1024;
else if (lastCHAR == 'M')
else
return EFI_SUCCESS;
}
)
{
UINT64 i = 0;
for (;i < Length; ++i) {
return EFI_ABORTED;
}
++(*ReturnValue);
}
return EFI_SUCCESS;
}
)
{
return EFI_ABORTED;
}
}
}
}
return EFI_SUCCESS;
}
int
main (
int argc,
char*argv[]
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
argc - GC_TODO: add argument description
] - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
{
UINT64 DebugLevel = 0;
UINT64 VerboseLevel = 0;
if (argc == 1) {
Usage();
return STATUS_ERROR;
}
argc --;
argv ++;
Usage();
return STATUS_SUCCESS;
}
Version();
return STATUS_SUCCESS;
}
while (argc > 0) {
return STATUS_ERROR;
}
argc -= 2;
argv += 2;
continue;
}
if (InputFileName == NULL) {
return STATUS_ERROR;
}
argc -= 2;
argv += 2;
continue;
}
return STATUS_ERROR;
}
argc -= 2;
argv += 2;
continue;
}
if (OutFileName1 == NULL) {
}
argc -= 2;
argv += 2;
continue;
}
if (OutFileName2 == NULL) {
}
argc -= 2;
argv += 2;
continue;
}
argc --;
argv ++;
continue;
}
if ((strlen(argv[0]) >= 2 && argv[0][0] == '-' && (argv[0][1] == 'v' || argv[0][1] == 'V')) || (stricmp (argv[0], "--verbose") == 0)) {
VerboseLevel = 1;
return STATUS_ERROR;
}
}
argc --;
argv ++;
continue;
}
return STATUS_ERROR;
}
argc -= 2;
argv += 2;
continue;
}
//
// Don't recognize the paramter.
//
return STATUS_ERROR;
}
if (InputFileName == NULL) {
return STATUS_ERROR;
}
// ("Unable to open file \"%s\"\n", InputFileName);
return STATUS_ERROR;
}
if (OutFileName1 == NULL) {
return STATUS_ERROR;
}
}
if (OutFileName2 == NULL) {
return STATUS_ERROR;
}
}
//OutputDirSpecified = TRUE;
return STATUS_ERROR;
}
}
return STATUS_ERROR;
}
return STATUS_ERROR;
}
// ("Unable to open file \"%s\"\n", OutFileName1);
return STATUS_ERROR;
}
// ("Unable to open file \"%s\"\n", OutFileName2);
return STATUS_ERROR;
}
break;
}
}
for (;;) {
break;
}
}
}
}
return STATUS_SUCCESS;
}