2005-04-18 14:57:44 +08:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2016-04-04 04:35:43 +08:00
|
|
|
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2005-04-18 14:57:44 +08:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
2016-02-03 07:19:02 +08:00
|
|
|
* are also available at https://curl.haxx.se/docs/copyright.html.
|
2005-04-18 14:57:44 +08:00
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2012-04-10 23:32:06 +08:00
|
|
|
#include "server_setup.h"
|
2005-04-18 14:57:44 +08:00
|
|
|
|
|
|
|
#include "getpart.h"
|
|
|
|
|
2017-05-03 03:09:41 +08:00
|
|
|
#include "curl_printf.h"
|
2005-04-18 14:57:44 +08:00
|
|
|
|
2013-01-04 09:50:28 +08:00
|
|
|
/* include memdebug.h last */
|
|
|
|
#include "memdebug.h"
|
2005-04-18 14:57:44 +08:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2010-02-14 21:14:17 +08:00
|
|
|
int rc;
|
|
|
|
char *part;
|
|
|
|
size_t partlen, i;
|
|
|
|
|
2005-04-18 14:57:44 +08:00
|
|
|
if(argc< 3) {
|
|
|
|
printf("./testpart main sub\n");
|
|
|
|
}
|
|
|
|
else {
|
2010-02-14 21:14:17 +08:00
|
|
|
rc = getpart(&part, &partlen, argv[1], argv[2], stdin);
|
|
|
|
if(rc)
|
2016-04-04 04:35:43 +08:00
|
|
|
return rc;
|
2010-02-14 21:14:17 +08:00
|
|
|
for(i = 0; i < partlen; i++)
|
|
|
|
printf("%c", part[i]);
|
|
|
|
free(part);
|
2005-04-18 14:57:44 +08:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|