FFmpeg
Loading...
Searching...
No Matches
mscl.c File Reference
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/macros.h"
#include <errno.h>
#include <sys/wait.h>
#include <unistd.h>

Go to the source code of this file.

Macros

#define INC_PREFIX   "Note: including file:"
 

Functions

static void die (const char *msg)
 
static void * xrealloc (void *ptr, size_t size)
 
static char * xstrdup (const char *s)
 
static FILE * open_wb (const char *path)
 
static int unlink_file (const char *path)
 
static int replace_file (const char *from, const char *to)
 
static const char * file_basename (const char *p)
 
static int is_source (const char *arg)
 
static int chr_eq (char a, char b)
 
static size_t root_len (const char *p)
 
static char * make_relative (const char *path)
 
static void add_dep (char *path)
 
static char * path_helper (const char *prog, const char *root)
 
static char * host_path (const char *path)
 
static void add_include (char *p)
 
static void process_line (char *line)
 
static void feed (const char *buf, size_t n)
 
static void feed_flush (void)
 
static void init_deps (void)
 
static int run (char **args)
 
static void fput_escaped (const char *s, FILE *f)
 
static int write_depfile (void)
 
int main (int argc, char **argv)
 

Variables

static const char * obj
 
static const char * src
 
static char * cwd
 
static char ** deps
 
static size_t nb_deps
 
static size_t max_deps
 
static char * linebuf
 
static size_t line_len
 
static size_t line_max
 
static const char * unmapped
 
struct { 
 
   char *   root 
 
   char *   host 
 
} * roots 
 
static size_t nb_roots
 

Macro Definition Documentation

◆ INC_PREFIX

#define INC_PREFIX   "Note: including file:"

Definition at line 55 of file mscl.c.

Referenced by process_line().

Function Documentation

◆ die()

static void die ( const char * msg)
static

Definition at line 68 of file mscl.c.

Referenced by init_deps(), main(), path_helper(), run(), and xrealloc().

◆ xrealloc()

static void * xrealloc ( void * ptr,
size_t size )
static

Definition at line 74 of file mscl.c.

Referenced by add_dep(), feed(), host_path(), init_deps(), make_relative(), run(), write_depfile(), and xstrdup().

◆ xstrdup()

static char * xstrdup ( const char * s)
static

Definition at line 82 of file mscl.c.

Referenced by add_include(), host_path(), and path_helper().

◆ open_wb()

static FILE * open_wb ( const char * path)
static

Definition at line 150 of file mscl.c.

Referenced by write_depfile().

◆ unlink_file()

static int unlink_file ( const char * path)
static

Definition at line 155 of file mscl.c.

Referenced by main(), and write_depfile().

◆ replace_file()

static int replace_file ( const char * from,
const char * to )
static

Definition at line 160 of file mscl.c.

Referenced by write_depfile().

◆ file_basename()

static const char * file_basename ( const char * p)
static

Definition at line 167 of file mscl.c.

Referenced by is_source(), and main().

◆ is_source()

static int is_source ( const char * arg)
static

Definition at line 175 of file mscl.c.

Referenced by main().

◆ chr_eq()

static int chr_eq ( char a,
char b )
static

Definition at line 189 of file mscl.c.

Referenced by make_relative().

◆ root_len()

static size_t root_len ( const char * p)
static

Definition at line 200 of file mscl.c.

Referenced by add_include(), host_path(), and make_relative().

◆ make_relative()

static char * make_relative ( const char * path)
static

Definition at line 216 of file mscl.c.

Referenced by add_include().

◆ add_dep()

static void add_dep ( char * path)
static

Definition at line 254 of file mscl.c.

Referenced by add_include().

◆ path_helper()

static char * path_helper ( const char * prog,
const char * root )
static

Definition at line 278 of file mscl.c.

Referenced by host_path().

◆ host_path()

static char * host_path ( const char * path)
static

Definition at line 325 of file mscl.c.

Referenced by add_include().

◆ add_include()

static void add_include ( char * p)
static

Definition at line 365 of file mscl.c.

Referenced by process_line().

◆ process_line()

static void process_line ( char * line)
static

Definition at line 398 of file mscl.c.

Referenced by feed(), and feed_flush().

◆ feed()

static void feed ( const char * buf,
size_t n )
static

Definition at line 417 of file mscl.c.

Referenced by parse_stream(), and run().

◆ feed_flush()

static void feed_flush ( void )
static

Definition at line 434 of file mscl.c.

Referenced by run().

◆ init_deps()

static void init_deps ( void )
static

Definition at line 443 of file mscl.c.

Referenced by main().

◆ run()

static int run ( char ** args)
static

Definition at line 592 of file mscl.c.

◆ fput_escaped()

static void fput_escaped ( const char * s,
FILE * f )
static

Definition at line 645 of file mscl.c.

Referenced by write_depfile().

◆ write_depfile()

static int write_depfile ( void )
static

Definition at line 657 of file mscl.c.

Referenced by main().

◆ main()

int main ( int argc,
char ** argv )

Definition at line 703 of file mscl.c.

Variable Documentation

◆ obj

const char* obj
static

Definition at line 57 of file mscl.c.

