Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: tools/generate_stubs/generate_stubs.py

Issue 3518002: Roll DEPS to include changes to FFmpeg build system (Closed)
Patch Set: comments fixed Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Creates windows and posix stub files for a given set of signatures. 7 """Creates windows and posix stub files for a given set of signatures.
8 8
9 For libraries that need to be loaded outside of the standard executable startup 9 For libraries that need to be loaded outside of the standard executable startup
10 path mechanism, stub files need to be generated for the wanted functions. In 10 path mechanism, stub files need to be generated for the wanted functions. In
11 windows, this is done via "def" files and the delay load mechanism. On a posix 11 windows, this is done via "def" files and the delay load mechanism. On a posix
12 system, a set of stub functions need to be generated that dispatch to functions 12 system, a set of stub functions need to be generated that dispatch to functions
13 found via dlsym. 13 found via dlsym.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 This function splits the filename from the extention on that basename of 337 This function splits the filename from the extention on that basename of
338 the path and returns that as the module name. 338 the path and returns that as the module name.
339 339
340 Args: 340 Args:
341 infile_path: String holding the path to the input file. 341 infile_path: String holding the path to the input file.
342 342
343 Returns: 343 Returns:
344 The module name as a string. 344 The module name as a string.
345 """ 345 """
346 basename = os.path.basename(infile_path) 346 basename = os.path.basename(infile_path)
347 return os.path.splitext(basename)[0] 347
348 # This loop continously removes suffixes of the filename separated by a "."
349 # character.
350 while 1:
351 new_basename = os.path.splitext(basename)[0]
352 if basename == new_basename:
353 break
354 else:
355 basename = new_basename
356 return basename
348 357
349 358
350 def ParseSignatures(infile): 359 def ParseSignatures(infile):
351 """Parses function signatures in the input file. 360 """Parses function signatures in the input file.
352 361
353 This function parses a file of signatures into a list of dictionaries that 362 This function parses a file of signatures into a list of dictionaries that
354 represent the function signatures in the input file. Each dictionary has 363 represent the function signatures in the input file. Each dictionary has
355 the following keys: 364 the following keys:
356 return_type: A string with the return type. 365 return_type: A string with the return type.
357 name: A string with the name of the function. 366 name: A string with the name of the function.
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 if options.type == FILE_TYPE_WIN: 1025 if options.type == FILE_TYPE_WIN:
1017 CreateWindowsLibForSigFiles(args, out_dir, intermediate_dir) 1026 CreateWindowsLibForSigFiles(args, out_dir, intermediate_dir)
1018 elif options.type == FILE_TYPE_POSIX_STUB: 1027 elif options.type == FILE_TYPE_POSIX_STUB:
1019 CreatePosixStubsForSigFiles(args, options.stubfile_name, out_dir, 1028 CreatePosixStubsForSigFiles(args, options.stubfile_name, out_dir,
1020 intermediate_dir, options.path_from_source, 1029 intermediate_dir, options.path_from_source,
1021 options.extra_stub_header) 1030 options.extra_stub_header)
1022 1031
1023 1032
1024 if __name__ == '__main__': 1033 if __name__ == '__main__':
1025 main() 1034 main()
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698