📄 ospbsafetstd.c
字号:
/**########################################################################*########################################################################*########################################################################* * COPYRIGHT (c) 1998, 1999, 2000 by TransNexus, LLC * * This software contains proprietary and confidential information * of TransNexus, LLC. Except as may be set forth in the license * agreement under which this software is supplied, use, disclosure, * or reproduction is prohibited without the prior, express, written* consent of TransNexus, LLC. * *******#########################################################################*#########################################################################*#########################################################################*//* * ospbsafestd.c *//* Copyright (C) RSA Data Security, Inc. created 1992. This file is used to demonstrate how to interface to an RSA Data Security, Inc. licensed development product. You have a royalty-free right to use, modify, reproduce and distribute this demonstration file (including any modified version), provided that you agree that RSA Data Security, Inc. has no warranty, implied or otherwise, or liability for this demonstration file or any modified version. * ----------------------------------------------------------- * NOTE: This file has been modified to use the macros defined * in ospossys.h for memory management consistency. * ----------------------------------------------------------- */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "aglobal.h"#include "bsafe.h"#include "osp.h"voidCALL_CONVT_free( POINTER p){ if (p != NULL_PTR) OSPM_FREE(p);}voidCALL_CONVT_memset( POINTER p, int c, unsigned int count){ if (count != 0) OSPM_MEMSET(p, c, count);}voidCALL_CONVT_memcpy( POINTER d, POINTER s, unsigned int count){ if (count != 0) OSPM_MEMCPY(d, s, count);}voidCALL_CONVT_memmove( POINTER d, POINTER s, unsigned int count){ if (count != 0) OSPM_MEMMOVE(d, s, count);}intCALL_CONVT_memcmp( POINTER s1, POINTER s2, unsigned int count){ int result = 0; if (count != 0) result = OSPM_MEMCMP(s1, s2, count); return result;}POINTER CALL_CONV T_malloc( unsigned int size){ POINTER p; OSPM_MALLOC(p, unsigned char, (size == 0 ? 1 : size)); return (p);}POINTER CALL_CONV T_realloc( POINTER p, unsigned int size){ POINTER result; if (p == NULL_PTR) { OSPM_MALLOC(result, unsigned char, (size == 0 ? 1 : size)); } else { OSPM_REALLOC(result, p, unsigned char, (size == 0 ? 1 : size)); if (result == NULL_PTR) OSPM_FREE(p); } return (result);}void CALL_CONV T_strcpy( char *s1, char *s2){ if(s1 != (char *)NULL_PTR && s2 != (char *)NULL_PTR) { OSPM_STRCPY(s1, s2); }}int CALL_CONV T_strcmp( char *s1, char *s2){ int result = 0; if(s1 != (char *)NULL_PTR && s2 != (char *)NULL_PTR) { result = OSPM_STRCMP(s1, s2); } return (result);}unsigned int CALL_CONV T_strlen( char *s){ unsigned int result = 0; result = OSPM_STRLEN(s); return (result);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -