mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
		
			
				
	
	
		
			81 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Asterisk -- An open source telephony toolkit.
 | |
|  *
 | |
|  * Copyright (C) 2016, CFWare, LLC
 | |
|  *
 | |
|  * Corey Farrell <git@cfware.com>
 | |
|  *
 | |
|  * See http://www.asterisk.org for more information about
 | |
|  * the Asterisk project. Please do not directly contact
 | |
|  * any of the maintainers of this project for assistance;
 | |
|  * the project provides a web site, mailing lists and IRC
 | |
|  * channels for your use.
 | |
|  *
 | |
|  * This program is free software, distributed under the terms of
 | |
|  * the GNU General Public License Version 2. See the LICENSE file
 | |
|  * at the top of the source tree.
 | |
|  */
 | |
| 
 | |
| /*! \file
 | |
|  *
 | |
|  * \brief Dialplan context ignorepat routines.
 | |
|  *
 | |
|  * \author Corey Farrell <git@cfware.com>
 | |
|  */
 | |
| 
 | |
| /*** MODULEINFO
 | |
| 	<support_level>core</support_level>
 | |
|  ***/
 | |
| 
 | |
| #include "asterisk.h"
 | |
| 
 | |
| #include "asterisk/_private.h"
 | |
| #include "asterisk/pbx.h"
 | |
| #include "pbx_private.h"
 | |
| 
 | |
| /*! \brief ast_ignorepat: Ignore patterns in dial plan */
 | |
| struct ast_ignorepat {
 | |
| 	const char *registrar;
 | |
| 	const char pattern[0];
 | |
| };
 | |
| 
 | |
| const char *ast_get_ignorepat_name(const struct ast_ignorepat *ip)
 | |
| {
 | |
| 	return ip ? ip->pattern : NULL;
 | |
| }
 | |
| 
 | |
| const char *ast_get_ignorepat_registrar(const struct ast_ignorepat *ip)
 | |
| {
 | |
| 	return ip ? ip->registrar : NULL;
 | |
| }
 | |
| 
 | |
| struct ast_ignorepat *ignorepat_alloc(const char *value, const char *registrar)
 | |
| {
 | |
| 	struct ast_ignorepat *ignorepat;
 | |
| 	int length = strlen(value) + 1;
 | |
| 	char *pattern;
 | |
| 
 | |
| 	/* allocate new include structure ... */
 | |
| 	ignorepat = ast_calloc(1, sizeof(*ignorepat) + length);
 | |
| 	if (!ignorepat) {
 | |
| 		return NULL;
 | |
| 	}
 | |
| 
 | |
| 	/* The cast to char * is because we need to write the initial value.
 | |
| 	 * The field is not supposed to be modified otherwise.  Also, gcc 4.2
 | |
| 	 * sees the cast as dereferencing a type-punned pointer and warns about
 | |
| 	 * it.  This is the workaround (we're telling gcc, yes, that's really
 | |
| 	 * what we wanted to do).
 | |
| 	 */
 | |
| 	pattern = (char *) ignorepat->pattern;
 | |
| 	strcpy(pattern, value);
 | |
| 	ignorepat->registrar = registrar;
 | |
| 
 | |
| 	return ignorepat;
 | |
| }
 | |
| 
 | |
| void ignorepat_free(struct ast_ignorepat *ip)
 | |
| {
 | |
| 	ast_free(ip);
 | |
| }
 |