tailor.c

来自「采用 LZ77 运算规则 压缩及解压工具」· C语言 代码 · 共 42 行

C
42
字号
/* tailor.c -- target dependent functions * Copyright (C) 1992-1993 Jean-loup Gailly * This is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License, see the file COPYING. *//* tailor.c is a bunch of non portable routines. * It should be kept to a minimum. */#include "tailor.h"#include "gzip.h"#ifndef lintstatic char rcsid[] = "$Id: tailor.c,v 0.7 1993/01/26 19:15:23 jloup Exp $";#endif#ifdef __TURBOC__/************************//*  Function fcalloc()  *//************************//* Turbo C malloc() does not allow dynamic allocation of 64K bytes * and farmalloc(64K) returns a pointer with an offset of 8, so we * must fix the pointer. Warning: the pointer must be put back to its * original form in order to free it. * For MSC, use halloc instead of this function (see tailor.h). */void * fcalloc(items, size)    unsigned items; /* number of items */    unsigned size;  /* item size */{    void * buf = farmalloc((ulg)items*size + 16L);    /* Normalize the pointer to seg:0 */    *((int*)&buf+1) += ((unsigned)((uch*)buf-0) + 15) >> 4;    *(int*)&buf = 0;    return buf; /* buf stays NULL if alloc failed */}#endif /* __TURBOC__ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?