ARB
AW_help.cxx
Go to the documentation of this file.
1 // ================================================================ //
2 // //
3 // File : AW_help.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ================================================================ //
10 
11 #include "aw_awar.hxx"
12 #include "aw_window.hxx"
13 #include "aw_edit.hxx"
14 #include "aw_root.hxx"
15 #include "aw_global_awars.hxx"
16 #include "aw_msg.hxx"
17 #include "aw_select.hxx"
18 
19 #include <arb_file.h>
20 #include <arb_strarray.h>
21 
22 #include <sys/stat.h>
23 #include <arb_str.h>
24 
25 
26 #define AWAR_HELP "tmp/help/"
27 #define AWAR_HELPFILE AWAR_HELP "file"
28 #define AWAR_HELPTEXT AWAR_HELP "text"
29 #define AWAR_HELPSEARCH AWAR_HELP "search"
30 
31 static const char *develDocPath() {
32  return GB_path_in_ARBHOME("HELP_SOURCE/source");
33 }
34 
35 void AW_openURL(AW_root *aw_root, const char *url) {
36  GB_CSTR ka;
37  char *browser = aw_root->awar(AWAR_WWW_BROWSER)->read_string();
38 
39  while ((ka = GBS_find_string(browser, "$(URL)", 0))) {
40  char *start = ARB_strpartdup(browser, ka-1);
41  char *new_browser = GBS_global_string_copy("%s%s%s", start, url, ka+6);
42 
43  free(start);
44  freeset(browser, new_browser);
45  }
46 
47  char *command = GBS_global_string_copy("(%s)&", browser);
48  GB_ERROR error = GBK_system(command); // @@@ use AWT_system_cb here? (need to move whole module -> AWT)
49  aw_message_if(error);
50 
51  free(command);
52  free(browser);
53 }
54 
55 // --------------------
56 // help window
57 
58 static struct {
61  char *history;
62 } HELP;
63 
64 static char *get_full_qualified_help_file_name(const char *helpfile, bool path_for_edit = false) {
66  const char *user_doc_path = GB_getenvDOCPATH();
67  char *devel_doc_path = strdup(develDocPath());
68  size_t user_doc_path_len = strlen(user_doc_path);
69  size_t devel_doc_path_len = strlen(devel_doc_path);
70 
71  const char *rel_path = NULp;
72  if (strncmp(helpfile, user_doc_path, user_doc_path_len) == 0 && helpfile[user_doc_path_len] == '/') {
73  rel_path = helpfile+user_doc_path_len+1;
74  }
75  else if (strncmp(helpfile, devel_doc_path, devel_doc_path_len) == 0 && helpfile[devel_doc_path_len] == '/') {
76  aw_assert(0); // when does this happen ? never ?
77  rel_path = helpfile+devel_doc_path_len+1;
78  }
79 
80  if (helpfile[0]=='/' && !rel_path) {
81  result = GBS_static_string(helpfile);
82  }
83  else {
84  if (!rel_path) rel_path = helpfile;
85 
86  if (rel_path[0]) {
87  if (path_for_edit) {
88 #if defined(DEBUG)
89  char *gen_doc_path = strdup(GB_path_in_ARBHOME("HELP_SOURCE/genhelp"));
90 
91  char *devel_source = GBS_global_string_copy("%s/%s", devel_doc_path, rel_path);
92  char *gen_source = GBS_global_string_copy("%s/%s", gen_doc_path, rel_path);
93 
94  int devel_size = GB_size_of_file(devel_source);
95  int gen_size = GB_size_of_file(gen_source);
96 
97  aw_assert(devel_size <= 0 || gen_size <= 0); // only one of them shall exist
98 
99  if (gen_size>0) {
100  result = GBS_static_string(gen_source); // edit generated doc
101  }
102  else {
103  result = GBS_static_string(devel_source); // use normal help source (may be non-existing)
104  }
105 
106  free(gen_source);
107  free(devel_source);
108  free(gen_doc_path);
109 #else
110  result = GBS_global_string("%s/%s", user_doc_path, rel_path); // use real help file in RELEASE
111 #endif // DEBUG
112  }
113  else {
114  result = GBS_global_string("%s/%s", user_doc_path, rel_path);
115  }
116  }
117  else {
118  result = "";
119  }
120  }
121 
122  free(devel_doc_path);
123 
124  return strdup(result);
125 }
126 
127 static char *get_full_qualified_help_file_name(AW_root *awr, bool path_for_edit = false) {
128  char *helpfile = awr->awar(AWAR_HELPFILE)->read_string();
129  char *qualified = get_full_qualified_help_file_name(helpfile, path_for_edit);
130  free(helpfile);
131  return qualified;
132 }
133 
134 static char *get_local_help_url(AW_root *awr) {
135  char *helpfile = get_full_qualified_help_file_name(awr, false);
136  const char *user_doc_path = GB_getenvDOCPATH();
137  const char *user_htmldoc_path = GB_getenvHTMLDOCPATH();
138  size_t user_doc_path_len = strlen(user_doc_path);
139  char *result = NULp;
140 
141  if (strncmp(helpfile, user_doc_path, user_doc_path_len) == 0) { // "real" help file
142  result = GBS_global_string_copy("%s%s_", user_htmldoc_path, helpfile+user_doc_path_len);
143  size_t result_len = strlen(result);
144 
145  aw_assert(result_len > 5);
146 
147  if (strcmp(result+result_len-5, ".hlp_") == 0) {
148  strcpy(result+result_len-5, ".html");
149  }
150  else {
151  freenull(result);
152  GB_export_error("Can't browse that file type.");
153  }
154  }
155  else { // on-the-fly-generated help file (e.g. search help)
156  GB_export_error("Can't browse temporary help node");
157  }
158 
159  free(helpfile);
160 
161  return result;
162 }
163 
164 #if defined(NDEBUG)
165 static void store_helpfile_in_tarball(const char *path, const char *mode) {
166  GB_ERROR error = NULp;
167  const char *base = GB_getenvDOCPATH();
168 
169  if (ARB_strBeginsWith(path, base)) {
170  char *cmd = GBS_global_string_copy("arb_help_useredit.sh %s %s", path+strlen(base)+1, mode);
171  error = GBK_system(cmd);
172  }
173  else {
174  error = "Unexpected helpfile name (in store_helpfile_in_tarball)";
175  }
176 
177  if (error) aw_message(error);
178 }
179 static void aw_helpfile_modified_cb(const char *path) {
180  static enum { UNMODIFIED, MODIFIED, NOTIFIED } state = UNMODIFIED;
181 
182  store_helpfile_in_tarball(path, "end");
183  if (state == UNMODIFIED) state = MODIFIED;
184 
185  if (state == MODIFIED) {
186  aw_message("Your changes to ARB help have been stored in an archive.\n"
187  "See console for what to send to ARB developers!");
188  state = NOTIFIED;
189  }
190 }
191 #endif
192 
193 
194 static void aw_help_edit_help(AW_window *aww) {
195  char *helpfile = get_full_qualified_help_file_name(aww->get_root(), true);
196 
197  if (GB_size_of_file(helpfile)<=0) {
198 #if defined(NDEBUG)
199  const char *base = GB_getenvDOCPATH();
200 #else
201  const char *base = develDocPath();
202 #endif
203 
204  if (GB_is_directory(base)) {
205  const char *copy_cmd = GBS_global_string("cp %s/FORM.hlp %s", base, helpfile); // uses_hlp_res("FORM.hlp"); see ../SOURCE_TOOLS/check_resources.pl@uses_hlp_res
206  aw_message_if(GBK_system(copy_cmd)); // @@@ use AWT_system_cb here (after move)
207  }
208  }
209 
210  if (!GB_is_regularfile(helpfile)) {
211  aw_message(GBS_global_string("Cannot edit '%s' (no such file)", helpfile));
212  }
213  else {
214 #if defined(NDEBUG)
215  store_helpfile_in_tarball(helpfile, "start");
216 
217  if (!GB_is_writeablefile(helpfile)) {
218  aw_message("Warning: you do not have the permission to save changes to that helpfile\n"
219  "(ask your admin to gain write access)");
220  }
221 
222  AW_edit_notified(helpfile, makeFileChangedCallback(aw_helpfile_modified_cb));
223 #else
224  AW_edit(helpfile);
225 #endif
226  }
227  free(helpfile);
228 }
229 
230 static char *aw_ref_to_title(const char *ref) {
231  if (!ref) return NULp;
232 
233  if (GBS_string_matches(ref, "*.ps", GB_IGNORE_CASE)) { // Postscript file
234  return GBS_global_string_copy("Postscript: %s", ref);
235  }
236 
237  char *result = NULp;
238  char *file = NULp;
239  {
240  char *helpfile = get_full_qualified_help_file_name(ref);
241  file = GB_read_file(helpfile);
242  free(helpfile);
243  }
244 
245  if (file) {
246  result = GBS_string_eval(file, "*\nTITLE*\n*=*2:\t=");
247  if (strcmp(file, result)==0) freenull(result);
248  free(file);
249  }
250  else {
251  GB_clear_error();
252  }
253 
254  if (!result) {
255  result = strdup(ref);
256  }
257 
258  return result;
259 }
260 
262  char *history = HELP.history;
263  if (history) {
264  const char *sep = strchr(history, '#');
265  char *lastHelp = sep ? ARB_strpartdup(history, sep-1) : strdup(history);
266 
267  aw_root->awar(AWAR_HELPFILE)->write_string(lastHelp);
268  free(lastHelp);
269  }
270 }
271 
272 static void aw_help_back(AW_window *aww) {
273  AW_root *aw_root = aww->get_root();
274  const char *history = HELP.history;
275  if (history) {
276  const char *currHelp = aw_root->awar(AWAR_HELPFILE)->read_char_pntr();
277  if (currHelp[0]) { // if showing some help
278  const char *sep = strchr(history, '#');
279  if (sep) {
280  char *first = ARB_strpartdup(history, sep-1);
281  freeset(HELP.history, GBS_global_string_copy("%s#%s", sep+1, first)); // wrap first to end
282  free(first);
284  }
285  }
286  else { // e.g. inside history
288  }
289  }
290 }
291 
292 static void aw_help_history(AW_window *aww) {
293  ConstStrArray entries;
294  GBT_split_string(entries, HELP.history, '#');
295 
296  if (entries.size()) {
297  AW_root *aw_root = aww->get_root();
298  const char *currHelp = aw_root->awar(AWAR_HELPFILE)->read_char_pntr();
299 
300  if (currHelp[0]) {
301  aw_root->awar(AWAR_HELPFILE)->write_string("");
302 
303  HELP.uplinks->clear();
304  HELP.links->clear();
305 
306  for (size_t i = 0; i<entries.size(); ++i) {
307  char *title = aw_ref_to_title(entries[i]);
308  HELP.links->insert(title, entries[i]);
309  free(title);
310  }
311 
312  HELP.uplinks->insert_default(" ", ""); HELP.uplinks->update();
313  HELP.links ->insert_default(" ", ""); HELP.links ->update();
314 
315  aw_root->awar(AWAR_HELPTEXT)->write_string("Your previously visited help topics are listed under 'Subtopics'");
316  }
317  else { // e.g. already in HISTORY
318  aw_help_back(aww);
319  }
320  }
321 }
322 
323 static GB_ERROR aw_help_show_external_format(const char *help_file, const char *viewer) {
324  // Called to show *.ps or *.pdf in external viewer.
325  // Can as well show *.suffix.gz (decompresses to temporary *.suffix)
326 
327  struct stat st;
328  GB_ERROR error = NULp;
329  char sys[1024];
330 
331  sys[0] = 0;
332 
333  if (stat(help_file, &st) == 0) { // *.ps exists
334  GBS_global_string_to_buffer(sys, sizeof(sys), "%s %s &", viewer, help_file);
335  }
336  else {
337  char *compressed = GBS_global_string_copy("%s.gz", help_file);
338 
339  if (stat(compressed, &st) == 0) { // *.ps.gz exists
340  char *name_ext;
341  GB_split_full_path(compressed, NULp, NULp, &name_ext, NULp);
342  // 'name_ext' contains xxx.ps or xxx.pdf
343  char *name, *suffix;
344  GB_split_full_path(name_ext, NULp, NULp, &name, &suffix);
345 
346  char *tempname = GB_unique_filename(name, suffix);
347  char *uncompressed = GB_create_tempfile(tempname);
348 
349  GBS_global_string_to_buffer(sys, sizeof(sys),
350  "(gunzip <%s >%s ; %s %s ; rm %s) &",
351  compressed, uncompressed,
352  viewer, uncompressed,
353  uncompressed);
354 
355  free(uncompressed);
356  free(tempname);
357  free(name);
358  free(suffix);
359  free(name_ext);
360  }
361  else {
362  error = GBS_global_string("Neither %s nor %s exists", help_file, compressed);
363  }
364  free(compressed);
365  }
366 
367  if (sys[0] && !error) error = GBK_system(sys);
368 
369  return error;
370 }
371 
372 #if defined(DEBUG)
373 # define TRACK_HELPFILE
374 // # define AUTOBUILD_CHANGED_HELPFILE
375 #endif
376 
377 #if defined(TRACK_HELPFILE)
378 // automatically update helpfile after changes in DEBUG mode
379 
380 static bool track_helpfile = false;
381 static unsigned long helpfile_stamp = 0;
382 static unsigned long helpfile_edited_stamp = 0;
383 
384 const unsigned TRACK_FREQUENCY = 500; // ms
385 
386 static unsigned autorefresh_helpfile(AW_root *awr) {
387  char *help_file = get_full_qualified_help_file_name(awr);
388  unsigned callAgainIn = TRACK_FREQUENCY;
389 
390  if (help_file[0]) {
391  unsigned long lastChanged = GB_time_of_file(help_file);
392 
393  if (lastChanged != helpfile_stamp) {
394  awr->awar(AWAR_HELPFILE)->touch(); // reload
395  aw_assert(helpfile_stamp == lastChanged);
396  }
397 #if defined(AUTOBUILD_CHANGED_HELPFILE)
398  else { // automatically make help
399  char *edited_help_file = get_full_qualified_help_file_name(awr, true);
400  if (strcmp(help_file, edited_help_file) != 0) {
401  unsigned long editLastChanged = GB_time_of_file(edited_help_file);
402 
403  if (editLastChanged>helpfile_edited_stamp) {
404  GB_ERROR error = GBK_system("cd $ARBHOME; make help"); // @@@ use AWT_system_cb here (after move)
405  if (error) aw_message(error);
406  helpfile_edited_stamp = editLastChanged;
407  callAgainIn = 10;
408  }
409  }
410 
411  free(edited_help_file);
412  }
413 #endif
414  }
415  free(help_file);
416 
417  return callAgainIn;
418 }
419 
420 #endif
421 
423  char *help_file = get_full_qualified_help_file_name(awr);
424 
425 #if defined(TRACK_HELPFILE)
426  track_helpfile = false;
427 #endif
428 
429  if (!strlen(help_file)) {
430  awr->awar(AWAR_HELPTEXT)->write_string("Select one of the topics from the lists on the left side or\n"
431  "press the BACK button above.");
432  }
433  else if (GBS_string_matches(help_file, "*.ps", GB_IGNORE_CASE)) { // Postscript file
435  if (error) aw_message(error);
437  }
438  else if (GBS_string_matches(help_file, "*.pdf", GB_IGNORE_CASE)) { // PDF file
440  if (error) aw_message(error);
442  }
443  else {
444  if (HELP.history) {
445  if (strncmp(help_file, HELP.history, strlen(help_file)) != 0) {
446  // remove current help from history (if present) and prefix it to history
447  char *srt = GBS_global_string_copy("*#%s*=*1*2:*=%s#*1", help_file, help_file);
448  char *h = GBS_string_eval(HELP.history, srt);
449 
450  aw_assert(h);
451  freeset(HELP.history, h);
452  free(srt);
453  }
454  }
455  else {
456  HELP.history = strdup(help_file);
457  }
458 
459 #if defined(TRACK_HELPFILE)
460  track_helpfile = true;
461  helpfile_edited_stamp = helpfile_stamp = GB_time_of_file(help_file);
462 #endif
463 
464  char *helptext = GB_read_file(help_file);
465  if (helptext) {
466  char *ptr;
467  char *h, *h2, *tok;
468 
469  ptr = strdup(helptext);
470  HELP.uplinks->clear();
471  h2 = GBS_find_string(ptr, "\nUP", 0);
472  while ((h = h2)) {
473  h2 = GBS_find_string(h2+1, "\nUP", 0);
474  tok = strtok(h+3, " \n\t"); // now I got UP
475  char *title = aw_ref_to_title(tok);
476  if (tok) HELP.uplinks->insert(title, tok);
477  free(title);
478  }
479  free(ptr);
480  HELP.uplinks->insert_default(" ", "");
481  HELP.uplinks->update();
482 
483  ptr = strdup(helptext);
484  HELP.links->clear();
485  h2 = GBS_find_string(ptr, "\nSUB", 0);
486  while ((h = h2)) {
487  h2 = GBS_find_string(h2+1, "\nSUB", 0);
488  tok = strtok(h+4, " \n\t"); // now I got SUB
489  char *title = aw_ref_to_title(tok);
490  if (tok) HELP.links->insert(title, tok);
491  free(title);
492  }
493  free(ptr);
494  HELP.links->insert_default(" ", "");
495  HELP.links->update();
496 
497  ptr = GBS_find_string(helptext, "TITLE", 0);
498  if (!ptr) ptr = helptext;
499  ptr = GBS_string_eval(ptr, "{*\\:*}=*2");
500 
501  awr->awar(AWAR_HELPTEXT)->write_string(ptr);
502  free(ptr);
503  free(helptext);
504  }
505  else {
506  char *msg = GBS_global_string_copy("I cannot find the help file '%s'\n\n"
507  "Please help us to complete the ARB-Help by submitting\n"
508  "this missing helplink via ARB_NT/File/About/SubmitBug\n"
509  "Thank you.\n"
510  "\n"
511  "Details:\n"
512  "%s",
513  help_file, GB_await_error());
514  awr->awar(AWAR_HELPTEXT)->write_string(msg);
515  free(msg);
516  }
517  }
518  free(help_file);
519 }
520 
521 static void aw_help_browse(AW_window *aww) {
522  char *help_url = get_local_help_url(aww->get_root());
523  if (help_url) {
524  AW_openURL(aww->get_root(), help_url);
525  free(help_url);
526  }
527  else {
528  aw_message(GBS_global_string("Can't detect URL of help file\n(Reason: %s)", GB_await_error()));
529  }
530 }
531 
532 static void aw_help_search(AW_window *aww) {
533  GB_ERROR error = NULp;
534  char *searchtext = aww->get_root()->awar(AWAR_HELPSEARCH)->read_string();
535 
536  if (searchtext[0]==0) error = "Empty searchstring";
537  else {
538  char *helpfilename = NULp;
539  static char *last_help; // tempfile containing last search result
540 
541  // replace all spaces in 'searchtext' by '.*' (also eliminate multi-spaces)
542  freeset(searchtext, GBS_string_eval(searchtext, " = : =.*"));
543 
545 
546  // grep .hlp for occurrences of 'searchtext'.
547  // write filenames of matching files into 'helpfilename'
548  {
549  const char *existingSearch = (const char*)GBS_read_hash(searchHash, searchtext);
550  if (existingSearch) {
551  helpfilename = strdup(existingSearch);
552  }
553  else {
554  char *helpname = GB_unique_filename("arb", "hlp");
555  helpfilename = GB_create_tempfile(helpname);
556  free(helpname);
557  }
558 
559  if (!helpfilename) error = GB_await_error();
560  else {
561  char *quotedSearchExpression = GBK_singlequote(GBS_global_string("^[^#]*%s", searchtext));
562  char *quotedDocpath = GBK_singlequote(GB_getenvDOCPATH());
563  const char *gen_help_tmpl = "cd %s;grep -i %s `find . -name \"*.hlp\"` | arb_sed -e 'sI:.*IIg' -e 'sI^\\./IIg' | sort | uniq > %s";
564  char *gen_help_cmd = GBS_global_string_copy(gen_help_tmpl, quotedDocpath, quotedSearchExpression, helpfilename);
565 
566  error = GBK_system(gen_help_cmd);
567 
568  free(gen_help_cmd);
569  free(quotedDocpath);
570  free(quotedSearchExpression);
571  GB_remove_on_exit(helpfilename);
572  }
573  }
574 
575  if (!error) {
576  char *result = GB_read_file(helpfilename);
577  if (!result) error = GB_await_error();
578  else {
579  // write temporary helpfile containing links to matches as subtopics
580 
581  FILE *helpfp = fopen(helpfilename, "wt");
582  if (!helpfp) error = GB_export_IO_error("writing helpfile", helpfilename);
583  else {
584  fprintf(helpfp, "\nUP arb.hlp\n");
585  if (last_help) fprintf(helpfp, "UP %s\n", last_help);
586  fputc('\n', helpfp);
587 
588  int results = 0;
589  char *rp = result;
590  while (1) {
591  char *eol = strchr(rp, '\n');
592  if (!eol) {
593  eol = rp;
594  while (*eol) ++eol;
595  }
596  if (eol>rp) {
597  char old = eol[0];
598  eol[0] = 0;
599  fprintf(helpfp, "SUB %s\n", rp);
600  results++;
601  eol[0] = old;
602  }
603  if (eol[0]==0) break; // all results inserted
604  rp = eol+1;
605  }
606 
607  fprintf(helpfp, "\nTITLE\t\tResult of search for '%s'\n\n", searchtext);
608  if (results>0) fprintf(helpfp, "\t\t%i results are shown as subtopics\n", results);
609  else fprintf(helpfp, "\t\tThere are no results.\n");
610 
611  if (results>0) freedup(last_help, helpfilename);
612 
613  fclose(helpfp);
614  aww->get_root()->awar(AWAR_HELPFILE)->write_string(helpfilename); // display results in aws
615  }
616  free(result);
617  GBS_write_hash(searchHash, searchtext, (long)strdup(helpfilename));
618  }
619  }
620  free(helpfilename);
621  }
622 
623  if (error) aw_message(error);
624 
625  free(searchtext);
626 }
627 
628 void AW_help_popup(UNFIXED, const char *help_file) {
629  static AW_window_simple *aws = NULp;
630 
632 
633  if (!aws) {
638 
639  aws = new AW_window_simple;
640  aws->init(awr, "HELP", "HELP WINDOW");
641  aws->load_xfig("help.fig");
642 
643  aws->button_length(9);
644  aws->auto_space(5, 5);
645 
646  aws->at("close");
647  aws->callback(AW_POPDOWN);
648  aws->create_button("CLOSE", "CLOSE", "C");
649 
650  aws->callback(aw_help_back);
651  aws->create_button("BACK", "BACK", "B");
652 
653  aws->callback(aw_help_history);
654  aws->create_button("HISTORY", "HISTORY", "H");
655 
656  aws->at("expression");
657  aws->d_callback(makeWindowCallback(aw_help_search)); // enable ENTER in searchfield to start search
658  aws->create_input_field(AWAR_HELPSEARCH, 40);
659  aws->callback(aw_help_search);
660  aws->create_button("SEARCH", "SEARCH", "S", "+");
661 
662  aws->at("browse");
663  aws->callback(aw_help_browse);
664  aws->create_button("BROWSE", "BROWSE", "B");
665 
666  aws->callback(aw_help_edit_help);
667  aws->create_button("EDIT", "EDIT", "E");
668 
669  aws->at("super");
670  HELP.uplinks = aws->create_selection_list(AWAR_HELPFILE);
671  HELP.uplinks->insert_default(" ", "");
672  HELP.uplinks->update();
673 
674  aws->at("sub");
675  HELP.links = aws->create_selection_list(AWAR_HELPFILE);
676  HELP.links->insert_default(" ", "");
677  HELP.links->update();
678  HELP.history = NULp;
679 
680  aws->at("text");
681  aws->create_text_field(AWAR_HELPTEXT, 3, 3);
682 
683 #if defined(TRACK_HELPFILE)
684  awr->add_timed_callback(TRACK_FREQUENCY, makeTimedCallback(autorefresh_helpfile));
685 #endif
686  }
687 
688  aw_assert(help_file);
689 
690  awr->awar(AWAR_HELPFILE)->write_string(help_file);
691 
692  if (!GBS_string_matches(help_file, "*.ps", GB_IGNORE_CASE) &&
693  !GBS_string_matches(help_file, "*.pdf", GB_IGNORE_CASE))
694  { // don't open help if postscript or pdf file
695  aws->activate();
696  }
697 }
698 
699 
700 
GB_ERROR GBK_system(const char *system_command)
Definition: arb_msg.cxx:571
const char * GB_ERROR
Definition: arb_core.h:25
string result
static void aw_help_back(AW_window *aww)
Definition: AW_help.cxx:272
void GB_remove_on_exit(const char *filename)
Definition: adsocket.cxx:1258
size_t size() const
Definition: arb_strarray.h:85
static void aw_help_helpfile_changed_cb(AW_root *awr)
Definition: AW_help.cxx:422
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
Definition: adhash.cxx:454
static GB_ERROR aw_help_show_external_format(const char *help_file, const char *viewer)
Definition: AW_help.cxx:323
const char * GBS_global_string_to_buffer(char *buffer, size_t bufsize, const char *templat,...)
Definition: arb_msg.cxx:178
void AW_edit(const char *path)
Definition: AW_edit.cxx:16
static void aw_help_browse(AW_window *aww)
Definition: AW_help.cxx:521
static const char * develDocPath()
Definition: AW_help.cxx:31
static void aw_help_select_newest_in_history(AW_root *aw_root)
Definition: AW_help.cxx:261
void AW_edit_notified(const char *path, const FileChangedCallback &callback)
Definition: AW_edit.cxx:33
#define AWAR_HELPSEARCH
Definition: AW_help.cxx:29
GB_ERROR GB_export_IO_error(const char *action, const char *filename)
Definition: arb_msg.cxx:318
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
static struct @64 HELP
const char * title
Definition: readseq.c:22
GB_HASH * GBS_create_dynaval_hash(long estimated_elements, GB_CASE case_sens, void(*freefun)(long))
Definition: adhash.cxx:271
char * GBS_string_eval(const char *insource, const char *icommand)
Definition: admatch.cxx:699
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void add_timed_callback(int ms, const TimedCallback &tcb)
Definition: AW_root.cxx:538
char * ARB_strpartdup(const char *start, const char *end)
Definition: arb_string.h:51
long GB_size_of_file(const char *path)
Definition: arb_file.cxx:28
GB_CSTR GB_getenvARB_GS(void)
Definition: adsocket.cxx:640
GB_CSTR GBS_find_string(GB_CSTR cont, GB_CSTR substr, int match_mode)
Definition: admatch.cxx:103
void GBT_split_string(ConstStrArray &dest, const char *namelist, const char *separator, bool dropEmptyTokens)
Definition: arb_strarray.h:232
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:231
struct Unfixed_cb_parameter * UNFIXED
Definition: cb_base.h:15
static HelixNrInfo * start
const char * read_char_pntr() const
Definition: AW_awar.cxx:168
GB_ERROR GB_export_error(const char *error)
Definition: arb_msg.cxx:257
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:342
static AW_root * SINGLETON
Definition: aw_root.hxx:102
char * GB_create_tempfile(const char *name)
Definition: adsocket.cxx:1222
#define AWAR_HELPTEXT
Definition: AW_help.cxx:28
static char * get_local_help_url(AW_root *awr)
Definition: AW_help.cxx:134
void GB_clear_error()
Definition: arb_msg.cxx:354
unsigned long GB_time_of_file(const char *path)
Definition: arb_file.cxx:44
#define aw_assert(bed)
Definition: aw_position.hxx:29
static void aw_help_search(AW_window *aww)
Definition: AW_help.cxx:532
void touch()
Definition: AW_awar.cxx:207
static void error(const char *msg)
Definition: mkptypes.cxx:96
#define AWAR_HELPFILE
Definition: AW_help.cxx:27
GB_CSTR GB_path_in_ARBHOME(const char *relative_path)
Definition: adsocket.cxx:1149
fputc('\n', stderr)
GB_CSTR GB_getenvHTMLDOCPATH(void)
Definition: adsocket.cxx:686
GB_CSTR GB_getenvDOCPATH(void)
Definition: adsocket.cxx:676
static void aw_help_history(AW_window *aww)
Definition: AW_help.cxx:292
void GBS_dynaval_free(long val)
Definition: adhash.cxx:278
char * read_string() const
Definition: AW_awar.cxx:198
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
char * history
Definition: AW_help.cxx:61
AW_selection_list * links
Definition: AW_help.cxx:60
bool GB_is_writeablefile(const char *filename)
Definition: arb_file.cxx:148
static char * aw_ref_to_title(const char *ref)
Definition: AW_help.cxx:230
char * GB_unique_filename(const char *name_prefix, const char *suffix)
Definition: adsocket.cxx:1233
char * GBK_singlequote(const char *arg)
Definition: arb_msg.cxx:599
bool GB_is_directory(const char *path)
Definition: arb_file.cxx:176
static char eol[3]
GB_CSTR GB_getenvARB_PDFVIEW(void)
Definition: adsocket.cxx:659
const char * GBS_static_string(const char *str)
Definition: arb_msg.cxx:212
void aw_message(const char *msg)
Definition: AW_status.cxx:1142
AW_root * get_root()
Definition: aw_window.hxx:354
void GB_split_full_path(const char *fullpath, char **res_dir, char **res_fullname, char **res_name_only, char **res_suffix)
Definition: adsocket.cxx:1268
#define NULp
Definition: cxxforward.h:114
bool GB_is_regularfile(const char *path)
Definition: arb_file.cxx:76
static void aw_help_edit_help(AW_window *aww)
Definition: AW_help.cxx:194
void AW_help_popup(UNFIXED, const char *help_file)
Definition: AW_help.cxx:628
#define AWAR_WWW_BROWSER
GB_ERROR write_string(const char *aw_string)
static char * command
Definition: arb_a2ps.c:319
static char * get_full_qualified_help_file_name(const char *helpfile, bool path_for_edit=false)
Definition: AW_help.cxx:64
bool ARB_strBeginsWith(const char *str, const char *with)
Definition: arb_str.h:42
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
bool GBS_string_matches(const char *str, const char *expr, GB_CASE case_sens)
Definition: admatch.cxx:193
void AW_openURL(AW_root *aw_root, const char *url)
Definition: AW_help.cxx:35
const char * GB_CSTR
Definition: arbdb_base.h:25
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
long GBS_read_hash(const GB_HASH *hs, const char *key)
Definition: adhash.cxx:392
AW_selection_list * uplinks
Definition: AW_help.cxx:59
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:194
char * GB_read_file(const char *path)
Definition: adsocket.cxx:287