• 大小: 13.89MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-02
  • 语言: C/C++
  • 标签: PJSIP  

资源简介

PJSIP---可以视频通话的库 c++

资源截图

代码片段和文件信息

import sys
import os

REMOVE_THESE = [“-I/usr/include“ “-I/usr/include/“ “-L/usr/lib“ “-L/usr/lib/“]

class Pkg:
def __init__(self pkg_name):
self.name = pkg_name
self.priority = 0
self.vars = {}

def parse(self pkg_config_path):
f = None
for pkg_path in pkg_config_path.split(‘:‘):
if pkg_path[-1] != ‘/‘:
pkg_path += ‘/‘
fname = pkg_path + self.name + ‘.pc‘
try:
f = open(fname “r“)
break
except:
continue
if not f:
   #sys.stderr.write(“pkgconfig.py: unable to find %s.pc in %s\n“ % (self.name pkg_config_path))
return False

for line in f.readlines():
line = line.strip()
if not line:
continue
if line[0]==‘#‘:
continue
pos1 = line.find(‘=‘)
pos2 = line.find(‘:‘)
if pos1 > 0 and (pos1 < pos2 or pos2 < 0):
pos = pos1
elif pos2 > 0 and (pos2 < pos1 or pos1 < 0):
pos = pos2
else:
continue
name = line[:pos].lower()
value = line[pos+1:]
self.vars[name] = value
f.close()

for name in self.vars.keys():
value = self.vars[name]
while True:
pos1 = value.find(“${“)
if pos1 < 0:
break
pos2 = value.find(“}“)
if pos2 < 0:
break
value = value.replace(value[pos1:pos2+1] self.vars[value[pos1+2:pos2]])
self.vars[name] = value
return True

def requires(self):
if not ‘requires‘ in self.vars:
return []
deps = []
req_list = self.vars[‘requires‘]
for req_item in req_list.split(‘‘):
req_item = req_item.strip()
for i in range(len(req_item)):
if “=<>“.find(req_item[i]) >= 0:
deps.append(req_item[:i].strip())
break
return deps

def libs(self):
if not ‘libs‘ in self.vars:
return []
return self.vars[‘libs‘].split(‘ ‘)

def cflags(self):
if not ‘cflags‘ in self.vars:
return []
return self.vars[‘cflags‘].split(‘ ‘)


def calculate_pkg_priority(pkg pkg_dict loop_cnt):
if loop_cnt > 10:
sys.stderr.write(“Circular dependency with pkg %s\n“ % (pkg))
return 0
reqs = pkg.requires()
prio = 1
for req in reqs:
if not req in pkg_dict:
continue
req_pkg = pkg_dict[req]
prio += calculate_pkg_priority(req_pkg pkg_dict loop_cnt+1)
return prio

if __name__ == “__main__“:
pkg_names = []
pkg_dict = {}
commands = []
exist_check = False

for i in range(1len(sys.argv)):
if sys.argv[i][0] == ‘-‘:
cmd = sys.argv[i]
commands.append(cmd)
if cmd==‘--exists‘:
exist_check = True
elif cmd==“--help“:
print “This is not very helpful is it“
sys.exit(0)
elif cmd==“--version“:
print “0.1“
sys.exit(0)
else:
pkg_names.append(sys.argv[i])

# Fix search path
PKG_CONFIG_PATH = os.getenv(“PKG_CONFIG_PATH“ ““).strip()
if not PKG_CONFIG_PATH:
PKG_CONFIG_PATH=“/usr/local/lib/pkgconfig:/usr/lib/pkgconfig“
PKG_CONFIG_PATH = PKG_CONFIG_PATH.replace(“;“ “:“)

# Parse files
for pkg_name in pkg_names:
pkg = Pkg(pkg_name)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     275583  2015-08-06 16:15  pjproject-2.4.5\aconfigure

     文件      56638  2015-08-06 16:15  pjproject-2.4.5\aconfigure.ac

     文件       1463  2013-04-23 12:39  pjproject-2.4.5\bb10-config.mak

     文件        443  2013-10-21 14:52  pjproject-2.4.5\build\cc-auto.mak.in

     文件        524  2006-05-11 02:24  pjproject-2.4.5\build\cc-gcc.mak

     文件        426  2005-11-21 08:55  pjproject-2.4.5\build\cc-vc.mak

     文件       1506  2010-05-17 20:07  pjproject-2.4.5\build\common.mak

     文件        317  2005-11-21 08:55  pjproject-2.4.5\build\host-mingw.mak

     文件        302  2010-08-05 14:04  pjproject-2.4.5\build\host-unix.mak

     文件        353  2005-11-21 08:55  pjproject-2.4.5\build\host-win32.mak

     文件        106  2005-11-21 08:55  pjproject-2.4.5\build\m-alpha.mak

     文件        106  2006-07-14 22:20  pjproject-2.4.5\build\m-arm.mak

     文件         36  2006-08-21 03:47  pjproject-2.4.5\build\m-auto.mak

     文件        105  2005-11-21 08:55  pjproject-2.4.5\build\m-i386.mak

     文件        105  2005-11-21 08:55  pjproject-2.4.5\build\m-m68k.mak

     文件        247  2006-05-11 02:24  pjproject-2.4.5\build\m-mpc860.mak

     文件        108  2006-03-20 19:39  pjproject-2.4.5\build\m-powerpc.mak

     文件        106  2005-11-21 08:55  pjproject-2.4.5\build\m-sparc.mak

     文件        107  2006-07-23 21:38  pjproject-2.4.5\build\m-x86_64.mak

     文件        198  2010-08-25 19:51  pjproject-2.4.5\build\os-auto.mak.in

     文件        179  2006-08-21 03:47  pjproject-2.4.5\build\os-darwinos.mak

     文件       1229  2005-11-21 08:55  pjproject-2.4.5\build\os-linux-kernel.mak

     文件        284  2007-04-18 16:24  pjproject-2.4.5\build\os-linux.mak

     文件        898  2005-11-21 08:55  pjproject-2.4.5\build\os-palmos.mak

     文件        462  2006-08-21 03:47  pjproject-2.4.5\build\os-rtems.mak

     文件        287  2006-08-21 03:47  pjproject-2.4.5\build\os-sunos.mak

     文件        254  2006-08-21 03:47  pjproject-2.4.5\build\os-win32.mak

     文件       6591  2015-08-07 19:52  pjproject-2.4.5\build\rules.mak

     文件        950  2016-03-11 18:06  pjproject-2.4.5\build\vs\pjproject-vs8-common-defaults.props

     文件        763  2009-04-29 22:30  pjproject-2.4.5\build\vs\pjproject-vs8-common-defaults.vsprops

............此处省略2500个文件信息

评论

共有 条评论

相关资源