资源简介
treeNMS-1.7.3 全平台通用,包含缺失文件!!
代码片段和文件信息
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License Version 2.0
* (the “License“); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* @version $Id: arguments.c 1453280 2013-03-06 10:45:30Z mturk $ */
#include “jsvc.h“
#include
#include
/* Return the argument of a command line option */
static char *optional(int argc char *argv[] int argi)
{
argi++;
if (argi >= argc)
return NULL;
if (argv[argi] == NULL)
return NULL;
if (argv[argi][0] == ‘-‘)
return NULL;
return strdup(argv[argi]);
}
static char *memstrcat(char *ptr const char *str const char *add)
{
size_t nl = 1;
int nas = ptr == NULL;
if (ptr)
nl += strlen(ptr);
if (str)
nl += strlen(str);
if (add)
nl += strlen(add);
ptr = (char *)realloc(ptr nl);
if (ptr) {
if (nas)
*ptr = ‘\0‘;
if (str)
strcat(ptr str);
if (add)
strcat(ptr add);
}
return ptr;
}
static char* eval_ppath(char *strcp const char *pattern)
{
glob_t globbuf;
char jars[PATH_MAX + 1];
if (strlen(pattern) > (sizeof(jars) - 5)) {
return memstrcat(strcp pattern NULL);
}
strcpy(jars pattern);
strcat(jars “.jar“);
memset(&globbuf 0 sizeof(glob_t));
if (glob(jars GLOB_ERR NULL &globbuf) == 0) {
size_t n;
for (n = 0; n < globbuf.gl_pathc - 1; n++) {
strcp = memstrcat(strcp globbuf.gl_pathv[n] “:“);
if (strcp == NULL) {
globfree(&globbuf);
return NULL;
}
}
strcp = memstrcat(strcp globbuf.gl_pathv[n] NULL);
globfree(&globbuf);
}
return strcp;
}
#define JAVA_CLASSPATH “-Djava.class.path=“
/**
* Call glob on each PATH like string path.
* Glob is called only if the part ends with asterisk in which
* case asterisk is replaced by *.jar when searching
*/
static char* eval_cpath(const char *cp)
{
char *cpy = memstrcat(NULL JAVA_CLASSPATH cp);
char *gcp = NULL;
char *pos;
char *ptr;
if (!cpy)
return NULL;
ptr = cpy + sizeof(JAVA_CLASSPATH) - 1;;
while ((pos = strchr(ptr ‘:‘))) {
*pos = ‘\0‘;
if (gcp)
gcp = memstrcat(gcp “:“ NULL);
else
相关资源
- vc_redist.x64.exe
- ssm+redis框架,亲测执行成功
- redis各版本安装包exe的
- Spring+Struts2+hibernate+Redis整合
- REDIS入门指南.pdf
- 使用Qt Creator作为Linux IDE,实现Redis源
- redis-desktop-manager-0.8.3 for mac
- redis设计与实现第二版 高清完整PDF版
- CRRedist2005_x86.msi 和 CRREdist2005_x86_chs.
- redis-desktop-manager-0.8.3.3850官方最新版
- Redis入门指南+第2版高清完整带目录
- Redis实战PDF高清版
- redis简单封装
- fastoredis-2.4.0-x86_64.exe
- VirtualBreadboard/vjredist
- Redis开发与运维(付磊).pdf
- redis-desktop-manager_0.9.2.19_amd64.deb for l
- SpringMVC+Redis+Activiti+Fastdfs+Thirft+Websoc
- medis破解版Mac版
- Redis实现系统监控
- ssm+redis实现sso单点登陆,maven模块化实
- 深入理解Redis 中文版.pdf
- CRforVS_redist_install_64bit_13_0_1.zip
- Redis 缓存 + Spring 的集成
- ssm redis实现sso单点登录
- memcached1.4.5源代码
- 神级memcached源代码分析文档_1.4.0代码
- redis 性能测试
- 2020大数据面试题总汇
- redis-trib.rbredis 5.0以下的版本使用
评论
共有 条评论