• 大小: 0.45M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-22
  • 语言: 其他
  • 标签: 其他  

资源简介

zint-源代码.zip

资源截图

代码片段和文件信息

/* 2of5.c - Handles Code 2 of 5 barcodes */

/*
    libzint - the open source barcode library
    Copyright (C) 2008 Robin Stuart 

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not write to the Free Software Foundation Inc.
    51 Franklin Street Fifth Floor Boston MA 02110-1301 USA.
*/

#include 
#include 
#include 
#include “common.h“

const char *C25MatrixTable[10] = {“113311“ “311131“ “131131“ “331111“ “113131“ “313111“
“133111“ “111331“ “311311“ “131311“};

const char *C25IndustTable[10] = {“1111313111“ “3111111131“ “1131111131“ “3131111111“ “1111311131“
“3111311111“ “1131311111“ “1111113131“ “3111113111“ “1131113111“};

const char *C25InterTable[10] = {“11331“ “31113“ “13113“ “33111“ “11313“ “31311“ “13311“ “11133“
“31131“ “13131“};


static inline char check_digit(unsigned int count)
{
return itoc((10 - (count % 10)) % 10);
}


int matrix_two_of_five(struct zint_symbol *symbol uint8_t source[] int length)
{ /* Code 2 of 5 Standard (Code 2 of 5 Matrix) */

int error_number;
char dest[512]; /* 6 + 80 * 6 + 6 + 1 ~ 512*/

error_number = 0;

if(length > 80) {
strcpy(symbol->errtxt “Input too long“);
return ZERROR_TOO_LONG;
}
error_number = is_sane(NEON source length);
if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt “Invalid characters in data“);
return error_number;
}

/* start character */
strcpy(dest “411111“);

for(int i = 0; i < length; i++) {
lookup(NEON C25MatrixTable source[i] dest);
}

/* Stop character */
concat (dest “41111“);

expand(symbol dest);
ustrcpy(symbol->text source);
return error_number;
}

int industrial_two_of_five(struct zint_symbol *symbol uint8_t source[] int length)
{ /* Code 2 of 5 Industrial */

int error_number;
char dest[512]; /* 6 + 40 * 10 + 6 + 1 */

error_number = 0;

if(length > 45) {
strcpy(symbol->errtxt “Input too long“);
return ZERROR_TOO_LONG;
}
error_number = is_sane(NEON source length);
if(error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt “Invalid character in data“);
return error_number;
}

/* start character */
strcpy(dest “313111“);

for(int i = 0; i < length; i++) {
lookup(NEON C25IndustTable source[i] dest);
}

/* Stop character */
concat (dest “31113“);

expand(symbol dest);
ustrcpy(symbol->text source);
return error_number;
}

int iata_two_of_five(stru

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-07-09 06:38  zint-master\
     文件          40  2013-07-09 06:38  zint-master\.gitignore
     文件        3724  2013-07-09 06:38  zint-master\CMakeLists.txt
     文件       35147  2013-07-09 06:38  zint-master\COPYING
     文件        2461  2013-07-09 06:38  zint-master\INSTALL
     文件        4149  2013-07-09 06:38  zint-master\README
     文件       16874  2013-07-09 06:38  zint-master\SetPaths.cmake
     文件        1070  2013-07-09 06:38  zint-master\TODO
     目录           0  2013-07-09 06:38  zint-master\backend\
     文件        8661  2013-07-09 06:38  zint-master\backend\2of5.c
     文件        1022  2013-07-09 06:38  zint-master\backend\CMakeLists.txt
     文件        1991  2013-07-09 06:38  zint-master\backend\DEVELOPER
     文件        6872  2013-07-09 06:38  zint-master\backend\auspost.c
     文件       37373  2013-07-09 06:38  zint-master\backend\aztec.c
     文件      122229  2013-07-09 06:38  zint-master\backend\aztec.h
     文件       15510  2013-07-09 06:38  zint-master\backend\code.c
     文件       42727  2013-07-09 06:38  zint-master\backend\code1.c
     文件        3195  2013-07-09 06:38  zint-master\backend\code1.h
     文件       24848  2013-07-09 06:38  zint-master\backend\code128.c
     文件       16643  2013-07-09 06:38  zint-master\backend\code16k.c
     文件        9134  2013-07-09 06:38  zint-master\backend\code49.c
     文件       62924  2013-07-09 06:38  zint-master\backend\code49.h
     文件        8294  2013-07-09 06:38  zint-master\backend\common.c
     文件        2706  2013-07-09 06:38  zint-master\backend\common.h
     文件       57080  2013-07-09 06:38  zint-master\backend\composite.c
     文件        2066  2013-07-09 06:38  zint-master\backend\composite.h
     文件         783  2013-07-09 06:38  zint-master\backend\dllversion.c
     文件       24862  2013-07-09 06:38  zint-master\backend\dmatrix.c
     文件        4156  2013-07-09 06:38  zint-master\backend\dmatrix.h
     文件       56889  2013-07-09 06:38  zint-master\backend\font.h
     文件      127495  2013-07-09 06:38  zint-master\backend\gb2312.h
............此处省略112个文件信息

评论

共有 条评论