/* ----------------------------------------------------------------------- * * * Copyright 1996-2019 The NASM Authors - All Rights Reserved * See the file AUTHORS included with the NASM distribution for * the specific copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following * conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ----------------------------------------------------------------------- */ /* * listing.h header file for listing.c */ #ifndef NASM_LISTING_H #define NASM_LISTING_H #include "nasm.h" /* * List-file generators should look like this: */ struct lfmt { … }; extern const struct lfmt *lfmt; extern bool user_nolist; /* * list_options are the requested options; active_list_options gets * set when a pass starts. * * These are simple bitmasks of ASCII-64 mapping directly to option * letters. */ extern uint64_t list_options, active_list_options; /* * This maps the characters a-z, A-Z and 0-9 onto a 64-bit bitmask * (with two bits left over for future use! This isn't particularly * efficient code, but just about every instance of it should be * fed a constant, so the entire function can be precomputed at * compile time. The only cases where the full computation is needed * is when parsing the -L option or %pragma list options, neither of * which is in any way performance critical. * * The character + represents ALL listing options. * * This returns 0 for invalid values, so that no bit is accessed * for unsupported characters. */ static inline const_func uint64_t list_option_mask(unsigned char x) { … } static inline pure_func bool list_option(unsigned char x) { … } /* We can't test this using active_list_options for obvious reasons... */ static inline pure_func bool list_on_every_pass(void) { … } /* Pragma handler */ enum directive_result list_pragma(const struct pragma *); #endif