2005-04-18 14:57:44 +08:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2023-01-02 20:51:48 +08:00
|
|
|
* Copyright (C) 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
|
2020-11-04 21:02:01 +08:00
|
|
|
* are also available at https://curl.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.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
*
|
2005-04-18 14:57:44 +08:00
|
|
|
***************************************************************************/
|
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
|
|
|
char *part;
|
2018-06-03 04:52:56 +08:00
|
|
|
size_t partlen;
|
2010-02-14 21:14:17 +08:00
|
|
|
|
2005-04-18 14:57:44 +08:00
|
|
|
if(argc< 3) {
|
|
|
|
printf("./testpart main sub\n");
|
|
|
|
}
|
|
|
|
else {
|
2018-06-03 04:52:56 +08:00
|
|
|
int rc = getpart(&part, &partlen, argv[1], argv[2], stdin);
|
|
|
|
size_t i;
|
2010-02-14 21:14:17 +08:00
|
|
|
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;
|
|
|
|
}
|