2005-04-18 02:57:44 -04:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2016-04-03 16:35:43 -04:00
|
|
|
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2005-04-18 02:57:44 -04: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-02 18:19:02 -05:00
|
|
|
* are also available at https://curl.haxx.se/docs/copyright.html.
|
2005-04-18 02:57:44 -04: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 11:32:06 -04:00
|
|
|
#include "server_setup.h"
|
2005-04-18 02:57:44 -04:00
|
|
|
|
|
|
|
#include "getpart.h"
|
|
|
|
|
2017-05-02 15:09:41 -04:00
|
|
|
#include "curl_printf.h"
|
2005-04-18 02:57:44 -04:00
|
|
|
|
2013-01-03 20:50:28 -05:00
|
|
|
/* include memdebug.h last */
|
|
|
|
#include "memdebug.h"
|
2005-04-18 02:57:44 -04:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2010-02-14 08:14:17 -05:00
|
|
|
int rc;
|
|
|
|
char *part;
|
|
|
|
size_t partlen, i;
|
|
|
|
|
2005-04-18 02:57:44 -04:00
|
|
|
if(argc< 3) {
|
|
|
|
printf("./testpart main sub\n");
|
|
|
|
}
|
|
|
|
else {
|
2010-02-14 08:14:17 -05:00
|
|
|
rc = getpart(&part, &partlen, argv[1], argv[2], stdin);
|
|
|
|
if(rc)
|
2016-04-03 16:35:43 -04:00
|
|
|
return rc;
|
2010-02-14 08:14:17 -05:00
|
|
|
for(i = 0; i < partlen; i++)
|
|
|
|
printf("%c", part[i]);
|
|
|
|
free(part);
|
2005-04-18 02:57:44 -04:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|