2020-08-14 22:04:26 +00:00
|
|
|
/*
|
2020-09-08 00:58:40 +00:00
|
|
|
* Copyright (c) 2020, yzrh <yzrh@noema.org>
|
2020-08-14 22:04:26 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "cnki.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
cnki_caj(cnki_t **param)
|
|
|
|
{
|
|
|
|
if (*param == NULL)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
if ((*param)->stat > 0)
|
|
|
|
printf("Begin 'CAJ' conversion\n");
|
|
|
|
|
|
|
|
if ((*param)->stat > 1)
|
2020-12-29 02:10:17 +00:00
|
|
|
printf("Reading document body address at 0x%x\n", ADDRESS_CAJ_BODY);
|
2020-08-14 22:04:26 +00:00
|
|
|
|
|
|
|
int addr;
|
|
|
|
|
|
|
|
fseek((*param)->fp_i, ADDRESS_CAJ_BODY, SEEK_SET);
|
|
|
|
fread(&addr, 4, 1, (*param)->fp_i);
|
|
|
|
fseek((*param)->fp_i, addr, SEEK_SET);
|
|
|
|
fread(&addr, 4, 1, (*param)->fp_i);
|
|
|
|
fseek((*param)->fp_i, addr, SEEK_SET);
|
|
|
|
|
|
|
|
if ((*param)->stat > 0)
|
2020-12-29 02:10:17 +00:00
|
|
|
printf("Advised document body address is 0x%x\n", addr);
|
2020-08-14 22:04:26 +00:00
|
|
|
|
|
|
|
cnki_pdf(param);
|
|
|
|
|
|
|
|
if ((*param)->stat > 0)
|
|
|
|
printf("Conversion ended\n");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|