This file is indexed.

/usr/include/libspreadsheet-1.12/spreadsheet/search.h is in gnumeric 1.12.28-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _GNM_SEARCH_H_
# define _GNM_SEARCH_H_

#include <gnumeric.h>
#include <position.h>
#include <numbers.h>
#include <goffice/goffice.h>

G_BEGIN_DECLS

char *gnm_search_normalize (const char *txt);

#define GNM_SEARCH_REPLACE_TYPE        (gnm_search_replace_get_type ())
#define GNM_SEARCH_REPLACE(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_SEARCH_REPLACE_TYPE, GnmSearchReplace))
#define GNM_IS_SEARCH_REPLACE(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_SEARCH_REPLACE_TYPE))

typedef enum {
	GNM_SRE_FAIL = 0,
	GNM_SRE_SKIP,
	GNM_SRE_QUERY,
	GNM_SRE_ERROR,
	GNM_SRE_STRING
} GnmSearchReplaceError;

typedef enum {
	GNM_SRS_WORKBOOK = 0,
	GNM_SRS_SHEET,
	GNM_SRS_RANGE
} GnmSearchReplaceScope;
GType gnm_search_replace_scope_get_type (void);
#define GNM_SEARCH_REPLACE_SCOPE_TYPE (gnm_search_replace_scope_get_type ())

typedef enum {
	GNM_SRQ_FAIL,
	GNM_SRQ_QUERY,
	GNM_SRQ_QUERY_COMMENT
} GnmSearchReplaceQuery;

typedef enum {
	GNM_SRL_CONTENTS,
	GNM_SRL_VALUE,
	GNM_SRL_COMMENT
} GnmSearchReplaceLocus;

typedef  int (*GnmSearchReplaceQueryFunc) (GnmSearchReplaceQuery q, GnmSearchReplace *sr, ...);

struct _GnmSearchReplace {
	GOSearchReplace base;

	GnmSearchReplaceScope scope;
	char *range_text;

	/*
	 * This is the default sheet for the range and used also to locate
	 * a workbook.
	 */
	Sheet *sheet;

	gboolean query;		/* Ask before each change.  */

	gboolean is_number;     /* Search for specific number.  */
	gnm_float low_number, high_number;   /* protected. */

	/* The following identify what kinds of cells are the target.  */
	gboolean search_strings;
	gboolean search_other_values;
	gboolean search_expressions;
	gboolean search_expression_results;
	gboolean search_comments;
	gboolean search_scripts;
	gboolean invert;

	GnmSearchReplaceError error_behaviour;
	gboolean replace_keep_strings;

	/*
	 * If true:  A1,B1,...,A2,B2,...
	 * If false: A1,A2,...,B1,B2,...
	 */
	gboolean by_row;

	/*
	 * Query and info function.
	 *
	 * GNM_SRQ_FAIL (..., GnmCell *cell, char const *old, char const *new)
	 *   Inform the user that an error occurred in GNM_SRE_FAIL mode.
	 *
	 * GNM_SRQ_QUERY (..., GnmCell *cell, char const *old, char const *new)
	 *   Ask user whether to change.  GTK_RESPONSE_(YES|NO|CANCEL)
	 *
	 * GNM_SRQ_QUERY_COMMENT (..., Sheet *sheet, CellPos *cp,
	 *                    char const *old, char const *new)
	 *   Ask user whether to change.  GTK_RESPONSE_(YES|NO|CANCEL)
	 */
	GnmSearchReplaceQueryFunc query_func;
	void *user_data;
};

GType gnm_search_replace_get_type (void);

char *gnm_search_replace_verify (GnmSearchReplace *sr, gboolean repl);

GPtrArray *gnm_search_collect_cells (GnmSearchReplace *sr);
void gnm_search_collect_cells_free (GPtrArray *cells);

typedef struct {
	GnmEvalPos ep;
	GnmSearchReplaceLocus locus;
} GnmSearchFilterResult;
GPtrArray *gnm_search_filter_matching (GnmSearchReplace *sr, GPtrArray const *cells);
void gnm_search_filter_matching_free (GPtrArray *matches);

typedef struct {
	GnmComment *comment;
	char const *old_text;
	char *new_text; /* Caller must free if replacing and found.  */
} GnmSearchReplaceCommentResult;
gboolean gnm_search_replace_comment (GnmSearchReplace *sr,
				     GnmEvalPos const *ep,
				     gboolean repl,
				     GnmSearchReplaceCommentResult *res);

typedef struct {
	GnmCell *cell;
	char *old_text; /* Caller must free.  */
	char *new_text; /* Caller must free if replacing and found.  */
} GnmSearchReplaceCellResult;
gboolean gnm_search_replace_cell (GnmSearchReplace *sr,
				  GnmEvalPos const *ep,
				  gboolean repl,
				  GnmSearchReplaceCellResult *res);

void gnm_search_replace_query_fail (GnmSearchReplace *sr,
				    const GnmSearchReplaceCellResult *res);

int gnm_search_replace_query_cell (GnmSearchReplace *sr,
				   const GnmSearchReplaceCellResult *res);

int gnm_search_replace_query_comment (GnmSearchReplace *sr,
				      const GnmEvalPos *ep,
				      const GnmSearchReplaceCommentResult *res);

G_END_DECLS

#endif /* _GNM_SEARCH_H_ */