小编Fig*_*gus的帖子

Config.h - 没有这样的文件或目录

文件'safe-read.c'包含lib'config.h',这个文件放在哪里?

我在libs中发现了许多带有此名称的文件,但我不知道它是正确的.

UPDATE

我的文件是:

...
#include <safe-read.h>
#include <safe-read.c>
...
Run Code Online (Sandbox Code Playgroud)

在文件safe-read.c中有这个包含块

#include <config.h> //line 19

/* Specification.  */
#ifdef SAFE_WRITE
# include "safe-write.h"
#else
# include "safe-read.h"
#endif

/* Get ssize_t.  */
#include <sys/types.h>
#include <unistd.h>

#include <errno.h>

#ifdef EINTR
# define IS_EINTR(x) ((x) == EINTR)
#else
# define IS_EINTR(x) 0
#endif

#include <limits.h>

#ifdef SAFE_WRITE
# define safe_rw safe_write
# define rw write
#else
# define safe_rw safe_read
# define rw read
# undef const
# define …
Run Code Online (Sandbox Code Playgroud)

c

9
推荐指数
1
解决办法
3万
查看次数

为什么mbtowc不按预期计算字符集?

我想要计算文件中的字符(在各种字符集中)并且我使用函数'mbtowc'来检测字符.我无法弄清楚为什么字符和结果值不同.这是我的例子:

char buf[BUFFER_SIZE + MB_LEN_MAX];

int fd = open ("chinese_test", O_RDONLY);

unsigned int bytes, chars;

int bytes_read;

bytes = chars = 0;

while((bytes_read = read(fd, buf, BUFFER_SIZE)) > 0) {
    wchar_t wc_buf[BUFFER_SIZE], *wcp;
    char *p;
    int n = 0;

    bytes += bytes_read;

    p = buf;
    wcp = wc_buf;

    while((n = mbtowc(wcp, p, MB_LEN_MAX)) > 0) {
        p += n;
        wcp++;

        chars++;
    }

}

printf("chars: %d\tbytes: %d\n", chars, bytes);
Run Code Online (Sandbox Code Playgroud)

我用一些带有GB2312字符的文本测试函数,但字符字节的值太大了.

我的测试返回 - >字符:4638 | bytes:17473但'wc'linux命令返回:chars:16770 | 字节:17473 …

c linux

6
推荐指数
1
解决办法
396
查看次数

用于图像处理的Python模块

可能重复:
图像处理,在Python?

有一个用于图像处理的Python模块?

我想分析,修改和创建其他图像.

python image

0
推荐指数
1
解决办法
1449
查看次数

标签 统计

c ×2

image ×1

linux ×1

python ×1