~ubuntu-branches/ubuntu/quantal/hexer/quantal

« back to all changes in this revision

Viewing changes to hexer.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Pentchev
  • Date: 2009-09-04 14:46:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090904144646-szhsbyv0vd0hu8gq
Tags: 0.1.5-1
* New upstream release:
  - I adopted the upstream package, too
  - all the patches were integrated upstream
  - the installation directories need to be passed in the environment
  - lots of cleanup
  - fix a crash due to abuse of the v*printf() routines (Closes: #540571)
* No longer use quilt, drop the README.source file.
* Add a Homepage field now that I'm providing one :)
* Use the build hardening wrapper if the "hardening" option is enabled.
* Bump Standards-Version to 3.8.3 with no changes.
* Point the watch file and the copyright file to the new upstream page.
* Update the copyright file.
* Use the DEP 5 format for the copyright file header.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 */
3
3
 
4
4
/* Copyright (c) 1995,1996 Sascha Demetrio
 
5
 * Copyright (c) 2009 Peter Pentchev
5
6
 * All rights reserved.
6
7
 *
7
8
 * Redistribution and use in source and binary forms, with or without
45
46
#ifndef _HEXER_H_
46
47
#define _HEXER_H_
47
48
 
 
49
#include "config.h"
 
50
#include "defs.h"
 
51
 
48
52
#include <stdio.h>
49
 
 
50
 
#include "defs.h"
51
 
#include "config.h"
52
 
#include "buffer.h"
53
 
#include "readline.h"
54
 
#include "regex.h"
55
 
#include "set.h"
 
53
#ifdef USE_STDARG
 
54
#include <stdarg.h>
 
55
#else
 
56
#include <varargs.h>
 
57
#endif
 
58
#if HAVE_ALLOCA
 
59
#if NEED_ALLOCA_H
 
60
#include <alloca.h>
 
61
#endif
 
62
#else
 
63
char *alloca(size_t);
 
64
#endif
56
65
 
57
66
#define TIO_MAP 1
58
 
#include "tio.h"
59
 
 
60
67
 
61
68
#define HE_REFRESH_MAX_PARTS 64
62
69
 
117
124
 
118
125
extern struct he_message_s *he_messages;
119
126
 
120
 
extern void
 
127
void
121
128
#if USE_STDARG
122
129
he_message( int beep, char *fmt, ... );
123
130
#else
124
131
he_message( );
125
132
#endif
126
133
 
127
 
extern void
128
 
he_refresh_part( /* struct he_s *hedit, long pos1, long pos2 */ );
129
 
 
130
 
extern void
131
 
he_refresh_lines( /* struct he_s *hedit, int first, int last */ );
132
 
 
133
 
extern
134
 
he_refresh_check( /* struct he_s *hedit */ );
 
134
void
 
135
he_refresh_part(struct he_s *hedit, long pos1, long pos2);
 
136
 
 
137
void
 
138
he_refresh_lines(struct he_s *hedit, int first, int last);
 
139
 
 
140
int
 
141
he_refresh_check(struct he_s *hedit);
135
142
 
136
143
#define he_refresh_all(hedit) ((void)he_refresh_part((hedit), 0, -1))
137
144
 
138
 
extern void
139
 
he_refresh_screen( /* const struct he_s *hedit */ );
 
145
void
 
146
he_refresh_screen(const struct he_s *hedit);
140
147
 
141
 
extern
142
 
he_update_screen( /* struct he_s *hedit */ );
 
148
int
 
149
he_update_screen(struct he_s *hedit);
143
150
 
144
151
 
145
152
struct he_command_s {
208
215
 *  - The inserted/deleted data.
209
216
 */
210
217
 
211
 
  extern void
212
 
he_free_command( /* struct he_command_s *command */ );
 
218
  void
 
219
he_free_command(struct he_command_s *command);
213
220
  /* Free the memory allocated by command and all the following commands
214
221
   * in the list.
215
222
   */
216
223
 
217
 
  extern void
218
 
he_compound_comand( /* struct he_s *hedit, struct he_command_s *command */ );
 
224
  void
 
225
he_compound_comand(struct he_s *hedit, struct he_command_s *command);
219
226
 
220
 
  extern void
221
 
he_subcommand( /* struct he_s *hedit,
222
 
                  int type, long position, long count, char *data */ );
 
227
  void
 
228
he_subcommand(struct he_s *hedit,
 
229
                  int type, long position, long count, char *data);
223
230
  /* Update the undo-list of `hedit' by inserting the given subcommand.
224
231
   * The command is *not* performed by calling `he_subcommand()'.
225
232
   * A sequence of subcommands must be terminated by calling
228
235
   *   flag will be set to 1.
229
236
   */
230
237
 
231
 
  extern long
232
 
he_do_command( /* struct he_s *hedit, struct he_command_s *command */ );
 
238
  long
 
239
he_do_command(struct he_s *hedit, struct he_command_s *command);
233
240
  /* Perform the compound command `command'.  The return value is the
234
241
   * position of the last change made.
235
242
   */
247
254
  int visited_f;
248
255
};
249
256
 
