1. /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. Titolo: algr-01.cpp - versione 1.0
  3. Scopo: Finestra vuota
  4. Sistema: Linux - Slackware 13.37
  5. Compila: g++ algr-01.cpp -o algr-01 -Wall -O2 -s \
  6. $(pkg-config --libs allegro-5.0 allegro_image-5.0)
  7. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
  8. #include "stdio.h"
  9. #include "allegro5/allegro.h"
  10. #include "allegro5/allegro_image.h"
  11. #define DIM_H 640
  12. #define DIM_V 200
  13. #define TITOLO "algr-01"
  14. #define ICONA "algr-icon.bmp"
  15. int GestErrori(int e);
  16. int main(int argc, char **argv) {
  17. ALLEGRO_DISPLAY *display = NULL;
  18. ALLEGRO_BITMAP *icona;
  19. ALLEGRO_EVENT_QUEUE *queue;
  20. if(!al_init()) return GestErrori(1);
  21. display = al_create_display(DIM_H, DIM_V);
  22. if(!display) return GestErrori(2);
  23. al_clear_to_color(al_map_rgb(50,100,100));
  24. al_set_window_title(display, TITOLO);
  25. al_install_keyboard();
  26. al_init_image_addon();
  27. icona = al_load_bitmap(ICONA);
  28. if (!icona) return GestErrori(3);
  29. al_set_display_icon(display, icona);
  30. al_flip_display();
  31. queue = al_create_event_queue();
  32. al_register_event_source(queue, al_get_keyboard_event_source());
  33. al_register_event_source(queue, al_get_display_event_source(display));
  34. for (;;) {
  35. ALLEGRO_EVENT event;
  36. al_wait_for_event(queue, &event);
  37. if (event.type == ALLEGRO_EVENT_KEY_DOWN &&
  38. event.keyboard.keycode == ALLEGRO_KEY_ESCAPE) break;
  39. if (event.type == ALLEGRO_EVENT_DISPLAY_CLOSE) break;
  40. }
  41. al_destroy_display(display);
  42. al_destroy_bitmap(icona);
  43. return 0;
  44. }
  45. int GestErrori(int e) {
  46. const char* msg="";
  47. switch(e) {
  48. case 1: msg ="Errore Inizializzazione Allegro!\n";
  49. break;
  50. case 2: msg ="Errore Creazione Display!\n";
  51. break;
  52. case 3: msg ="Errore Lettura Icona!\n";
  53. break;
  54. }
  55. fprintf(stderr, "%s", msg);
  56. return -1;
  57. }
  1. #include "stdio.h"
  2. #include "allegro5/allegro.h"
  3. #include "allegro5/allegro_image.h"
  1. #define DIM_H 640
  2. #define DIM_V 200
  3. #define TITOLO "algr-01"
  4. #define ICONA "algr-icon.bmp"
  1. int GestErrori(int e);
  1. int main(int argc, char **argv) {
  2. ALLEGRO_DISPLAY *display = NULL;
  3. ALLEGRO_BITMAP *icona;
  4. ALLEGRO_EVENT_QUEUE *queue;
  1. if(!al_init()) return GestErrori(1);
  2. display = al_create_display(DIM_H, DIM_V);
  3. if(!display) return GestErrori(2);
  4. al_clear_to_color(al_map_rgb(50,100,100));
  5. al_set_window_title(display, TITOLO);
  6. al_install_keyboard();
  1. al_init_image_addon();
  2. icona = al_load_bitmap(ICONA);
  3. if (!icona) return GestErrori(3);
  4. al_set_display_icon(display, icona);
  5. al_flip_display();
  1. queue = al_create_event_queue();
  2. al_register_event_source(queue, al_get_keyboard_event_source());
  3. al_register_event_source(queue, al_get_display_event_source(display));
  1. for (;;) {
  2. ALLEGRO_EVENT event;
  3. al_wait_for_event(queue, &event);
  4. if (event.type == ALLEGRO_EVENT_KEY_DOWN &&
  5. event.keyboard.keycode == ALLEGRO_KEY_ESCAPE) break;
  6. if (event.type == ALLEGRO_EVENT_DISPLAY_CLOSE) break;
  7. }
  1. al_destroy_display(display);
  2. al_destroy_bitmap(icona);
  3. return 0;
  1. int GestErrori(int e) {
  2. const char* msg="";
  3. switch(e) {
  4. case 1: msg ="Errore Inizializzazione Allegro!\n";
  5. break;
  6. case 2: msg ="Errore Creazione Display!\n";
  7. break;
  8. case 3: msg ="Errore Lettura Icona!\n";
  9. break;
  10. }
  11. fprintf(stderr, "%s", msg);
  12. return -1;
  13. }
  1. /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. Titolo: algr-02.cpp - versione 1.0
  3. Scopo: Disegna dei pixel
  4. Sistema: Linux - Slackware 13.37
  5. Compila: g++ algr-02.cpp -o algr-02 -Wall -O2 -s \
  6. $(pkg-config --libs allegro-5.0)
  7. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
  8. #include <allegro5/allegro.h>
  9. #include <stdio.h>
  10. #include "algr-common.cpp"
  11. #define WIDTH 640
  12. #define HEIGHT 200
  13. #define NUM_STARS 300
  14. #define TARGET_FPS 9999
  15. typedef struct Point
  16. {
  17. float x, y;
  18. } Point;
  19. int main(void)
  20. {
  21. ALLEGRO_DISPLAY *display;
  22. ALLEGRO_KEYBOARD_STATE key_state;
  23. Point stars[3][NUM_STARS/3];
  24. float speeds[3] = { 0.0001f, 0.05f, 0.15f };
  25. ALLEGRO_COLOR colors[3];
  26. long start, now, elapsed, frame_count;
  27. int total_frames = 0;
  28. double program_start;
  29. double length;
  30. int layer, star;
  31. ALLEGRO_LOCKED_REGION *lr;
  32. if (!al_init()) {
  33. abort_example("Errore nella inizializzazione di allegro!\n");
  34. return 1;
  35. }
  36. al_install_keyboard();
  37. display = al_create_display(WIDTH, HEIGHT);
  38. if (!display) {
  39. abort_example("Errore nella creazione del display!\n");
  40. return 1;
  41. }
  42. colors[0] = al_map_rgba(255, 100, 255, 128);
  43. colors[1] = al_map_rgba(255, 100, 100, 255);
  44. colors[2] = al_map_rgba(100, 100, 255, 255);
  45. for (layer = 0; layer < 3; layer++) {
  46. for (star = 0; star < NUM_STARS/3; star++) {
  47. Point *p = &stars[layer][star];
  48. p->x = rand() % WIDTH;
  49. p->y = rand() % HEIGHT;
  50. }
  51. }
  52. start = al_get_time() * 1000;
  53. now = start;
  54. elapsed = 0;
  55. frame_count = 0;
  56. program_start = al_get_time();
  57. while (1) {
  58. if (frame_count < (1000/TARGET_FPS)) {
  59. frame_count += elapsed;
  60. }
  61. else {
  62. int X, Y;
  63. frame_count -= (1000/TARGET_FPS);
  64. al_clear_to_color(al_map_rgb(0, 0, 0));
  65. for (star = 0; star < NUM_STARS/3; star++) {
  66. Point *p = &stars[0][star];
  67. al_draw_pixel(p->x, p->y, colors[0]);
  68. }
  69. lr = al_lock_bitmap(al_get_backbuffer(display), ALLEGRO_PIXEL_FORMAT_ANY, 0);
  70. for (layer = 1; layer < 3; layer++) {
  71. for (star = 0; star < NUM_STARS/3; star++) {
  72. Point *p = &stars[layer][star];
  73. // put_pixel ignores blending
  74. al_put_pixel(p->x, p->y, colors[layer]);
  75. }
  76. }
  77. /* Check that dots appear at the window extremes. */
  78. X = WIDTH - 1;
  79. Y = HEIGHT - 1;
  80. al_put_pixel(0, 0, al_map_rgb_f(1, 1, 1));
  81. al_put_pixel(X, 0, al_map_rgb_f(1, 1, 1));
  82. al_put_pixel(0, Y, al_map_rgb_f(1, 1, 1));
  83. al_put_pixel(X, Y, al_map_rgb_f(1, 1, 1));
  84. al_unlock_bitmap(al_get_backbuffer(display));
  85. al_flip_display();
  86. total_frames++;
  87. }
  88. now = al_get_time() * 1000;
  89. elapsed = now - start;
  90. start = now;
  91. for (layer = 0; layer < 3; layer++) {
  92. for (star = 0; star < NUM_STARS/3; star++) {
  93. Point *p = &stars[layer][star];
  94. p->y -= speeds[layer] * elapsed;
  95. if (p->y < 0) {
  96. p->x = rand() % WIDTH;
  97. p->y = HEIGHT;
  98. }
  99. }
  100. }
  101. al_rest(0.001);
  102. al_get_keyboard_state(&key_state);
  103. if (al_key_down(&key_state, ALLEGRO_KEY_ESCAPE))
  104. break;
  105. }
  106. length = al_get_time() - program_start;
  107. if (length != 0) {
  108. printf("%d FPS\n", (int)(total_frames / length));
  109. }
  110. al_destroy_display(display);
  111. return 0;
  112. }
  1. /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. Titolo: algr-common.cpp - versione 1.0
  3. Scopo: Funzioni comuni da includere nei sorgenti
  4. Sistema: Linux - Slackware 13.37
  5. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
  6. #include <stdio.h>
  7. #include <stdarg.h>
  8. void abort_example(char const *format, ...);
  9. void open_log(void);
  10. void open_log_monospace(void);
  11. void close_log(bool wait_for_user);
  12. void log_printf(char const *format, ...);
  13. #ifdef ALLEGRO_POPUP_EXAMPLES
  14. #include "allegro5/allegro_native_dialog.h"
  15. ALLEGRO_TEXTLOG *textlog = NULL;
  16. void abort_example(char const *format, ...)
  17. {
  18. char str[1024];
  19. va_list args;
  20. ALLEGRO_DISPLAY *display;
  21. va_start(args, format);
  22. vsnprintf(str, sizeof str, format, args);
  23. va_end(args);
  24. display = al_is_system_installed() ? al_get_current_display() : NULL;
  25. al_show_native_message_box(display, "Error", "Cannot run example", str, NULL, 0);
  26. exit(1);
  27. }
  28. void open_log(void)
  29. {
  30. textlog = al_open_native_text_log("Log", 0);
  31. }
  32. void open_log_monospace(void)
  33. {
  34. textlog = al_open_native_text_log("Log", ALLEGRO_TEXTLOG_MONOSPACE);
  35. }
  36. void close_log(bool wait_for_user)
  37. {
  38. if (textlog && wait_for_user) {
  39. ALLEGRO_EVENT_QUEUE *queue = al_create_event_queue();
  40. al_register_event_source(queue, al_get_native_text_log_event_source(
  41. textlog));
  42. al_wait_for_event(queue, NULL);
  43. al_destroy_event_queue(queue);
  44. }
  45. al_close_native_text_log(textlog);
  46. textlog = NULL;
  47. }
  48. void log_printf(char const *format, ...)
  49. {
  50. char str[1024];
  51. va_list args;
  52. va_start(args, format);
  53. vsnprintf(str, sizeof str, format, args);
  54. va_end(args);
  55. al_append_native_text_log(textlog, "%s", str);
  56. }
  57. #else
  58. void abort_example(char const *format, ...)
  59. {
  60. va_list args;
  61. va_start(args, format);
  62. vfprintf(stderr, format, args);
  63. va_end(args);
  64. exit(1);
  65. }
  66. void open_log(void)
  67. {
  68. }
  69. void open_log_monospace(void)
  70. {
  71. }
  72. void close_log(bool wait_for_user)
  73. {
  74. (void)wait_for_user;
  75. }
  76. void log_printf(char const *format, ...)
  77. {
  78. va_list args;
  79. va_start(args, format);
  80. vprintf(format, args);
  81. va_end(args);
  82. }
  83. #endif
  1. /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. Titolo: algr-03.cpp - versione 1.0
  3. Scopo: Visualizza immagine ed effettua zoom
  4. Sistema: Linux - Slackware 13.37
  5. Compila: g++ algr-03.cpp -o algr-03 -Wall -O2 -s \
  6. $(pkg-config --libs allegro-5.0 allegro_image-5.0)
  7. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include "allegro5/allegro.h"
  11. #include "allegro5/allegro_image.h"
  12. #include "algr-common.cpp"
  13. int main(int argc, const char *argv[])
  14. {
  15. const char *filename;
  16. ALLEGRO_DISPLAY *display;
  17. ALLEGRO_BITMAP *membitmap, *bitmap;
  18. ALLEGRO_TIMER *timer;
  19. ALLEGRO_EVENT_QUEUE *queue;
  20. bool redraw = true;
  21. double zoom = 1;
  22. double t0;
  23. double t1;
  24. if (argc > 1) {
  25. filename = argv[1];
  26. }
  27. else {
  28. filename = "mysha.bmp";
  29. }
  30. if (!al_init()) {
  31. abort_example("Errore nella inizializzazione di allegro!\n");
  32. }
  33. if (argc > 2) {
  34. al_set_new_display_adapter(atoi(argv[2]));
  35. }
  36. al_install_mouse();
  37. al_install_keyboard();
  38. al_init_image_addon();
  39. display = al_create_display(640, 200);
  40. if (!display) {
  41. abort_example("Errore nella creazione del display!\n");
  42. }
  43. al_set_window_title(display, filename);
  44. /* We load the bitmap into a memory bitmap, because creating a
  45. * display bitmap could fail if the bitmap is too big to fit into a
  46. * single texture.
  47. * FIXME: Or should A5 automatically created multiple display bitmaps?
  48. */
  49. al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
  50. t0 = al_get_time();
  51. membitmap = al_load_bitmap(filename);
  52. t1 = al_get_time();
  53. if (!membitmap) {
  54. abort_example("%s non trovato\n", filename);
  55. }
  56. al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP);
  57. printf("Trascorsi %.4f secondi per caricarsi\n", t1 - t0);
  58. // FIXME:
  59. // Now try to split the memory bitmap into display bitmaps?
  60. bitmap = al_clone_bitmap(membitmap);
  61. if (!bitmap)
  62. bitmap = membitmap;
  63. timer = al_create_timer(1.0 / 30);
  64. queue = al_create_event_queue();
  65. al_register_event_source(queue, al_get_keyboard_event_source());
  66. al_register_event_source(queue, al_get_display_event_source(display));
  67. al_register_event_source(queue, al_get_timer_event_source(timer));
  68. al_start_timer(timer);
  69. while (1) {
  70. ALLEGRO_EVENT event;
  71. al_wait_for_event(queue, &event);
  72. if (event.type == ALLEGRO_EVENT_DISPLAY_ORIENTATION) {
  73. int o = event.display.orientation;
  74. if (o == ALLEGRO_DISPLAY_ORIENTATION_0_DEGREES) {
  75. printf("0 gradi\n");
  76. }
  77. else if (o == ALLEGRO_DISPLAY_ORIENTATION_90_DEGREES) {
  78. printf("90 gradi\n");
  79. }
  80. else if (o == ALLEGRO_DISPLAY_ORIENTATION_180_DEGREES) {
  81. printf("180 gradi\n");
  82. }
  83. else if (o == ALLEGRO_DISPLAY_ORIENTATION_270_DEGREES) {
  84. printf("270 gradi\n");
  85. }
  86. else if (o == ALLEGRO_DISPLAY_ORIENTATION_FACE_UP) {
  87. printf("Normale\n");
  88. }
  89. else if (o == ALLEGRO_DISPLAY_ORIENTATION_FACE_DOWN) {
  90. printf("Capovolto\n");
  91. }
  92. }
  93. if (event.type == ALLEGRO_EVENT_DISPLAY_CLOSE)
  94. break;
  95. if (event.type == ALLEGRO_EVENT_KEY_CHAR) {
  96. if (event.keyboard.keycode == ALLEGRO_KEY_ESCAPE)
  97. break;
  98. if (event.keyboard.unichar == '1')
  99. zoom = 1;
  100. if (event.keyboard.unichar == '+')
  101. zoom *= 1.1;
  102. if (event.keyboard.unichar == '-')
  103. zoom /= 1.1;
  104. if (event.keyboard.unichar == 'f')
  105. zoom = (double)al_get_display_width(display) /
  106. al_get_bitmap_width(bitmap);
  107. }
  108. if (event.type == ALLEGRO_EVENT_TIMER)
  109. redraw = true;
  110. if (redraw && al_is_event_queue_empty(queue)) {
  111. redraw = false;
  112. al_clear_to_color(al_map_rgb_f(0, 0, 0));
  113. if (zoom == 1)
  114. al_draw_bitmap(bitmap, 0, 0, 0);
  115. else
  116. al_draw_scaled_rotated_bitmap(
  117. bitmap, 0, 0, 0, 0, zoom, zoom, 0, 0);
  118. al_flip_display();
  119. }
  120. }
  121. al_destroy_bitmap(bitmap);
  122. return 0;
  123. }
  124. /* vim: set sts=4 sw=4 et: */
  1. /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. Titolo: algr-04.cpp - versione 1.0
  3. Scopo: Immagine in rotazione
  4. Sistema: Linux - Slackware 13.37
  5. Compila: g++ algr-04.cpp -o algr-04 -Wall -O2 -s \
  6. $(pkg-config --libs allegro-5.0 allegro_image-5.0)
  7. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
  8. /*
  9. * Example program for the Allegro library, by Peter Wang.
  10. */
  11. #include <allegro5/allegro.h>
  12. #include "allegro5/allegro_image.h"
  13. #include <math.h>
  14. #include "algr-common.cpp"
  15. int main(void)
  16. {
  17. const int display_w = 640;
  18. const int display_h = 200;
  19. ALLEGRO_DISPLAY *dpy;
  20. ALLEGRO_BITMAP *buf;
  21. ALLEGRO_BITMAP *bmp;
  22. ALLEGRO_BITMAP *mem_bmp;
  23. ALLEGRO_BITMAP *src_bmp;
  24. int bmp_w;
  25. int bmp_h;
  26. ALLEGRO_EVENT_QUEUE *queue;
  27. ALLEGRO_EVENT event;
  28. double theta = 0;
  29. double k = 1.0;
  30. int mode = 0;
  31. bool wide_mode = false;
  32. bool mem_src_mode = false;
  33. bool trans_mode = false;
  34. int flags = 0;
  35. bool clip_mode = false;
  36. ALLEGRO_COLOR trans;
  37. if (!al_init()) {
  38. abort_example("Errore nella inizializzazione di allegro!\n");
  39. return 1;
  40. }
  41. al_install_keyboard();
  42. al_init_image_addon();
  43. open_log();
  44. log_printf("Press 'w' to toggle wide mode.\n");
  45. log_printf("Press 's' to toggle memory source bitmap.\n");
  46. log_printf("Press space to toggle drawing to backbuffer or off-screen bitmap.\n");
  47. log_printf("Press 't' to toggle translucency.\n");
  48. log_printf("Press 'h' to toggle horizontal flipping.\n");
  49. log_printf("Press 'v' to toggle vertical flipping.\n");
  50. log_printf("Press 'c' to toggle clipping.\n");
  51. log_printf("\n");
  52. dpy = al_create_display(display_w, display_h);
  53. if (!dpy) {
  54. abort_example("Errore nella creazione del display!\n");
  55. return 1;
  56. }
  57. buf = al_create_bitmap(display_w, display_h);
  58. if (!buf) {
  59. abort_example("Errore nel creare il buffer\n\n");
  60. return 1;
  61. }
  62. bmp = al_load_bitmap("mysha.bmp");
  63. if (!bmp) {
  64. abort_example("Errore nel caricare l'immagine\n");
  65. return 1;
  66. }
  67. al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
  68. mem_bmp = al_load_bitmap("mysha.bmp");
  69. if (!mem_bmp) {
  70. abort_example("Errore nel caricare l'immagine\n");
  71. return 1;
  72. }
  73. bmp_w = al_get_bitmap_width(bmp);
  74. bmp_h = al_get_bitmap_height(bmp);
  75. queue = al_create_event_queue();
  76. al_register_event_source(queue, al_get_keyboard_event_source());
  77. while (true) {
  78. if (al_get_next_event(queue, &event)) {
  79. if (event.type == ALLEGRO_EVENT_KEY_CHAR) {
  80. if (event.keyboard.keycode == ALLEGRO_KEY_ESCAPE)
  81. break;
  82. if (event.keyboard.unichar == ' ') {
  83. mode = !mode;
  84. if (mode == 0)
  85. log_printf("Drawing to off-screen buffer\n");
  86. else
  87. log_printf("Drawing to display backbuffer\n");
  88. }
  89. if (event.keyboard.unichar == 'w')
  90. wide_mode = !wide_mode;
  91. if (event.keyboard.unichar == 's') {
  92. mem_src_mode = !mem_src_mode;
  93. if (mem_src_mode)
  94. log_printf("Source is memory bitmap\n");
  95. else
  96. log_printf("Source is display bitmap\n");
  97. }
  98. if (event.keyboard.unichar == 't')
  99. trans_mode = !trans_mode;
  100. if (event.keyboard.unichar == 'h')
  101. flags ^= ALLEGRO_FLIP_HORIZONTAL;
  102. if (event.keyboard.unichar == 'v')
  103. flags ^= ALLEGRO_FLIP_VERTICAL;
  104. if (event.keyboard.unichar == 'c')
  105. clip_mode = !clip_mode;
  106. }
  107. }
  108. /*
  109. * mode 0 = draw scaled to off-screen buffer before
  110. * blitting to display backbuffer
  111. * mode 1 = draw scaled to display backbuffer
  112. */
  113. if (mode == 0) {
  114. al_set_target_bitmap(buf);
  115. }
  116. else {
  117. al_set_target_backbuffer(dpy);
  118. }
  119. src_bmp = (mem_src_mode) ? mem_bmp : bmp;
  120. k = (wide_mode) ? 2.0 : 1.0;
  121. al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO);
  122. trans = al_map_rgba_f(1, 1, 1, 1);
  123. if (mode == 0)
  124. al_clear_to_color(al_map_rgba_f(1, 0, 0, 1));
  125. else
  126. al_clear_to_color(al_map_rgba_f(0, 0, 1, 1));
  127. if (trans_mode) {
  128. al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA);
  129. trans = al_map_rgba_f(1, 1, 1, 0.5);
  130. }
  131. if (clip_mode) {
  132. al_set_clipping_rectangle(50, 50, display_w - 100, display_h - 100);
  133. }
  134. else {
  135. al_set_clipping_rectangle(0, 0, display_w, display_h);
  136. }
  137. al_draw_tinted_scaled_rotated_bitmap(src_bmp,
  138. trans,
  139. 50, 50, display_w/2, display_h/2,
  140. k, k, theta,
  141. flags);
  142. if (mode == 0) {
  143. al_set_target_backbuffer(dpy);
  144. al_set_clipping_rectangle(0, 0, display_w, display_h);
  145. al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ZERO);
  146. al_draw_bitmap(buf, 0, 0, 0);
  147. }
  148. al_flip_display();
  149. al_rest(0.01);
  150. theta -= 0.01;
  151. }
  152. al_destroy_bitmap(bmp);
  153. al_destroy_bitmap(mem_bmp);
  154. al_destroy_bitmap(buf);
  155. close_log(false);
  156. return 0;
  157. }
  158. /* vim: set sts=3 sw=3 et: */