• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/OpenLDAP-499.27/OpenLDAP/libraries/librewrite/

Lines Matching refs:map

29 #include "rewrite-map.h"
42 struct rewrite_map *map = NULL;
55 * Go to the end of the map invocation (the right closing brace)
60 * '%' marks the beginning of a new map
66 * of an old map
87 * Copy the map invocation
98 * Isolate the map name (except for variable deref)
117 * Check for special map types
164 * Isolate the argument of the map (except for variable deref)
180 * Compile the substitution pattern of the map argument
191 * Create the map
193 map = calloc( sizeof( struct rewrite_map ), 1 );
194 if ( map == NULL ) {
198 memset( map, 0, sizeof( struct rewrite_map ) );
201 if ( ldap_pvt_thread_mutex_init( &map->lm_mutex ) ) {
217 map->lm_subst = subst;
222 * Parses special map types
235 map->lm_type = REWRITE_MAP_SUBCONTEXT;
236 map->lm_name = strdup( s + 1 );
237 if ( map->lm_name == NULL ) {
241 map->lm_data = rewrite_context_find( info, s + 1 );
242 if ( map->lm_data == NULL ) {
261 map->lm_type = REWRITE_MAP_SETW_SESN_VAR;
262 map->lm_name = strdup( s + 3 );
264 map->lm_type = REWRITE_MAP_SET_SESN_VAR;
265 map->lm_name = strdup( s + 2 );
269 map->lm_type = REWRITE_MAP_SETW_OP_VAR;
270 map->lm_name = strdup( s + 2 );
272 map->lm_type = REWRITE_MAP_SET_OP_VAR;
273 map->lm_name = strdup( s + 1 );
276 if ( map->lm_name == NULL ) {
287 map->lm_type = REWRITE_MAP_GET_SESN_VAR;
288 map->lm_name = strdup( s + 2 );
290 map->lm_type = REWRITE_MAP_GET_OP_VAR;
291 map->lm_name = strdup( s + 1 );
293 if ( map->lm_name == NULL ) {
303 map->lm_type = REWRITE_MAP_GET_PARAM;
304 map->lm_name = strdup( s + 1 );
305 if ( map->lm_name == NULL ) {
312 * Built-in map
315 map->lm_type = REWRITE_MAP_BUILTIN;
316 map->lm_name = strdup( s );
317 if ( map->lm_name == NULL ) {
321 map->lm_data = rewrite_builtin_map_find( info, s );
322 if ( map->lm_data == NULL ) {
336 if ( map ) {
339 ldap_pvt_thread_mutex_destroy( &map->lm_mutex );
343 if ( map->lm_name ) {
344 free( map->lm_name );
345 map->lm_name = NULL;
347 free( map );
348 map = NULL;
352 return map;
356 * Applies the new map type
362 struct rewrite_map *map,
371 assert( map != NULL );
378 switch ( map->lm_type ) {
381 ( struct rewrite_context * )map->lm_data,
395 rc = rewrite_var_set( &op->lo_vars, map->lm_name,
399 if ( map->lm_type == REWRITE_MAP_SET_OP_VAR ) {
414 var = rewrite_var_find( op->lo_vars, map->lm_name );
434 map->lm_name, key->bv_val );
436 if ( map->lm_type == REWRITE_MAP_SET_SESN_VAR ) {
450 map->lm_name, val );
454 rc = rewrite_param_get( info, map->lm_name, val );
458 struct rewrite_builtin_map *bmap = map->lm_data;
482 struct rewrite_builtin_map *map = ( struct rewrite_builtin_map * )tmp;
484 assert( map != NULL );
486 if ( map->lb_mapper && map->lb_mapper->rm_destroy )
487 map->lb_mapper->rm_destroy( map->lb_private );
489 free( map->lb_name );
490 free( map );
498 struct rewrite_map *map;
503 map = *pmap;
506 ldap_pvt_thread_mutex_lock( &map->lm_mutex );
509 if ( map->lm_name ) {
510 free( map->lm_name );
511 map->lm_name = NULL;
514 if ( map->lm_subst ) {
515 rewrite_subst_destroy( &map->lm_subst );
519 ldap_pvt_thread_mutex_unlock( &map->lm_mutex );
520 ldap_pvt_thread_mutex_destroy( &map->lm_mutex );
523 free( map );
550 const rewrite_mapper *map
562 mappers[num_mappers++] = map;
568 const rewrite_mapper *map
574 if ( mappers[i] == map ) {