250
 
extern const struct buffer_s NO_BUFFER;
251
 
extern struct buffer_s *current_buffer;
 
257
extern const struct buffer_s     NO_BUFFER;
 
258
extern char             *alternate_buffer;
 
259
extern struct buffer_s  *current_buffer;
 
260
extern char             *he_pagerprg;
252
261
 
253
262
 
254
263
/* exh commands
255
264
 */
256
265
 
257
 
typedef char *(*exh_fn)( /* struct he_s *, char *, long, long */ );
 
266
typedef char *(*exh_fn)(struct he_s *, char *, long, long);
258
267
 
259
268
struct exh_cmd_s {
260
269
  char *cmd_name;
274
283
 
275
284
#define HE_LINE(x) ((long)(x) >> 4)
276
285
 
277
 
extern
278
 
he_open_buffer( /* char *name, char *path */ );
279
 
 
280
 
extern
281
 
he_select_buffer( /* char *name */ );
282
 
 
283
 
extern
284
 
he_alternate_buffer( /* void */ );
285
 
 
286
 
extern
287
 
he_set_buffer_readonly( /* char *name */ );
 
286
int
 
287
he_open_buffer(char *name, char *path);
 
288
 
 
289
int
 
290
he_select_buffer(char *name);
 
291
 
 
292
int
 
293
he_alternate_buffer(void);
 
294
 
 
295
int
 
296
he_set_buffer_readonly(char *name);
288
297
  /* Return values:
289
298
   * -1: no buffer named `name'
290
299
   * 0:  ok
291
300
   */
292
301
 
293
 
extern
294
 
he_buffer_readonly( /* char *name */ );
 
302
int
 
303
he_buffer_readonly(char *name);
295
304
  /* Return values:
296
305
   * -1: no buffer named `name'
297
306
   * 0:  buffer is readwrite
298
307
   * 1:  buffer is readonly
299
308
   */
300
309
 
301
 
extern
302
 
he_buffer_modified( /* char *name */ );
 
310
int
 
311
he_buffer_modified(char *name);
303
312
  /* Return values:
304
313
   * -1: no buffer named `name'
305
314
   * 0:  buffer saved
306
315
   * 1:  buffer modified
307
316
   */
308
317
 
309
 
extern
310
 
he_close_buffer( /* char *name */ );
 
318
int
 
319
he_close_buffer(char *name);
311
320
  /* Close the buffer named `name'. If `name == 0', the current buffer
312
321
   * is closed.  The return value is 0 if all goes well, 1 if the named
313
322
   * buffer doesn't exist and -1 if the `buffer_list' is empty.
314
323
   */
315
324
 
316
 
extern void
317
 
he_status_message( /* int verbose */ );
 
325
void
 
326
he_status_message(int verbose);
318
327
  /* display name and size of the current buffer.  if `verbose' is set,
319
328
   * the current position is also displayed.
320
329
   */
321
330
 
322
 
extern void
323
 
he_select( /* struct he_s *hedit, long begin, long end */ );
324
 
 
325
 
extern void
326
 
he_cancel_selection( /* struct he_s *hedit */ );
327
 
 
328
 
extern long
329
 
he_search( /* struct he_s *, char *, char *, int, int, int, long,
330
 
              char **, long *, long * */ );
331
 
 
332
 
extern
 
331
void
 
332
he_select(struct he_s *hedit, long begin, long end);
 
333
 
 
334
int
 
335
he_select_buffer_(struct buffer_s *);
 
336
 
 
337
void
 
338
he_cancel_selection(struct he_s *hedit);
 
339
 
 
340
long
 
341
he_search(struct he_s *, char *, char *, int, int, int, long,
 
342
              char **, long *, long *);
 
343
 
 
344
void
 
345
he_search_command(struct he_s *, char *, int);
 
346
 
 
347
char *
 
348
he_query_command(char *, char *, int);
 
349
 
 
350
int
333
351
#if USE_STDARG
334
352
he_query_yn( int dfl, char *fmt, ... );
335
353
#else
336
354
he_query_yn( );
337
355
#endif
338
356
 
339
 
extern
340
 
he_mainloop( /* struct he_s *hedit */ );
341
 
 
342
 
extern
343
 
hexer( /* void */ );
 
357
int
 
358
he_mainloop(struct he_s *hedit);
 
359
 
 
360
int
 
361
hexer(void);
 
362
 
 
363
void             hexer_init(void);
 
364
void             hexer_version(void);
344
365
 
345
366
#endif
346
367
 
349
370
 
350
371
/* VIM configuration: (do not delete this line)
351
372
 *
352
 
 * vim:aw:bk:bdir=./bak:ch=2:nodg:ef=make.log:efm=%f\:%l\:%m:et:hid:icon:
353
 
 * vim:sw=2:sc:sm:si:textwidth=79:to:ul=1024:wh=12:wrap:wb:
 
373
 * vim:bk:nodg:efm=%f\:%l\:%m:hid:icon:
 
374
 * vim:sw=2:sm:textwidth=79:ul=1024:wrap:
354
375
 */