Referenced by alf_free(), av_container_fifo_alloc(), av_container_fifo_free(), av_container_fifo_read(), av_container_fifo_write(), av_opt_child_next(), av_opt_eval_double(), av_opt_eval_flags(), av_opt_eval_float(), av_opt_eval_int(), av_opt_eval_int64(), av_opt_eval_q(), av_opt_eval_uint(), av_opt_find(), av_opt_find2(), av_opt_flag_is_set(), av_opt_free(), av_opt_get(), av_opt_get_array(), av_opt_get_array_size(), av_opt_get_chlayout(), av_opt_get_dict_val(), av_opt_get_double(), av_opt_get_image_size(), av_opt_get_int(), av_opt_get_pixel_fmt(), av_opt_get_q(), av_opt_get_sample_fmt(), av_opt_get_video_rate(), av_opt_is_set_to_default(), av_opt_is_set_to_default_by_name(), av_opt_next(), av_opt_query_ranges(), av_opt_query_ranges_default(), av_opt_serialize(), av_opt_set(), av_opt_set_array(), av_opt_set_bin(), av_opt_set_chlayout(), av_opt_set_dict(), av_opt_set_dict2(), av_opt_set_dict_val(), av_opt_set_double(), av_opt_set_image_size(), av_opt_set_int(), av_opt_set_pixel_fmt(), av_opt_set_q(), av_opt_set_sample_fmt(), av_opt_set_video_rate(), av_opt_show2(), av_refstruct_alloc_ext(), av_refstruct_alloc_ext_c(), av_refstruct_exclusive(), av_refstruct_pool_alloc_ext(), av_refstruct_pool_alloc_ext_c(), av_refstruct_ref(), av_refstruct_ref_c(), av_refstruct_unref(), avio_child_next(), bsf_child_next(), bsf_child_next(), cbs_free_user_data_registered(), cbs_free_user_data_unregistered(), cget_refcount(), child_next(), child_next(), codec_child_next(), compare(), container_fifo_free_entry(), container_fifo_init_entry(), container_fifo_reset_entry(), container_packet_free(), container_packet_reset(), d3d12va_discard_helper_objects(), d3d12va_get_valid_helper_objects(), dec_item_name(), decklink_object_free(), decode_data_free(), dpb_image_free(), dpb_image_init(), enc_item_name(), ff_d3d12va_decode_uninit(), ff_dnn_child_next(), ff_dnn_filter_child_next(), ff_objc_release(), ff_parse_opts_from_query_string(), ff_pthread_free(), ff_pthread_init(), ff_sws_vk_uninit(), ff_vk_exec_add_dep_obj(), ff_vk_exec_add_dep_refstruct(), ff_vk_exec_move_dep_refstruct(), fg_item_name(), filter_child_next(), find_opt(), format_child_next(), frame_free(), frame_pool_free(), frame_reset(), free_additional_info(), free_apic(), free_buffer(), free_chapter(), free_common(), free_encoded_data(), free_geobtag(), free_picture_config(), free_priv(), free_progress(), free_vlc_tables(), get_format(), get_number(), get_opt_const_name(), get_opt_flags_string(), get_refcount(), hevc_pps_free(), hevc_sps_free(), hevc_vps_free(), host_map_free(), input_file_item_name(), input_stream_group_item_name(), input_stream_item_name(), item_name(), lcevc_frame_free_entry_cb(), lcevc_frame_init_cb(), lcevc_frame_reset_cb(), lcevc_free(), log_default(), main(), mids_buf_free(), mpv_pic_free(), mpv_pic_init(), mpv_pic_reset(), nvdec_decoder_frame_init(), nvdec_decoder_free(), of_serialize_options(), ofilter_item_name(), oh_decode_release(), opt_find(), opt_list(), opt_serialize(), opt_set_array(), opt_set_elem(), opt_set_init(), output_file_item_name(), output_stream_item_name(), planes_free(), pooled_buf_free(), pps_free(), pps_free(), progress_frame_pool_free_entry_cb(), progress_frame_pool_init_cb(), progress_frame_pool_reset_cb(), refcount_init(), refstruct_pool_uninit(), resample_child_next(), reset_imageviews(), rkmpp_release_decoder(), scale2ref_child_next(), set_format(), set_number(), set_string(), set_string_binary(), set_string_bool(), set_string_channel_layout(), set_string_color(), set_string_dict(), set_string_fmt(), set_string_image_size(), set_string_number(), set_string_pixel_fmt(), set_string_sample_fmt(), set_string_video_rate(), sps_free(), stream_group_child_next(), submix_element_child_next(), submix_presentation_child_next(), sws_filter_free(), test_child_next(), textcontext_child_next(), urlcontext_child_next(), vaapi_encode_alloc_output_buffer(), vaapi_encode_free_output_buffer(), vk_decode_free_params(), write_depfile(), write_number(), and writercontext_child_next().

◆ src

const char* src
static

Definition at line 58 of file mscl.c.

◆ cwd

char* cwd
static

Definition at line 60 of file mscl.c.

Referenced by init_deps(), and make_relative().

◆ deps

char** deps
static

Definition at line 62 of file mscl.c.

Referenced by add_dep(), print_deps(), and write_depfile().

◆ nb_deps

size_t nb_deps
static

Definition at line 63 of file mscl.c.

Referenced by add_dep(), and write_depfile().

◆ max_deps

size_t max_deps
static

Definition at line 63 of file mscl.c.

Referenced by add_dep().

◆ linebuf

char* linebuf
static

Definition at line 65 of file mscl.c.

Referenced by checkasm_check_inner_add_yblock(), feed(), feed_flush(), and init_deps().

◆ line_len

size_t line_len
static

◆ line_max

size_t line_max
static

Definition at line 66 of file mscl.c.

Referenced by feed(), and init_deps().

◆ unmapped

const char* unmapped
static

Definition at line 268 of file mscl.c.

Referenced by add_include(), and write_depfile().

◆ root

◆ host

◆ [struct]

struct { ... } * roots

Referenced by host_path().

◆ nb_roots

size_t nb_roots
static

Definition at line 276 of file mscl.c.

Referenced by host_path().